Yes, thatโs what he says, but thatโs not entirely accurate. The stack can be used, but only if your function has many parameters (or you write code that causes a spill).
If you look at the Wikipedia list of 64-bit Intel calling conventions , you will see that the registers are used to pass the first few parameters. There are two main 64-bit conventions for using Intel. For Microsoft ABI:
The Microsoft x64 calling convention uses the registers RCX, RDX, R8, R9 for the first four integers or pointers (in this order from left to right), and XMM0, XMM1, XMM2, XMM3 are used for floating point arguments. Additional arguments are pushed onto the stack (from right to left). Integer return values โโ(similar to x86) are returned in RAX if 64 bits or less. Returned floating point values โโare returned in XMM0. Parameters shorter than 64 bits are non-zero; high bits contain garbage.
And the V ABI system:
The first six integer or index arguments are passed to the registers RDI, RSI, RDX, RCX, R8 and R9, while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments ... As in Microsoft x64 calling convention, additional arguments are pushed onto the stack, and the return value is stored in RAX.
source share