vc6.0
///////////////////
--- D:/simon/try/wqer/1.c --------------------------------------------------------------------------------------------------------
1:
2:
3:
4:
5:
6:
7: int i = 0x10;
8: int arr_i[5] = {0x11,0x12,0x13,0x14,0x15};
9:
10: int main( )
11: {
0040D360 push ebp
0040D361 mov ebp,esp
0040D363 sub esp,7Ch
0040D366 push ebx
0040D367 push esi
0040D368 push edi
0040D369 lea edi,[ebp-7Ch]
0040D36C mov ecx,1Fh
0040D371 mov eax,0CCCCCCCCh
0040D376 rep stos dword ptr [edi]
12: //..
13: int b = arr_i[3];
0040D378 mov eax,[_arr_i+0Ch (00424a40)]
0040D37D mov dword ptr [ebp-4],eax
14:
15: int l_1 = 0x1;
0040D380 mov dword ptr [ebp-8],1
16: int l_2 = 0x2;
0040D387 mov dword ptr [ebp-0Ch],2
17: int l_3 = 0x3;
0040D38E mov dword ptr [ebp-10h],3
18:
19: int l_arr_i[5] = {0x21,0x22,0x23,0x24,0x25};
0040D395 mov dword ptr [ebp-24h],21h
0040D39C mov dword ptr [ebp-20h],22h
0040D3A3 mov dword ptr [ebp-1Ch],23h
0040D3AA mov dword ptr [ebp-18h],24h
0040D3B1 mov dword ptr [ebp-14h],25h
20:
21: char l_str_1[7]="123456";
0040D3B8 mov ecx,dword ptr [string "123456" (00422e80)]
0040D3BE mov dword ptr [ebp-2Ch],ecx
0040D3C1 mov dx,word ptr [string "123456"+4 (00422e84)]
0040D3C8 mov word ptr [ebp-28h],dx
0040D3CC mov al,[string "123456"+6 (00422e86)]
0040D3D1 mov byte ptr [ebp-26h],al
22: char l_str_2[7]={'1','2','3','4','5','6',0};
0040D3D4 mov byte ptr [ebp-34h],31h
0040D3D8 mov byte ptr [ebp-33h],32h
0040D3DC mov byte ptr [ebp-32h],33h
0040D3E0 mov byte ptr [ebp-31h],34h
0040D3E4 mov byte ptr [ebp-30h],35h
0040D3E8 mov byte ptr [ebp-2Fh],36h
0040D3EC mov byte ptr [ebp-2Eh],0
23: unsigned char l_uchstr[6] = {0x00,0x80,0x92,0x00,0x11,0xfa};
0040D3F0 mov byte ptr [ebp-3Ch],0
0040D3F4 mov byte ptr [ebp-3Bh],80h
0040D3F8 mov byte ptr [ebp-3Ah],92h
0040D3FC mov byte ptr [ebp-39h],0
0040D400 mov byte ptr [ebp-38h],11h
0040D404 mov byte ptr [ebp-37h],0FAh
24: }
0040D408 pop edi
0040D409 pop esi
0040D40A pop ebx
0040D40B mov esp,ebp
0040D40D pop ebp
0040D40E ret
////////////
從如下角度考慮:
不同編譯器的處理不一樣。
定義時初始化的效率。
如果初始化的值不會被使用的,這對效率的影響。