Computers and Technology

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:

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:50, nakeytrag
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria. what am i?
Answers: 2
image
Computers and Technology, 23.06.2019 12:40, Emilyvite6251
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, ryleerose255
Idon’t understand the double8 coding problem. it is java
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, granta1
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
Do you know the correct answer?
Write an assembly language program (lc3) that prompts the user to input two numeric characters ('0'...

Questions in other subjects:

Konu
Biology, 28.10.2020 18:30
Konu
Mathematics, 28.10.2020 18:30