www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - ABI documentation

reply Dom Disc <dominikus scherkl.de> writes:
I have looked into the Application Binary Interface document and 
found the following:

 39.12 Function Calling Conventions
 
 [...]
 
 39.12.2 Return Value
 
     long and ulong are returned in EDX,EAX, where EDX gets the 
 most significant half.
Is this really true? Or is this only for 32bit systems? Because, I see the return value of ulong in RAX. I'm also not sure if the convention for the input parameters has changed. For a function with three ulong parameters I get the parameters in RDI, RSI and RDX respectively. Where can I find the correct and current documentation for 64bit systems?
Dec 03 2025
parent Paul Backus <snarwin gmail.com> writes:
On Wednesday, 3 December 2025 at 09:07:21 UTC, Dom Disc wrote:
 Where can I find the correct and current documentation for 
 64bit systems?
First sentence under ["Function Calling Conventions"][1]:
 The `extern (C)` and `extern (D)` calling convention matches 
 the C calling convention used by the supported C compiler on 
 the host system. Except that the `extern (D)` calling 
 convention for Windows x86 is described here.
[1]: https://dlang.org/spec/abi.html#function_calling_conventions
Dec 03 2025