C语言基础补习

coolshell 中一个小例子在VC6.0编译后反汇编结果仅作记录:

源码:

C语言基础补习
#include <stdio.h>
int main(void)
{
    int a[5];
    printf("%x\n", a);
    printf("%x\n", a+1);
    printf("%x\n", &a);
    printf("%x\n", &a+1);
}
C语言基础补习

VC6.0编译后的汇编代码:

C语言基础补习
18:       int a[5];
19:       printf("%x\n",a);
00401038 8D 45 EC             lea         eax,[ebp-14h]
0040103B 50                   push        eax
0040103C 68 1C 20 42 00       push        offset string "%x\n" (0042201c)
00401041 E8 BA 00 00 00       call        printf (00401100)
00401046 83 C4 08             add         esp,8
20:       printf("%x\n",a+1);
00401049 8D 4D F0             lea         ecx,[ebp-10h]
0040104C 51                   push        ecx
0040104D 68 1C 20 42 00       push        offset string "%x\n" (0042201c)
00401052 E8 A9 00 00 00       call        printf (00401100)
00401057 83 C4 08             add         esp,8
21:       printf("%x\n",&a);
0040105A 8D 55 EC             lea         edx,[ebp-14h]
0040105D 52                   push        edx
0040105E 68 1C 20 42 00       push        offset string "%x\n" (0042201c)
00401063 E8 98 00 00 00       call        printf (00401100)
00401068 83 C4 08             add         esp,8
22:       printf("%x\n",&a+1);
0040106B 8D 45 00             lea         eax,[ebp]
0040106E 50                   push        eax
0040106F 68 1C 20 42 00       push        offset string "%x\n" (0042201c)
00401074 E8 87 00 00 00       call        printf (00401100)
00401079 83 C4 08             add         esp,8
23:       return 0;
C语言基础补习

C语言基础补习,布布扣,bubuko.com

C语言基础补习

上一篇:八.nodejs中ejs的基本使用


下一篇:Netty 中的心跳机制