原来的C语言程序是这样的:
#include <stdio.h>
int main()
{
int a=5,b=0;
b=(a++)+1+(--a);
printf("!! b=%d a=%d\n",b,a);
return 0;
}
然后,我生成了汇编之后,就有点看不懂了
.file "aaa.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "!! b=%d a=%d\12\0"
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
LFB6:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $32, %esp
call ___main
movl $5, 28(%esp)
movl $0, 24(%esp)
movl 28(%esp), %eax
leal 1(%eax), %edx
decl 28(%esp)
movl 28(%esp), %eax
addl %edx, %eax
movl %eax, 24(%esp)
incl 28(%esp)
movl 28(%esp), %eax
movl %eax, 8(%esp)
movl 24(%esp), %eax
movl %eax, 4(%esp)
movl $LC0, (%esp)
call _printf
movl $0, %eax
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
LFE6:
.def _printf; .scl 2; .type 32; .endef
哪一位大神能帮忙解释一下,小弟在这里谢谢啦,最后逐句解释一下,么么哒
#include <stdio.h>
int main()
{
int a=5,b=0;
b=(a++)+1+(--a);
printf("!! b=%d a=%d\n",b,a);
return 0;
}
然后,我生成了汇编之后,就有点看不懂了
.file "aaa.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "!! b=%d a=%d\12\0"
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
LFB6:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $32, %esp
call ___main
movl $5, 28(%esp)
movl $0, 24(%esp)
movl 28(%esp), %eax
leal 1(%eax), %edx
decl 28(%esp)
movl 28(%esp), %eax
addl %edx, %eax
movl %eax, 24(%esp)
incl 28(%esp)
movl 28(%esp), %eax
movl %eax, 8(%esp)
movl 24(%esp), %eax
movl %eax, 4(%esp)
movl $LC0, (%esp)
call _printf
movl $0, %eax
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
LFE6:
.def _printf; .scl 2; .type 32; .endef
哪一位大神能帮忙解释一下,小弟在这里谢谢啦,最后逐句解释一下,么么哒