Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using lc 3 code, write a code supported by the details. Details The program must start at address x 3 0 0 0 . Here

using lc3 code, write a code supported by the details. Details
The program must start at address x3000. Heres how the program must behave:
1. The program sends a newline to the console and then prints Enter First Number (4 binary digits): , which serves as a prompt to tell the user that the program is waiting for input. The prompt string is a string, followed by a single space.
2. The user types a four-digit binary number on the keyboard. As the numbers are typed on the keyboard they should be echoed onto the console window. Any illegal input values are ignored after they are echoed. The program must check and accept only 0 or 1 numerical digits. The program should recognize the entry as complete when it sees 4 valid digits.
3. The program sends a newline to the console and then prints Enter Second Number (4 binary digits): , which serves as a prompt to tell the user that the program is waiting for input. The prompt string is a string, followed by a single space.
4. The user types a four-digit binary number on the keyboard. As the numbers are typed on the keyboard they should be echoed onto the console window. Any illegal input values are ignored after they are echoed. The program must check and accept only binary numerical digits. The program should recognize the entry is complete when it sees 4 valid digits.
5. If the user types the character q at any time the program should display a newline and the string Thank you for playing! and then Halt.
6. The program will perform an OR function on the first number and second numbers, of the values that have been entered on the keyboard. These user-entered numbers must be converted to binary for
1
the function. The program then converts this largest binary number to a four-digit binary number and converts the digits to ASCII code.
7. The program sends a newline to the console and then prints the following on the console:
The OR function of the two numbers is: zzzz
where zzzz is the four-digit binary number. A linefeed (newline) is printed at the end of the string. (Your code will not print in boldface, of course; thats just used for emphasis here.)
8. The program returns to step 1.
Do not use subroutines (the JSR instruction) for this assignment. 20 Points will be deducted if you do.

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions