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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!