Question: I created a program for this question Write a PEP/9 machine language program to add the three numbers 2, 3, and 6 and output
I created a program for this question "Write a PEP/9 machine language program to add the three numbers 2, 3, and 6 and output the sum on the output device. Store the 3 in hexadecimal. Do not use the subtract, negate, or invert instructions. Write the program in a format suitable for the loader and execute it on the Pep/9 simulator." but I don't know why my program assembles and loads but does not execute any input or output. Also, if you could store -3 in hexadecimal, I couldn't figure out how I should do it. I did this program in Pep/9. PLEASE HELP!!!
Below is my program:
num1: .BLOCK 2 ;global variable #2d
num2: .BLOCK 2 ;global variable #2d
num3: .BLOCK 2 ;global variable #2d
sum: .BLOCK 2 ;global variable #2d
;
main: DECI num1,d
LDBA 2,i
STBA num1,d
DECI num2,d
LDBA -3,i
STBA num2,d
DECI num3,d
LDBA 6,i
STBA num3,d
LDWA num1,d
ADDA num2,d
ADDA num3,d
STWA sum,d
STRO msg,d
DECO sum,d
STOP
msg: .ASCII "sum = \x00"
.END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
