1: #include <stdio.h>
2:
3: int main(void)
4:
00401010 55 push ebp //保存上1个ebp堆栈框架
00401011 8B EC mov ebp,esp //用ebp构建新堆栈框架
00401013 83 EC 58 sub esp,58h //开辟临时变量区
00401016 53 push ebx //保存用到的寄存器
00401017 56 push esi
00401018 57 push edi
00401019 8D 7D A8 lea edi,[ebp-58h]
0040101C B9 16 00 00 00 mov ecx,16h
00401021 B8 CC CC CC CC mov eax,0CCCCCCCCh
00401026 F3 AB rep stos dword ptr [edi]
5: int a=2,*p=&a,*q=&a;
00401028 C7 45 FC 02 00 00 00 mov dword ptr [ebp-4],2 //在堆栈中给变量a赋值.a的位置 dword ptr [ebp-4]
0040102F 8D 45 FC lea eax,[ebp-4] //取a的地址
00401032 89 45 F8 mov dword ptr [ebp-8],eax //将a的地址值赋给p
00401035 8D 4D FC lea ecx,[ebp-4]
00401038 89 4D F4 mov dword ptr [ebp-0Ch],ecx //将a地址值赋给q
6:
7: printf("%d %d ",*p++,*(q++));
0040103B 8B 55 F4 mov edx,dword ptr [ebp-0Ch] //取q的值送edx
0040103E 8B 02 mov eax,dword ptr [edx] //*q送如eax
00401040 89 45 F0 mov dword ptr [ebp-10h],eax //将计算的*q的值送入堆栈
00401043 8B 4D F0 mov ecx,dword ptr [ebp-10h] //将*q值也就是2送如ecx
00401046 51 push ecx //将ecx入栈 至此将printf的1个参数送入堆栈,这个参数是printf最右边参数
00401047 8B 55 F8 mov edx,dword ptr [ebp-8]
0040104A 8B 02 mov eax,dword ptr [edx]
0040104C 89 45 EC mov dword ptr [ebp-14h],eax
0040104F 8B 4D EC mov ecx,dword ptr [ebp-14h]
00401052 51 push ecx //将从右起第2个参数入栈
00401053 68 24 20 42 00 push offset string "%d %d " (00422024)//将右起第3个参数入栈,也就是"%d %d"
00401058 8B 55 F8 mov edx,dword ptr [ebp-8]
0040105B 83 C2 04 add edx,4 //p++
0040105E 89 55 F8 mov dword ptr [ebp-8],edx
00401061 8B 45 F4 mov eax,dword ptr [ebp-0Ch]
00401064 83 C0 04 add eax,4 //q++
00401067 89 45 F4 mov dword ptr [ebp-0Ch],eax
0040106A E8 81 00 00 00 call printf (004010f0) //参数传递完毕call printf函数
0040106F 83 C4 0C add esp,0Ch //平衡堆栈
在vc6中分析程序前部分..
printf("%d %d ",*p++,*(q++));
打印出 2,2
后边打印的也是2,2