Question: how do I fix my code to make all my tests run correctly: Test input of all 1 ' s ( 0 / 2 0

how do I fix my code to make all my tests run correctly: Test input of all 1's (0/20)
Test Failed: Failed: Program I/O differs from expected I/O:
"0000000000000000
", should be:
"1111111111111111
"
Test input of random value (0/20)
Test Failed: Failed: Program I/O differs from expected I/O:
"0000000000000000
", should be:
"1010111100011001
"
Test input with 1 in most significant bit and all other zero (0/20)
Test Failed: Failed: Program I/O differs from expected I/O:
"0000000000000000
", should be:
"1010111100011001
"
Test input of number that is a power of 2 greater than 2(0/20)
Test Failed: Failed: Program I/O differs from expected I/O:
"0000000000000000
", should be:
"0000000100000000
"
Test input of all zeros (20/20) END_SEGMENTS
LD R0, NEWLINE ; Load ASCII newline character
OUT ; Output newline
HALT
;-----------------
;Data
;-----------------
Value_ptr
NEWLINE
DEC_4
SPACE
TEMP_CHAR
HEX_30
LEADING_1
; Remote data
Value .FILL XABCD ; Value to be displayed as binary
.FILL XB270 ; The address where value to be displayed is stored
.FILL x000A; ASCII newline character
.FILL #4 ; Counter for looping through bits
.FILL x0020; ASCII space character
.FILL 0061; ASCII value for 'a'
. FILL x0030; ASCII '0'
.FILL 88000 ; Mask for checking leading 1 in MSB
.FILL 8000; Mask for checking leading 1 in MSB
.FILL XABCD ; Value to be displayed as binary
how do I fix my code to make all my tests run

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!