gcc 调用约定_x86-64通过gcc调用约定

在GNU/Linux系统上,GCC遵循System V AMD64 ABI的调用约定。整数和内存地址参数由RDI、RSI、RDX、RCX、R8和R9寄存器传递,浮点参数则使用XMM0到XMM7。系统调用时,R10替代RCX,额外参数堆栈传递,返回值在RAX中。了解更多详情可查阅相关文档。

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

Answered by anonymous.
匿名回答。

翻译自: https://www.systutorials.com/x86-64-calling-convention-by-gcc/

gcc 调用约定

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值