BR main number: .EQUATE 6 j: .EQUATE 4 amount: .EQUATE 2 result: .EQUATE O main: SUBSP 8, i DECI number, s LDWA 0, i STWA result, s LDWA 1, i STWA j, s for: CPWA number, s BRGT endFor DECI amount, s LDWA amount, s

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter14: Exception Handling
Section: Chapter Questions
Problem 10SA
icon
Related questions
Question
What is the output of the following Pep/9 code, if the input is 5, 9, 6, -12, 7, 14. Properly comment the progtram and explain the purpose.
BR
main
number: .EQUATE 6
j: .EQUATE 4
amount: .EQUATE 2
result: .EQUATE O
main: SUBSP 8, i
DECI number, s
LDWA 0, i
STWA result, s
LDWA 1, i
STWA j, s
for:
CPWA number, s
BRGT endFor
DECI
amount, s
LDWA amount, s
ADDA result, s
STWA result, s
LDWA j, s
ADDA 1, i
STWA j, s
BR
for
endFor: STRO msg, d
DECO result, s
LDBA In', i
STBA
charout, d
ADDSP 8, i
STOP
msg:
.ASCII "Result
= \x00"
.END
Transcribed Image Text:What is the output of the following Pep/9 code, if the input is 5, 9, 6, -12, 7, 14. Properly comment the progtram and explain the purpose. BR main number: .EQUATE 6 j: .EQUATE 4 amount: .EQUATE 2 result: .EQUATE O main: SUBSP 8, i DECI number, s LDWA 0, i STWA result, s LDWA 1, i STWA j, s for: CPWA number, s BRGT endFor DECI amount, s LDWA amount, s ADDA result, s STWA result, s LDWA j, s ADDA 1, i STWA j, s BR for endFor: STRO msg, d DECO result, s LDBA In', i STBA charout, d ADDSP 8, i STOP msg: .ASCII "Result = \x00" .END
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of trees
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning