|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
同样的一个程序,用codeBlock可以生成常规的汇编代码,可是用eclipse-c,生成的汇编代码如下
15 int main(void) {
004013d9: call 0x401a50 <__main>
16 int i=1;//注释
004013de: movl $0x1,0x1c(%esp)
18 while(i<=5){
004013e6: jmp 0x40141f <main+79>
19 printf("%d\n",S(i++));
004013e8: mov 0x1c(%esp),%eax
004013ec: imul 0x1c(%esp),%eax
004013f1: addl $0x1,0x1c(%esp)
004013f6: addl $0x1,0x1c(%esp)
004013fb: mov %eax,0x4(%esp)
004013ff: movl $0x403064,(%esp)
00401406: call 0x401cc0 <printf>
20 printf("i的值是%d\n",i);
0040140b: mov 0x1c(%esp),%eax
0040140f: mov %eax,0x4(%esp)
……
以下是codeBlocks的
004013D0 push ebp
004013D1 mov ebp,esp
004013D3 and esp,0xfffffff0
004013D6 sub esp,0x20
004013D9 call 0x401a50 <__main>
004013DE mov DWORD PTR [esp+0x1c],0x1
004013E6 jmp 0x40141f <main+79>
004013E8 mov eax,DWORD PTR [esp+0x1c]
004013EC imul eax,DWORD PTR [esp+0x1c]
004013F1 add DWORD PTR [esp+0x1c],0x1
004013F6 add DWORD PTR [esp+0x1c],0x1
004013FB mov DWORD PTR [esp+0x4],eax
004013FF mov DWORD PTR [esp],0x403064
00401406 call 0x401cc0 <printf>
0040140B mov eax,DWORD PTR [esp+0x1c]
0040140F mov DWORD PTR [esp+0x4],eax
……
不知道是哪里的问题?
|
|