[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;

looks like this:-

  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):-

   .long UART0int

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)?


More information about the fpc-devel mailing list