Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LC3 assembly code subroutine I have done the getnum subroutine and a multipication subroutine. I have the prompt part written but everything after that I
LC3 assembly code subroutine
I have done the getnum subroutine and a multipication subroutine. I have the prompt part written but everything after that I am completely lost on. Thank you so much!
1. 2. Put the GETDEC subroutine just below the MULT subroutine. GETDEC should print a prompt exactly like this: Enter an integer: The prompt should have exactly 1 space after the colon 3. The user enters a series of numbers and ends input by hitting the enter key. Create a loop that calls GETNUM and processes the input until the enter key is pressed. If the user enters a non-digit it should be ignored. GETNUM should already be doing this for you After getting a character in GETNUM, check if it is 10 and jump to the register restore and return The user MUST enter a number. Newline should be ignored until at least one digit has been entered. (Use two loops. Get a number until it is not a newline. Then process that number and all subsequent numbers until a newline IS reached). You MUST print a newline (ASCII Character 10 (A in hex) after the user has entered her number. I won't be checking for overflow. All of the test numbers I use will safely fit in a 16 bit register. 4. Replace the main at the top of the program with a call to GETDEC like this orig x3000 JSR GETDEC JSR GETDEC HALT 5. When you run your program, you should see the following (assuming you type in 213 followed by enter, then 2489 followed by enter): Enter an integer: 213 Enter an integer: 2489 1. 2. Put the GETDEC subroutine just below the MULT subroutine. GETDEC should print a prompt exactly like this: Enter an integer: The prompt should have exactly 1 space after the colon 3. The user enters a series of numbers and ends input by hitting the enter key. Create a loop that calls GETNUM and processes the input until the enter key is pressed. If the user enters a non-digit it should be ignored. GETNUM should already be doing this for you After getting a character in GETNUM, check if it is 10 and jump to the register restore and return The user MUST enter a number. Newline should be ignored until at least one digit has been entered. (Use two loops. Get a number until it is not a newline. Then process that number and all subsequent numbers until a newline IS reached). You MUST print a newline (ASCII Character 10 (A in hex) after the user has entered her number. I won't be checking for overflow. All of the test numbers I use will safely fit in a 16 bit register. 4. Replace the main at the top of the program with a call to GETDEC like this orig x3000 JSR GETDEC JSR GETDEC HALT 5. When you run your program, you should see the following (assuming you type in 213 followed by enter, then 2489 followed by enter): Enter an integer: 213 Enter an integer: 2489Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started