Question: Help fix the problems based on the provided code in LC3. (problems are in the end) .ORIG x3000 STARTING ADD R5, R5, #0 LD R1,

Help fix the problems based on the provided code in LC3. (problems are in the end)

.ORIG x3000 STARTING ADD R5, R5, #0 LD R1, INPUT_COUNT LD R2, COUNT LD R0, introMessage PUTS GETC BR CHECK END_CHECK ADD R4, R0, #0 ADD R0, R0, #-15 ADD R0, R0, #-15 ADD R0, R0, #-15 BRz NEGATIVE_NUMBER ADD R0, R0, #2 BRz POSITIVE_SIGN BR POSITIVE_NUMBER POSITIVE_NUMBER LEA R0, ZERO ADD R0, R4, #0 OUT ADD R5, R0, #0 ADD R5, R5, #-12 ADD R5, R5, #-12 ADD R5, R5, #-12 ADD R5, R5, #-12 ADD R1, R1, #-1 LOOP POSITIVE_INPUT GETC OUT BR LOOP1 END_LOOP1 ADD R3, R0, #0 ADD R3, R3, #-10 BRz POSITIVE_OUT ADD R0, R0, #-16 ADD R0, R0, #-16 ADD R0, R0, #-16 ADD R4, R5, #0 SHIFT_POSITIVE ADD R5, R5, R4 ADD R2, R2, #-1 BRp SHIFT_POSITIVE ADD R5, R5, R0 LD R2, COUNT ADD R1, R1, #-1 BRp POSITIVE_INPUT HALT POSITIVE_OUT HALT NEGATIVE_NUMBER LEA R0, NEGATIVE PUTS NEGATIVE_INPUT GETC OUT BR LOOP2 END_LOOP2 ADD R3, R0, #0 ADD R3, R3, #-10 BRz NEGATIVE_OUT ADD R0, R0, #-16 ADD R0, R0, #-16 ADD R0, R0, #-16 ADD R4, R5, #0 SHIFT_NEGATIVE ADD R5, R5, R4 ADD R2, R2, #-1 BRp SHIFT_NEGATIVE ADD R5, R5, R0 LD R2, COUNT ADD R1, R1, #-1 BRp NEGATIVE_INPUT NOT R5, R5 ADD R5, R5, #1 HALT NEGATIVE_OUT NOT R5, R5 ADD R5, R5, #1 HALT POSITIVE_SIGN LEA R0, POSITIVE PUTS BR LOOP CHECK ADD R7, R0, #0 LD R4, COUNT ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 NOT R4, R4 ADD R4, R4, #1 ADD R4, R7, R4 BRp ERROR BR END_CHECK LOOP1 ADD R7, R0, #0 LD R4, COUNT ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 NOT R4, R4 ADD R4, R4, #1 ADD R4, R7, R4 BRp ERROR BR END_LOOP1 LOOP2 ADD R7, R0, #0 LD R4, COUNT ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 ADD R4, R4, #12 NOT R4, R4 ADD R4, R4, #1 ADD R4, R7, R4 BRp ERROR BR END_LOOP2 ERROR LD R0, errorMessage PUTS LD R0, NEWLINE PUTSADD R5, R5, #0 BR STARTING ;--------------- ;Data ;--------------- POSITIVE .STRINGZ "+" NEGATIVE .STRINGZ "-" NEWLINE .STRINGZ " " INPUT_COUNT .FILL #5 COUNT .FILL #9 ZERO .FILL #0 CONVERT .FILL #48 introMessage .FILL x6000 errorMessage .FILL x6100 ;------------ ;Remote data ;------------ .ORIG x6000 ;--------------- ;messages ;--------------- intro .STRINGZ"Input a positive or negative decimal number (max 5 digits), followed by ENTER " ;--------------- ;error_messages ;--------------- .ORIG x6100 error_mes .STRINGZ" ERROR INVALID INPUT " ;--------------- ;END of PROGRAM ;--------------- .END

Help fix the problems based on the provided code in LC3. (problems

are in the end) .ORIG x3000 STARTING ADD R5, R5, #0 LD

R1, INPUT_COUNT LD R2, COUNT LD R0, introMessage PUTS GETC BR CHECK

A diff was done between the output of vour program and the output of the solution. . Your program's output is preceded bv a - symbol and is highlighted in red The solution's output is preceded by a + symbol and is highlighted in green. Lines output by both your program and the solution are not colored and do not have a symbol preceding the line. .We have attempted to darken the differences between your output and the solution's, please update vour source code to fix any problems If you see NULL it means that you are trying to output the NULL character. C@ -1,4 +1,4 +Input a positive or negative decimal number (max 5 digits), followed by ENTER +ERROR INVALID INPUT Input a positive or negative decimal number (max 5 digits), followed by ENTER 123 - r0 x000a 10 - r4 x000a 10 r1 x0001 1 r5 x6cOb 27 659 r2 x0009 9 r6 xffdi -47 r3 x00000 r7 x302a NEGATIVE NUMBER

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!