Http://www.mouseos.com/win64/registers.html
Below is an excerpt from the MSDN article, under Win64 for registers use
Register |
Status |
Use |
RAX |
Volatile |
Return Value Register |
RCX |
Volatile |
First integer argument |
Rdx |
Volatile |
Second integer Argument |
R8 |
Volatile |
Third integer Argument |
R9 |
Volatile |
Fourth integer argument |
R10:r11 |
Volatile |
Must is preserved as needed by caller; Used in Syscall/sysret instructions |
R12:r15 |
Nonvolatile |
Must is preserved by callee |
RDI |
Nonvolatile |
Must is preserved by callee |
RSI |
Nonvolatile |
Must is preserved by callee |
RBX |
Nonvolatile |
Must is preserved by callee |
RBP |
Nonvolatile |
May be used as a frame pointer; Must is preserved by callee |
RSP |
Nonvolatile |
Stack pointer |
XMM0 |
Volatile |
First FP argument |
XMM1 |
Volatile |
Second FP argument |
XMM2 |
Volatile |
Third FP argument |
XMM3 |
Volatile |
Fourth FP argument |
Xmm4:xmm5 |
Volatile |
Must is preserved as needed by caller |
Xmm6:xmm15 |
Nonvolatile |
Must is preserved as needed by callee. |
1. Passing parameters
Use the following registers in the Win64 to pass the parameters:
- RCX -1th parameter
- RDX -2nd parameter
- R8 -3rd parameter
- R9 -4th parameter
Additional parameters are passed through the stack.
Use the following registers to pass the number of floats:
- xmm0 -1th parameter
- xmm1 -2nd parameter
- xmm2 -3rd parameter
- xmm3 -4th parameter
Win Register Usage