gcc 调用约定
What is the x86-64 calling convention by gcc?
gcc的x86-64调用约定是什么?
The calling convention of the System V AMD64 ABI is followed on GNU/Linux. The registers RDI, RSI, RDX, RCX, R8, and R9 are used for integer and memory address arguments and XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments.
在GNU / Linux上遵循System V AMD64 ABI的调用约定。 寄存器RDI,RSI,RDX,RCX,R8和R9是用于整数和存储器地址的参数和XMM0,XMM1,XMM2,XMM3,XMM4,XMM5,XMM6和XMM7用于浮点参数。
For system calls, R10 is used instead of RCX. Additional arguments are passed on the stack and the return value is stored in RAX.
对于系统调用,使用R10代替RCX。 其他参数在堆栈上传递,返回值存储在RAX中。
Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell. System V Application Binary Interface AMD64 Architecture Processor Supplement. 0.99.6: http://x86-64.org/documentation/abi.pdf
Michael Matz,Jan Hubicka,Andreas Jaeger和Mark Mitchell。 系统V应用程序二进制接口AMD64体系结构处理器补充。 0.99.6: http ://x86-64.org/documentation/abi.pdf
x86 calling convention from Wikipedia: http://en.wikipedia.org/wiki/X86_calling_conventions#cite_note-AMD-9
来自Wikipedia的x86调用约定: http : //en.wikipedia.org/wiki/X86_calling_conventions#cite_note-AMD-9
翻译自: https://www.systutorials.com/x86-64-calling-convention-by-gcc/
gcc 调用约定
在GNU/Linux系统上,GCC遵循System V AMD64 ABI的调用约定。整数和内存地址参数由RDI、RSI、RDX、RCX、R8和R9寄存器传递,浮点参数则使用XMM0到XMM7。系统调用时,R10替代RCX,额外参数堆栈传递,返回值在RAX中。了解更多详情可查阅相关文档。

3106

被折叠的 条评论
为什么被折叠?



