Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. This is 80x86 assembly language. Starting with the windows32 project, modify the example program given in this section to prompt for, input and add
1. This is 80x86 assembly language. Starting with the windows32 project, modify the example program given in this section to prompt for, input and add three numbers, and display the sum. Run the program several times with different data. Trace execution using the debugger.
Example assembly language program -- adds two numbers Author R. Detmer Date: 6/2013 586 MODEL FLAT INCLUDE io.h ; header file for input/output STACK 4096 DATA numberl DWORD ? number2 DWORD ? prompt1 BYTE "Enter first number", 0 prompt2 BYTE "Enter second number", 0 string BYTE resultLbl BYTE "The sum is", 0 sum 40 DUP (?) BYTE 11 DUP ?), 0 CODE MainProc PROC input prompti, string, 40 atod string mov ; read ASCII characters ; convert to integer numberl, eax store in memory ; repeat for second number input prompt2, string, 40 atod string mov number2, eax mov add dtoa output eax, numberl eax, number2 sum eax resultLbl, ; first number to EAX ; add second number ; convert to ASCII characters sumoutput label and sunm eax, 0 exit with return code 0 mov ret MainProc ENDE END ; end of source code Example assembly language program -- adds two numbers Author R. Detmer Date: 6/2013 586 MODEL FLAT INCLUDE io.h ; header file for input/output STACK 4096 DATA numberl DWORD ? number2 DWORD ? prompt1 BYTE "Enter first number", 0 prompt2 BYTE "Enter second number", 0 string BYTE resultLbl BYTE "The sum is", 0 sum 40 DUP (?) BYTE 11 DUP ?), 0 CODE MainProc PROC input prompti, string, 40 atod string mov ; read ASCII characters ; convert to integer numberl, eax store in memory ; repeat for second number input prompt2, string, 40 atod string mov number2, eax mov add dtoa output eax, numberl eax, number2 sum eax resultLbl, ; first number to EAX ; add second number ; convert to ASCII characters sumoutput label and sunm eax, 0 exit with return code 0 mov ret MainProc ENDE END ; end of source codeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started