Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Pep / 9 Assembly language program that takes a number from input, then subtracts 2 5 from the input value. Next the program
Write a Pep Assembly language program that takes a number from input, then
subtracts from the input value. Next the program should add to the number. If the result is higher
than print higher to output. If the result is lower than print the number to output. Allow the
user to enter numbers until a zero is entered.
Your output must match the output below
INPUT:
OUTPUT:
higher
Comment from teacher : the loop doesn't work correctly. You are using stack relative addressing and using the SUBSP instruction twice. If you are doing this, you should only use it once here. In addition, you are missing the ADDSP instruction which resets the stack. The easier way to do this is to use d and i addressing. You also have the msg: symbol which is redundant.
Step 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