#include <iostream>
int main()
{
char message1[] = "Input the first number:";
char message2[] = "Input the second number:";
char message3[] = "Their sum is:";
char format1[] = "%d";
char format2[] = "\n%s\n";
int fnumber;
int snumber;
int sum=0;
_asm {
lea eax, message1
push eax
lea eax, format2
push eax
call printf
add esp, 8
lea eax, fnumber
push eax
lea eax, format1
push eax
call scanf
add esp, 8
push fnumber
lea eax, format1
push eax
call printf
add esp, 8
lea eax, message2
push eax
lea eax, format2
push eax
call printf
add esp, 8
lea eax, snumber
push eax
lea eax, format1
push eax
call scanf
add esp, 8
push snumber
lea eax, format1
push eax
call printf
add esp, 8
lea eax, message3
push eax
lea eax, format2
push eax
call printf
add esp, 8
mov eax, fnumber
add eax, snumber
mov sum, eax
push sum
lea eax, format1
push eax
call printf
add esp, 8
}
return 0;
}
|