[fpc-devel] arm embedded cortexm3 procedure address

Geoffrey Barton mrb at periphon.net
Wed Jul 14 18:27:08 CEST 2010


disassembling from an elf file produce by FPC cross-assembling for arm  
embedded, an empty procedure:-

procedure UART0int:nostackframe;
begin
end;


looks like this:-

000001a4 <P$UARTTEST_UART0INT>:
  1a4:	46f7      	mov	pc, lr
  1a6:	46c0      	nop			(mov r8, r8)

if I grab the address of this procedure as a constant in assembler (or  
assign it to a pointer using @; same result):-

asm
   .long UART0int
end;

the resulting constant disassembles as:-

1bc:	000001a5 	.word	0x000001a5

which seems to be one greater than the address of the procedure.
Is this right? If so, why?

also, why does the compiler sometimes add a 'nop' to the end of a  
procedure (as above)?

Geoffrey





More information about the fpc-devel mailing list