A piece of C-defined assembly code for local variables

Source: Internet
Author: User

Vc6.0

///////////////////

--- D:/Simon/try/wqer/1.C restart --------------------------------------------------------------------------------------------------------
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, 0 cccccccch
0040d376 rep STOs dword ptr [EDI]
12 ://..
13: int B = arr_ I [3];
0040d378 mov eax, [_ arr_ I + 0ch (0020.a40)]
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], 21 h
0040d39c mov dword ptr [ebp-20h], 22 h
0040d3a3 mov dword ptr [ebp-1Ch], 23 h
0040d3aa mov dword ptr [ebp-18h], 24 h
0040d3b1 mov dword ptr [ebp-14h], 25 h
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], 31 H
0040d3d8 mov byte PTR [ebp-33h], 32 h
0040d3dc mov byte PTR [ebp-32h], 33 H
0040d3e0 mov byte PTR [ebp-31h], 34 h
0040d3e4 mov byte PTR [ebp-30h], 35 h
0040d3e8 mov byte PTR [ebp-2Fh], 36 h
0040d3ec mov byte PTR [ebp-2Eh], 0
23: unsigned char l_uchstr [6] = {0 x, 0x80, 0 x, 0 x, 0x11, 0xfa };
0040d3f0 mov byte PTR [ebp-3Ch], 0
0040d3f4 mov byte PTR [ebp-3Bh], 80 h
0040d3f8 mov byte PTR [ebp-3Ah], 92 h
0040d3fc mov byte PTR [ebp-39h], 0
0040d400 mov byte PTR [ebp-38h], 11 h
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

////////////

Consider the following:

Different compilers have different processing methods.

The initialization efficiency during definition.
If the initial value is not used, this will affect the efficiency.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.