On 14 Jul 2010, at 17:35, Jonas Maebe wrote:
Geoffrey Barton wrote on Wed, 14 Jul 2010:
the resulting constant disassembles as:-
1bc: 000001a5 .word 0x000001a5
which seems to be one greater than the address of the procedure.
Is this right?
Yes.
If so, why?
To identify the code as Thumb code.
I was aware of the requirement to add one to the address of an ISR,
but not to other calls.
A normal procedural call seems to assemble as a 'BL' to an even
address? I must be missing something:-)
also, why does the compiler sometimes add a 'nop' to the end of a
procedure (as above)?
The default alignment of routines is 4 bytes. And it's most likely
the assembler or linker that adds the nop, rather than the compiler.
Yes, right. Probably the linker. Presumably because it is slightly
faster.
thanks,
Geoffrey
Jonas
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel