gcc 汇编器生成汇编代码
来源:互联网 发布:linux关闭开机自启动 编辑:程序博客网 时间:2024/05/19 22:56
命令是:gcc -S test.c
#include<stdio.h>
void main()
{
int i,j;
j=0;
i=j+1;
printf("hello world/n");
printf("the result is %d/n",i);
}
汇编代码是
.file "test.c"
.section .rodata
.LC0:
.string "hello world"
.LC1:
.string "the result is %d/n"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
andl $-16, %esp
subl $32, %esp
movl $0, 28(%esp)
movl 28(%esp), %eax
addl $1, %eax
movl %eax, 24(%esp)
movl $.LC0, (%esp)
call puts
movl $.LC1, %eax
movl 24(%esp), %edx
movl %edx, 4(%esp)
movl %eax, (%esp)
call printf
leave
ret
.size main, .-main
.ident "GCC: (GNU) 4.4.0 20090506 (Red Hat 4.4.0-4)"
.section .note.GNU-stack,"",@progbits
将i和j 的定义去掉,重新编译连接得到的是
.file "test.c"
.section .rodata
.LC0:
.string "hello world"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
andl $-16, %esp
subl $16, %esp
movl $.LC0, (%esp)
call puts
leave
ret
.size main, .-main
.ident "GCC: (GNU) 4.4.0 20090506 (Red Hat 4.4.0-4)"
.section .note.GNU-stack,"",@progbits
- gcc 汇编器生成汇编代码
- gcc 生成汇编代码
- GCC生成的汇编代码
- GCC生成的汇编代码
- GCC生成的汇编代码
- GCC生成的汇编代码
- GCC生成的汇编代码
- gcc查看汇编代码
- GCC内联汇编(2)GCC生成汇编代码简单实例
- 从asm_out_file看gcc汇编代码的生成
- 从asm_out_file看gcc汇编代码的生成
- GCC生成汇编文件解析
- GCC生成汇编文件解析
- GCC生成汇编文件解析
- iar生成汇编代码
- 生成汇编代码
- gcc产生的汇编代码
- gcc汇编代码写作技巧
- 关于J4ME在NOKIA6300上程序出错
- WML、XHTML MP 与WCSS
- RedHat Linux系统中安装ImageMagick
- 我国2008年各省市社会消费品零售总额
- 羽毛球大战
- gcc 汇编器生成汇编代码
- 第六章:异常处理
- xmlDoc
- Math函数性能比较
- C# OFFICE 2007控件 第三方控件DotNetBar
- Virtools脚本语言(VSL)教程 - 结构
- Siebel Tools: How to program Browser Script & Server Script
- java连接DBF
- webservice接口测试