subject

Write an assembly language program (lc3) that prompts the user to input two numeric characters ('0' '9') from the user using trap x20 (getc). make sure to echo the characters and store them into different registers. the second number will be subtracted from the first, and the operation reported in the console: ? = .

output to the console the operation being performed (e. g. 4 ? 6 = ). using the same registers, convert the numeric characters into the actual numbers they represent (e. g.convert β€˜2’ into 2).

perform the subtraction operation, and determine the sign (+/? ) of the result; if negative, determine the magnitude of the result (i. e. take 2's complement).

(ex) program performs (4? 6) and stores the result, ? 2, in a register. program recognizes that result is negative, converts ? 2 to 2, and sets flag for minus sign.

convert resulting number back to a printable character and print it, together with minus sign if necessary.

(ex) program converts 2 into '2', and stores it back in same register. program outputs the two characters ? 2 followed by newline. thus completing the subtraction operation output.

expected/ sample output

in this assignment, your output must exactly match the following, including:

a. the prompt, followed by newline

b. each input "echoed" and followed by a newline

c. the subtraction operation, including spaces as shown, also followed by a newline:

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
What process should be followed while giving a reference? sam has given a reference of his previous manager in his resume. sam should him in advance that the potential employers will him.
Answers: 1
question
Computers and Technology, 25.06.2019 06:50
A1-megabit computer memory chip contains many 27 ff capacitors. each capacitor has a plate area of 3.09 Γ— 10βˆ’11 m 2 . determine the plate separation of such a capacitor (assume an empty parallel-plate configuration). the characteristic atomic diameter is 10βˆ’10 m = 1 ˚a, and the permittivity of a vacuum is 8.8542 Γ— 10βˆ’12 c 2 /n Β· m2 . answer in units of ˚a.
Answers: 3
question
Computers and Technology, 25.06.2019 13:00
True or false the internet is a local communication network that allows only certain computers to connect and exchange information.
Answers: 2
You know the right answer?
Write an assembly language program (lc3) that prompts the user to input two numeric characters ('0'...
Questions
question
Mathematics, 04.03.2021 07:40
question
Mathematics, 04.03.2021 07:40
question
Mathematics, 04.03.2021 07:40
question
Mathematics, 04.03.2021 07:40
question
English, 04.03.2021 07:40
question
Mathematics, 04.03.2021 07:40
question
Mathematics, 04.03.2021 07:40
Questions on the website: 13722363