不懂汇编,麻烦那位帮忙以下逐句解释一下
dfczj 2007-08-21 10:32:10 [root@xx btest]# cat test.c
#include <stdio.h>
int main(void){
char *a="test";
printf("%s\n",a);
return 0;
}
[root@xx btest]# gcc -S test.c
[root@xx btest]# cat test.s //不懂汇编,麻烦那位帮忙以下逐句解释一下.
.file "test.c"
.section .rodata //只读数据段
.LC0: //这种标号表示什么意思?
.string "test" //字符串常量
.LC1:
.string "%s\n" //常量
//下面是代码段的内容??
.text
.globl main
.type main,@function //下面的都不懂,解释一下
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
movl $.LC0, -4(%ebp)
subl $8, %esp
pushl -4(%ebp)
pushl $.LC1
call printf
addl $16, %esp
movl $0, %eax
leave
ret
.Lfe1:
.size main,.Lfe1-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.2.3 20030502 (Red Hat Linux 3.2.3-34)"
[root@xx btest]#