|
发表于 2018-11-10 14:28:36
|
显示全部楼层
#include <stdio.h>
int main(void)
{
int i = 1;
printf("%d\n", ++i);
i = 1;
printf("%d %d %d %d %d %d\n", ++i, --i, i++, i--, -i++, -i--);
return 0;
}
2
1 1 0 1 0 -1
请按任意键继续. . .
#include <stdio.h>
int main(void)
{
000717A0 55 push ebp
000717A1 8B EC mov ebp,esp
000717A3 81 EC DC 00 00 00 sub esp,0DCh
000717A9 53 push ebx
000717AA 56 push esi
000717AB 57 push edi
000717AC 8D BD 24 FF FF FF lea edi,[ebp-0DCh]
000717B2 B9 37 00 00 00 mov ecx,37h
000717B7 B8 CC CC CC CC mov eax,0CCCCCCCCh
000717BC F3 AB rep stos dword ptr es:[edi]
int i = 1;
000717BE C7 45 F8 01 00 00 00 mov dword ptr [i],1
printf("%d\n", ++i);
000717C5 8B 45 F8 mov eax,dword ptr [i]
000717C8 83 C0 01 add eax,1
000717CB 89 45 F8 mov dword ptr [i],eax
000717CE 8B 4D F8 mov ecx,dword ptr [i]
000717D1 51 push ecx
000717D2 68 30 7B 07 00 push offset string "%d\n" (077B30h)
000717D7 E8 4E FB FF FF call _printf (07132Ah)
000717DC 83 C4 08 add esp,8
i = 1;
000717DF C7 45 F8 01 00 00 00 mov dword ptr [i],1
printf("%d %d %d %d %d %d\n", ++i, --i, i++, i--, -i++, -i--);
000717E6 8B 45 F8 mov eax,dword ptr [i]
000717E9 F7 D8 neg eax
000717EB 89 85 30 FF FF FF mov dword ptr [ebp-0D0h],eax
000717F1 8B 4D F8 mov ecx,dword ptr [i]
000717F4 83 E9 01 sub ecx,1
000717F7 89 4D F8 mov dword ptr [i],ecx
000717FA 8B 55 F8 mov edx,dword ptr [i]
000717FD F7 DA neg edx
000717FF 89 95 2C FF FF FF mov dword ptr [ebp-0D4h],edx
00071805 8B 45 F8 mov eax,dword ptr [i]
00071808 83 C0 01 add eax,1
0007180B 89 45 F8 mov dword ptr [i],eax
0007180E 8B 4D F8 mov ecx,dword ptr [i]
00071811 89 8D 28 FF FF FF mov dword ptr [ebp-0D8h],ecx
00071817 8B 55 F8 mov edx,dword ptr [i]
0007181A 83 EA 01 sub edx,1
0007181D 89 55 F8 mov dword ptr [i],edx
00071820 8B 45 F8 mov eax,dword ptr [i]
00071823 89 85 24 FF FF FF mov dword ptr [ebp-0DCh],eax
00071829 8B 4D F8 mov ecx,dword ptr [i]
0007182C 83 C1 01 add ecx,1
0007182F 89 4D F8 mov dword ptr [i],ecx
00071832 8B 55 F8 mov edx,dword ptr [i]
00071835 83 EA 01 sub edx,1
00071838 89 55 F8 mov dword ptr [i],edx
0007183B 8B 45 F8 mov eax,dword ptr [i]
0007183E 83 C0 01 add eax,1
00071841 89 45 F8 mov dword ptr [i],eax
00071844 8B 8D 30 FF FF FF mov ecx,dword ptr [ebp-0D0h]
0007184A 51 push ecx
0007184B 8B 95 2C FF FF FF mov edx,dword ptr [ebp-0D4h]
00071851 52 push edx
00071852 8B 85 28 FF FF FF mov eax,dword ptr [ebp-0D8h]
00071858 50 push eax
00071859 8B 8D 24 FF FF FF mov ecx,dword ptr [ebp-0DCh]
0007185F 51 push ecx
00071860 8B 55 F8 mov edx,dword ptr [i]
00071863 52 push edx
00071864 8B 45 F8 mov eax,dword ptr [i]
00071867 50 push eax
00071868 68 34 7B 07 00 push offset string "%d %d %d %d %d %d\n" (077B34h)
0007186D E8 B8 FA FF FF call _printf (07132Ah)
00071872 83 C4 1C add esp,1Ch
return 0;
00071875 33 C0 xor eax,eax
}
00071877 5F pop edi
00071878 5E pop esi
00071879 5B pop ebx
0007187A 81 C4 DC 00 00 00 add esp,0DCh
}
00071880 3B EC cmp ebp,esp
00071882 E8 9B F8 FF FF call __RTC_CheckEsp (071122h)
00071887 8B E5 mov esp,ebp
00071889 5D pop ebp
0007188A C3 ret
|
|