Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
