Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

6. Describe why communication is vital to everyone

Answered: 1 week ago