Code:
; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.21022.08
TITLE c:\Users\C\Documents\Visual Studio 2008\Projects\proj6vcsolut\proj6vc\proj6.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
PUBLIC ?z@@3HA ; z
PUBLIC ?x@@3HA ; x
PUBLIC ?y@@3DA ; y
_BSS SEGMENT
?z@@3HA DD 01H DUP (?) ; z
?x@@3HA DD 01H DUP (?) ; x
?y@@3DA DB 01H DUP (?) ; y
_BSS ENDS
PUBLIC ?sumfunc@@YAHHD@Z ; sumfunc
EXTRN __RTC_Shutdown:PROC
EXTRN __RTC_InitBase:PROC
; COMDAT rtc$TMZ
; File c:\users\c\documents\visual studio 2008\projects\proj6vcsolut\proj6vc\proj6.cpp
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
; Function compile flags: /Odtp /RTCsu /ZI
rtc$IMZ ENDS
; COMDAT ?sumfunc@@YAHHD@Z
_TEXT SEGMENT
_z$ = -8 ; size = 4
_x$ = 8 ; size = 4
_y$ = 12 ; size = 1
?sumfunc@@YAHHD@Z PROC ; sumfunc, COMDAT
; 9 : int sumfunc(int x, char y){
push ebp
mov ebp, esp
sub esp, 204 ; 000000ccH
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-204]
mov ecx, 51 ; 00000033H
mov eax, -858993460 ; ccccccccH
rep stosd
; 10 : int z;
; 11 : z= x + y;
movsx eax, BYTE PTR _y$[ebp]
add eax, DWORD PTR _x$[ebp]
mov DWORD PTR _z$[ebp], eax
; 12 : return z;
mov eax, DWORD PTR _z$[ebp]
; 13 : }
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
?sumfunc@@YAHHD@Z ENDP ; sumfunc
_TEXT ENDS
PUBLIC ??_C@_05PDJBBECF@pause?$AA@ ; `string'
PUBLIC ??_C@_0CC@CNFEEKMM@The?5sum?5of?5the?5two?5numbers?5is?5?$CFi@ ; `string'
PUBLIC ??_C@_02DPKJAMEF@?$CFd?$AA@ ; `string'
PUBLIC ??_C@_0BO@PFLLPLLJ@Please?5type?5another?5integer?4?6?$AA@ ; `string'
PUBLIC ??_C@_02IKAHHCAI@?$CFi?$AA@ ; `string'
PUBLIC ??_C@_0BJ@BLCGGBIN@Please?5type?5an?5integer?4?6?$AA@ ; `string'
PUBLIC _main
EXTRN __imp__system:PROC
EXTRN __imp__scanf:PROC
EXTRN __imp__printf:PROC
EXTRN __RTC_CheckEsp:PROC
; COMDAT ??_C@_05PDJBBECF@pause?$AA@
CONST SEGMENT
??_C@_05PDJBBECF@pause?$AA@ DB 'pause', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0CC@CNFEEKMM@The?5sum?5of?5the?5two?5numbers?5is?5?$CFi@
CONST SEGMENT
??_C@_0CC@CNFEEKMM@The?5sum?5of?5the?5two?5numbers?5is?5?$CFi@ DB 'The su'
DB 'm of the two numbers is %i', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_02DPKJAMEF@?$CFd?$AA@
CONST SEGMENT
??_C@_02DPKJAMEF@?$CFd?$AA@ DB '%d', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BO@PFLLPLLJ@Please?5type?5another?5integer?4?6?$AA@
CONST SEGMENT
??_C@_0BO@PFLLPLLJ@Please?5type?5another?5integer?4?6?$AA@ DB 'Please typ'
DB 'e another integer.', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_02IKAHHCAI@?$CFi?$AA@
CONST SEGMENT
??_C@_02IKAHHCAI@?$CFi?$AA@ DB '%i', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BJ@BLCGGBIN@Please?5type?5an?5integer?4?6?$AA@
CONST SEGMENT
??_C@_0BJ@BLCGGBIN@Please?5type?5an?5integer?4?6?$AA@ DB 'Please type an '
DB 'integer.', 0aH, 00H ; `string'
; Function compile flags: /Odtp /RTCsu /ZI
CONST ENDS
; COMDAT _main
_TEXT SEGMENT
_main PROC ; COMDAT
; 15 : int main(void){
push ebp
mov ebp, esp
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-192]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
; 16 :
; 17 : printf("Please type an integer.\n");
mov esi, esp
push OFFSET ??_C@_0BJ@BLCGGBIN@Please?5type?5an?5integer?4?6?$AA@
call DWORD PTR __imp__printf
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 18 : scanf("%i", &x);
mov esi, esp
push OFFSET ?x@@3HA ; x
push OFFSET ??_C@_02IKAHHCAI@?$CFi?$AA@
call DWORD PTR __imp__scanf
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
; 19 : printf("Please type another integer.\n");
mov esi, esp
push OFFSET ??_C@_0BO@PFLLPLLJ@Please?5type?5another?5integer?4?6?$AA@
call DWORD PTR __imp__printf
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 20 : scanf("%d", &y);
mov esi, esp
push OFFSET ?y@@3DA ; y
push OFFSET ??_C@_02DPKJAMEF@?$CFd?$AA@
call DWORD PTR __imp__scanf
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
; 21 : printf("The sum of the two numbers is %i\n", sumfunc(x,y));
movzx eax, BYTE PTR ?y@@3DA ; y
push eax
mov ecx, DWORD PTR ?x@@3HA ; x
push ecx
call ?sumfunc@@YAHHD@Z ; sumfunc
add esp, 8
mov esi, esp
push eax
push OFFSET ??_C@_0CC@CNFEEKMM@The?5sum?5of?5the?5two?5numbers?5is?5?$CFi@
call DWORD PTR __imp__printf
add esp, 8
cmp esi, esp
call __RTC_CheckEsp
; 22 :
; 23 :
; 24 : system("pause");
mov esi, esp
push OFFSET ??_C@_05PDJBBECF@pause?$AA@
call DWORD PTR __imp__system
add esp, 4
cmp esi, esp
call __RTC_CheckEsp
; 25 : return 0;
xor eax, eax
; 26 : }
pop edi
pop esi
pop ebx
add esp, 192 ; 000000c0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_main ENDP
_TEXT ENDS
END