这是你那个代码的汇编,自己看看:
程序代码:
; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.30319.01
TITLE C:\Users\TonyDeng\Documents\Visual Studio 2010\Projects\test4\test4\test.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
EXTRN @__security_check_cookie@4:PROC
EXTRN __imp__printf:PROC
EXTRN __imp___getwch:PROC
$SG-5 DB 'a = %d, &a[0] = %d, &a = %d, d = %d, d[0] = %d', 0aH, 00H
PUBLIC __$ArrayPad$
PUBLIC _main
EXTRN ___security_cookie:DWORD
EXTRN @_RTC_CheckStackVars@8:PROC
EXTRN __RTC_CheckEsp:PROC
; Function compile flags: /Odtp /RTCsu
; File c:\users\tonydeng\documents\visual studio 2010\projects\test4\test4\test.cpp
_TEXT SEGMENT
_d$ = -56 ; size = 4
_a$ = -48 ; size = 40
__$ArrayPad$ = -4 ; size = 4
_main PROC
; 5 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 ec 38 sub esp, 56 ; 00000038H
00006 56 push esi
00007 57 push edi
00008 8d 7d c8 lea edi, DWORD PTR [ebp-56]
0000b b9 0e 00 00 00 mov ecx, 14 ; 0000000eH
00010 b8 cc cc cc cc mov eax, -858993460 ; ccccccccH
00015 f3 ab rep stosd
00017 a1 00 00 00 00 mov eax, DWORD PTR ___security_cookie
0001c 33 c5 xor eax, ebp
0001e 89 45 fc mov DWORD PTR __$ArrayPad$[ebp], eax
; 6 : int a[10];
; 7 : int (*d)[10];
; 8 :
; 9 : d = &a;
00021 8d 45 d0 lea eax, DWORD PTR _a$[ebp]
00024 89 45 c8 mov DWORD PTR _d$[ebp], eax
; 10 : printf("a = %d, &a[0] = %d, &a = %d, d = %d, d[0] = %d\n", a, &a[0], &a, d, d[0]);
00027 8b f4 mov esi, esp
00029 8b 4d c8 mov ecx, DWORD PTR _d$[ebp]
0002c 51 push ecx
0002d 8b 55 c8 mov edx, DWORD PTR _d$[ebp]
00030 52 push edx
00031 8d 45 d0 lea eax, DWORD PTR _a$[ebp]
00034 50 push eax
00035 8d 4d d0 lea ecx, DWORD PTR _a$[ebp]
00038 51 push ecx
00039 8d 55 d0 lea edx, DWORD PTR _a$[ebp]
0003c 52 push edx
0003d 68 00 00 00 00 push OFFSET $SG-5
00042 ff 15 00 00 00
00 call DWORD PTR __imp__printf
00048 83 c4 18 add esp, 24 ; 00000018H
0004b 3b f4 cmp esi, esp
0004d e8 00 00 00 00 call __RTC_CheckEsp
; 11 : _getwch();
00052 8b f4 mov esi, esp
00054 ff 15 00 00 00
00 call DWORD PTR __imp___getwch
0005a 3b f4 cmp esi, esp
0005c e8 00 00 00 00 call __RTC_CheckEsp
; 12 : }
00061 33 c0 xor eax, eax
00063 52 push edx
00064 8b cd mov ecx, ebp
00066 50 push eax
00067 8d 15 00 00 00
00 lea edx, DWORD PTR $LN5@main
0006d e8 00 00 00 00 call @_RTC_CheckStackVars@8
00072 58 pop eax
00073 5a pop edx
00074 5f pop edi
00075 5e pop esi
00076 8b 4d fc mov ecx, DWORD PTR __$ArrayPad$[ebp]
00079 33 cd xor ecx, ebp
0007b e8 00 00 00 00 call @__security_check_cookie@4
00080 83 c4 38 add esp, 56 ; 00000038H
00083 3b ec cmp ebp, esp
00085 e8 00 00 00 00 call __RTC_CheckEsp
0008a 8b e5 mov esp, ebp
0008c 5d pop ebp
0008d c3 ret 0
0008e 8b ff npad 2
$LN5@main:
00090 01 00 00 00 DD 1
00094 00 00 00 00 DD $LN4@main
$LN4@main:
00098 d0 ff ff ff DD -48 ; ffffffd0H
0009c 28 00 00 00 DD 40 ; 00000028H
000a0 00 00 00 00 DD $LN3@main
$LN3@main:
000a4 61 DB 97 ; 00000061H
000a5 00 DB 0
_main ENDP
_TEXT ENDS
END