Question: In LC - 3 , I have included my code in the images attached. I cannot pass the tests attached. * * * Starter Code

In LC-3, I have included my code in the images attached. I cannot pass the tests attached.
***Starter Code with Instructions***
;THE BINARY REPRESENTATION OF THE USER-ENTERED DECIMAL NUMBER MUST BE STORED IN R4
.ORIG x3000
;-------------
; Instructions
;-------------
; output intro prompt
; Set up flags, counters, accumulators as needed
; Get first character, test for '
','+','-', digit/non-digit
; is very first character ='
'? if so, just quit (no message)!
; is it ='+'? if so, ignore it, go get digits
; is it ='-'? if so, set neg flag, go get digits
; is it '0'? if so, it is not a digit - o/p error message, start over
; is it >'9'? if so, it is not a digit - o/p error message, start over
; if none of the above, first character is first numeric digit - convert it to number & store in target register!
; Now get remaining digits from user in a loop (max 5), testing each to see if it is a digit, and build up number in accumulator
; remember to end with a newline!
HALT
;---------------
; Program Data
;---------------
introPromptPtr.FILL xB000
errorMessagePtr .FILL xB200
.END
;------------
; Remote data
;------------
.ORIG xB000 ; intro prompt
.STRINGZ "Input a positive or negative decimal number (max 5 digits), followed by ENTER
"
.END
.ORIG xB200 ; error message
.STRINGZ "ERROR: invalid input
"
;---------------
; END of PROGRAM
;---------------
.END
;-------------------
; PURPOSE of PROGRAM
;-------------------
; Convert a sequence of up to 5 user-entered ascii numeric digits into a 16-bit two's complement binary representation of the number.
; if the input sequence is less than 5 digits, it will be user-terminated with a newline (ENTER).
; Otherwise, the program will emit its own newline after 5 input digits.
; The program must end with a *single* newline, entered either by the user (5 digits), or by the program (5 digits)
; Input validation is performed on the individual characters as they are input, but not on the magnitude of the number.
Test + ve Number without Sign (0/15)
Test Failed: Failed: Program register output differs from the solution register output.
Test 5-digit + ve Number with Sign (0/15)
Test Failed: Failed: Program register output differs from the solution register output.
Test -ve Number (0/15)
Test Failed: Failed: Program register output differs from the solution register output.
Test 5-digit -ve Number (0/10)
Test Failed: Failed: Program register output differs from the solution register output.
Test invalid initial character, +ve number w/sign (0/15)
Test Failed: Failed: Program register output differs from the solution register output.
Test invalid internal character, -ve number (0/15)
Test Failed: Failed: Program register output differs from the solution register output.
Test Double Sign, +ve number w/sign (0/10)
Test Failed: Failed: Program register output differs from the solution register output.
Test no entry (5/5)
 In LC-3, I have included my code in the images attached.

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 Programming Questions!