linux 64 参数传递方式
来源:互联网 发布:统一软件过程图 编辑:程序博客网 时间:2024/06/07 05:45
调用有八个参数的函数: 1 .file "eight_p.c" 2 .text 3 .globl eight_f 4 .type eight_f, @function 5 eight_f: 6 .LFB0: 7 .cfi_startproc 8 pushq %rbp 9 .cfi_def_cfa_offset 16 10 movq %rsp, %rbp 11 .cfi_offset 6, -16 12 .cfi_def_cfa_register 6 13 movl %esi, �x 14 movl �x, -12(%rbp) 15 movq %rcx, -24(%rbp) 16 movl %r8d, -28(%rbp) 17 movl %r9d, -32(%rbp) 18 movb %dil, -4(%rbp) 19 movw %ax, -8(%rbp) 20 leave 21 .cfi_def_cfa 7, 8 22 ret 23 .cfi_endproc 24 .LFE0: 25 .size eight_f, .-eight_f 26 .globl main 27 .type main, @function 28 main: 29 .LFB1: 30 .cfi_startproc 31 pushq %rbp 32 .cfi_def_cfa_offset 16 33 movq %rsp, %rbp 34 .cfi_offset 6, -16 35 .cfi_def_cfa_register 6 36 subq $32, %rsp 37 movl �i, -4(%rbp) 38 movq %rsi, -16(%rbp) 39 movl $8, 8(%rsp) 40 movl $7, (%rsp) 41 movl $6, %r9d 42 movl $5, %r8d 43 movl $4, �x 44 movl $3, �x 45 movl $2, %esi 46 movl $1, �i 47 call eight_f 48 leave 49 .cfi_def_cfa 7, 8 50 ret 51 .cfi_endproc 52 .LFE1: 53 .size main, .-main 54 .ident "GCC: (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2" 55 .section .note.GNU-stack,"",@progbits
eight_p.c
1 #include 2 3 void eight_f(char b,short c, int d, long e,int f,int g,int h,int k) 4 {} 5 6 int main(int argc,char*argv[]) 7 { 8 eight_f(1,2,3,4,5,6,7,8); 9 }
gcc -S eight_p.c
得到eight_p.s汇编文件:
可知前六个参数通过寄存器edi esi edx ecx r8d r9d传递,六个以后的参数通过堆栈传递。
- linux 64 参数传递方式
- 参数传递 可变长参数函数
- [转]linux shell if 参数
- [转]linux shell if 参数
- [转]linux shell if 参数
- url 传递参数(特殊字符)解决方法
- Linux shell 逆序输出输入的参数
- Linux rpm 命令参数使用…
- Linux rpm 命令参数使用…
- Oracle log_archive_format 参数
- 设置Linux内核参数 /et…
- linux 下查看文件编码方式
- Oracle 参数文件 spfile pfile
- ibatis iterator list 参数 …
- linux getopt函数
- Linux Kernel SMP …
- Linux Kernel SMP …
- Linux Kernel SMP …
- C语言struct机制
- 李开复最推崇的三个讲座
- xen-4.1.2 编译minios
- xen 4.1.2 串口调试
- bash 命令行快捷键
- linux 64 参数传递方式
- ubuntu上网络安装texlive 2012
- 在用作DomU运行的simple OS中…
- vim插件安装
- python sqlite数据库的诡异事件
- HP QuikeTest Professional 10安装
- python获取sessionid
- android root 权限
- window7安装过后有多大?6.18G