edi,esi,edx, ecx, r8, r9, 栈传递
点击(此处)折叠或打开
- //test1为传递单个参数
- 401128: 8b 45 fc mov -0x4(%ebp),%eax
- 40112b: 89 04 24 mov %eax,(%esp)
- 40112e: e8 5d ff ff ff call 401090 <_test1>
- //test2为传递两个参数
- 401133: 8b 45 f8 mov -0x8(%ebp),%eax
- 401136: 89 44 24 04 mov %eax,0x4(%esp)
- 40113a: 8b 45 fc mov -0x4(%ebp),%eax
- 40113d: 89 04 24 mov %eax,(%esp)
- 401140: e8 58 ff ff ff call 40109d <_test2>
测试结果如下:
根据参数个数,按照顺序使用以上寄存器,当参数个数大于6个的时候,使用栈来传递参数