C 소스.
#include <stdio.h>
int
main()
{
int i = 0;
i++;
i += 1;
i = i + 1;
return 0;
}
C 소스 컴파일 후 디스어셈블리.
1: #include <stdio.h>
2:
3: int
4: main()
5: {
00401010 push ebp
00401011 mov ebp,esp
00401013 sub esp,44h
00401016 push ebx
00401017 push esi
00401018 push edi
00401019 lea edi,[ebp-44h]
0040101C mov ecx,11h
00401021 mov eax,0CCCCCCCCh
00401026 rep stos dword ptr [edi]
6: int i = 0;
00401028 mov dword ptr [ebp-4],0
7:
8: i++;
0040102F mov eax,dword ptr [ebp-4]
00401032 add eax,1
00401035 mov dword ptr [ebp-4],eax
9: i += 1;
00401038 mov ecx,dword ptr [ebp-4]
0040103B add ecx,1
0040103E mov dword ptr [ebp-4],ecx
10: i = i + 1;
00401041 mov edx,dword ptr [ebp-4]
00401044 add edx,1
00401047 mov dword ptr [ebp-4],edx
11:
12: return 0;
0040104A xor eax,eax
13: }
0040104C pop edi
0040104D pop esi
0040104E pop ebx
0040104F mov esp,ebp
00401051 pop ebp
00401052 ret