Write a program to prompt for 3 numbers, calculate the sum, and output the result.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter11: Operating Systems
Section: Chapter Questions
Problem 19VE
icon
Related questions
Question

Write a program to prompt for 3 numbers, calculate the sum, and output the result. Include your entire source code. If possible show a screen shot of your output.

 

Microsoft (R) Macro Assembler Version 11.00.51106.1
06/08/13 20:28:05
examplel.aзm
Page 1 - 1
; Example assembly language program
; Author:
; Date:
adds 158 to number in memory
R. Detmer
6/2013
.586
.MODEL FLAT
STACK
4096
; reserve 4096-byte stack
00000000
.DATA
; reserve storage for data
00000000 FFFFFF97
number
DWORD
-105
00000004 00000000
sum
DWORD
?
00000000
.CODE
; start of main program code
00000000
main
PROC
; first number to EAX
; add 158
00000000
Al 00000000 R
eax, number
mov
00000005
05 0000009E
add
eax, 158
0000000A A3 00000004R
mov
sum, eax
; sum to memory
0000000F
вв 00000000
еaх, 0
; exit with return code 0
mov
00000014
C3
ret
00000015
main
ENDP
END
; end of source code
Transcribed Image Text:Microsoft (R) Macro Assembler Version 11.00.51106.1 06/08/13 20:28:05 examplel.aзm Page 1 - 1 ; Example assembly language program ; Author: ; Date: adds 158 to number in memory R. Detmer 6/2013 .586 .MODEL FLAT STACK 4096 ; reserve 4096-byte stack 00000000 .DATA ; reserve storage for data 00000000 FFFFFF97 number DWORD -105 00000004 00000000 sum DWORD ? 00000000 .CODE ; start of main program code 00000000 main PROC ; first number to EAX ; add 158 00000000 Al 00000000 R eax, number mov 00000005 05 0000009E add eax, 158 0000000A A3 00000004R mov sum, eax ; sum to memory 0000000F вв 00000000 еaх, 0 ; exit with return code 0 mov 00000014 C3 ret 00000015 main ENDP END ; end of source code
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning