Question
Implement a simple four function calculator in the LC3 assembly language that will run on the LC-3 simulator. The LC-3 computer only reads a character
Implement a simple four function calculator in the LC3 assembly language that will run on the LC-3 simulator. The LC-3 computer only reads a character at a time but is capable of displaying a string of characters. This calculator program will use multiple subroutines that perform purposes such as reading multi-digit numbers, converting them to integers, performing addition, subtraction, multiplication, or division on these numbers, and displaying the result. The inputs to the calculator will not exceed 4 digits. The user interaction with the calculator is shown below in several example runs:
EXAMPLE RUN 1:
Enter the first operand (SRC1): 34
Enter the second operand (SRC2): 27
Operation (+, -, *, /)? +
Sum is: 61
Continue (Y, N)? Y
Enter the first operand (SRC1): 378
Enter the second operand (SRC2): 237
Operation (+, -, *, /)? -
Difference is: 141
Continue(Y, N)? N
EXAMPLE RUN 2:
Enter the first operand (SRC1): 34
Enter the second operand (SRC2): 75
Operation (+, -, *, /)? -
Difference is: -41
Continue(Y, N)? N
EXAMPLE RUN 3:
Enter the first operand (SRC1): 24
Enter the second operand (SRC2): 18
Operation (+, -, *, /)? *
Product is: 432
Continue(Y, N)? N
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