[fpc-devel] OO rewrite - technical questions

Michael Schnell mschnell at lumino.de
Wed Jul 21 10:46:37 CEST 2010

  On 07/20/2010 03:54 PM, Jonas Maebe wrote:
> The "register" calling convention is Borland-specific and does not 
> specify anything regarding the segment registers: 
> http://docwiki.embarcadero.com/RADStudio/en/Program_Control
Sorry. I did not expect that the ABI documentation is still that bad 
after all these years. It in fact does not even say what to do with the 
stack pointer (which is handled differently with STDCALL and CDECL and 
thus it's not really obvious that it needs to be preserved by the callee).

> I know of no single calling convention that says anything about the segment registers. It's an OS ABI issue at best, and at worst undefined behaviour.
IMHO the ABI documentation should define how all registers are handled :(

I think sometimes it might be useful for an ASM programmer to use the 
segment registers, and so he should be informed whether he needs to save 
and restore them.


More information about the fpc-devel mailing list