Write a machine language program to input two one-digit numbers, add them, and output the one-digit sum. There can be no space between the two one-digit numbers on input. Write the program in a format suitable for the loader and execute it on the Pep/9 simulator. How would I write this in Pep/9?
-> Code:-
1- 0000 4900FE ;Get input from the user and store it @
00FE
2- 0003 4900FF ;Get input from the user and store it @ 00FF
3- 0006 D100FE ;load first input to memory
4- 0009 910025 ;Convert first input to decimal
5- 000C F100FE ;Store first decimal
6- 000F D100FF ;Load second input into memory
7- 0012 910025 ;Convert second input to decimal
8- 0015 7100FA ;Add two numbers
9- 0018 A10023 ;convert sum to character
10- 001B F100FF ;store the character
11- 001E 5100FF ;output the character
12- 0021 00 ; stop
13- 0022 00 ; character to output
14- 0023 0030 ; convert mask to ASCII from decimal
15- 0025 000F ; convert mask to decimal from ASCII
-> Object Code:-
49 00 FE 49 00 FF D1 00 FE 91 00 25 F1 00 FE D1
00 FF 91 00 25 71 00 FA A1 00 23 F1 00 FF 51 00
FF 00 00 00 30 00 0F zz
Get Answers For Free
Most questions answered within 1 hours.