Uninformed: Informative Information for the Uninformed

Vol 4» 2006.Jun


Calling Convention

The calling convention used on x64 is much simpler than those used for x86. Unlike x86, where calling conventions like stdcall, cdecl, and fastcall are found, the x64 platform has only one calling convention. The calling convention that it uses is a derivative of fastcall where the first four parameters of a function are passed by register and any remaining parameters are passed through the stack. Each parameter is 64 bits wide (8 bytes). The first four parameters are passed through the RCX, RDX, R8, and R9 registers, respectively. For scenarios where parameters are passed by value or are otherwise too large to fit into one of the 64-bit registers, appropriate steps are taken as documented in [4].



Subsections