Question
The following is a question I'm struggling with using the LC-3 simulator. Thank you! Modify the program so it can add two numbers between 0
The following is a question I'm struggling with using the LC-3 simulator. Thank you!
Modify the program so it can add two numbers between 0 and 9 and handle up to 9 + 9 as input and output up to 18. Then, further modify it to handle two digit operands and a sum <= 198.
.ORIG x3000 ; ; IN ; LD R3, HEXN30 ; ADD R0, R0, R3 ADD R1, R0, x0 ; IN ; ADD R0, R0, R3 ; ; ADD R2, R0, R1 ; ; LEA R0, MESG ; PUTS ; ADD R0, R2, x0 ; LD R3, HEX30 ; ADD R0, R0, R3 OUT ; ; HALT ; ; MESG .STRINGZ "The sum of those two numbers is: " HEXN30 .FILL xFFD0 ; HEX30 .FILL x0030 ; .END
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