Here is some basic documentation for the various calling conventions on x86_64 architectures. This information largely comes from Wikipedia.

System V AMD64 ABI

Systems utilizing this convention:

  • Solaris
  • Linux
  • BSD
  • MacOS
  • OpenVMS
  • GCC, Intel C++ Compiler, Clang, Delphi
RegistersStack OrderStack CleanupNotes
RDI, RSI, RDX, RCX, R8, R9, [XYZ]MM0-1RTL (C)CallerStack aligned on 16-byte boundary. 128-byte red zone below the stack. The kernel interface uses RDI, RSI, RDX, R10, R8, R9. In C++, this is the first parameter.

Microsoft x64 Calling Convention

Used by Microsoft Windows (Microsoft Visual C++, GCC, Intel C++ Compiler, Delphi), UEFI

RegistersStack OrderStack CleanupNotes
RCX/XMM0, RDX/XMM1, R8/XMM2, R9/XMM3RTL (C)CallerStack aligned on 16-byte boundary. 32-bytes shadow space on stack. The specified 8 registers can only be used for parameters 1 through 4. For C++ classes, the hidden this parameter is the first parameter, passed in RCX.


Used on Microsoft Windows (Microsoft Visual C++, Clang ICC)

RegistersStack OrderStack CleanupNotes
RCX/[XY]MM0, RDX/[XY]MM1, R8/[XY]MM2, R9/[XY]MM3 + [XY]MM4-5RTL (C)CallerExtended from MS x64.