Win Register Usage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.