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, 22.06.2019 09:00
What is one way in which tablets differ from laptops and notebooks? tablets are designed for touch-based interaction. tablets are designed to be used as desktops. tablets are designed for input via a keyboard and mouse. tablets are designed to be larger than laptops.
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. Γ’β€“ΕŸ print out all positive integers from 1 to 100, inclusive and in order. Γ’β€“ΕŸ print messages to standard output, matching the sample output below. Γ’β€“ΕŸ in the output, state whether the each integer is 'odd' or 'even' in the output. Γ’β€“ΕŸ if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. Γ’β€“ΕŸ if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. Γ’β€“ΕŸ design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
In which view can you see speaker notes?
Answers: 1
You know the right answer?
Write an assembly language program (lc3) that prompts the user to input two numeric characters ('0'...
Questions
question
Mathematics, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20
question
History, 09.05.2021 03:20
question
Mathematics, 09.05.2021 03:20