[fpc-pascal] Registers used by calling conventions

Sven Barth pascaldragon at googlemail.com
Sat Mar 9 13:57:17 CET 2019


Anthony Walter <sysrpl at gmail.com> schrieb am Fr., 8. März 2019, 22:34:

> What registers are used by default calling convention and where can I find
> more information about Free Pascal asm details?
>
> When writing code using the asm block on Delphi in Windows, the default
> calling convention (fastcall) would pass arguments in registers EAX, EDX,
> ECX then the stack in that order.
>
> Checking registers in Lazarus on 64 bit Linux, I see the default calling
> convention is using RSI and RDI, the source and destination index registers.
>
> Also is it possible to get the Lazarus assembler to show instructions in
> Intel mode rather than AT&T?
>

For the "register" calling convention on i386 (aka the default calling
convention there) you can also look at
packages/rtl-objpas/src/i386/invoke.inc which contains the function call
manager for i386 (and the x86_64 contains the one for that platform though
currently only the Win64 one is supported).

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190309/5adf58c5/attachment.html>


More information about the fpc-pascal mailing list