LC-3 program with 3 bugs (2 syntax and 1 logic)

52 views Asked by At

I have the following LC-3 program with 3 bugs (2 syntax and 1 logic):

        .ORIG       x3000
        LD          R1, N
        AND         R2, R2, #0
LOOP    BRz         DONE
        ADD         R2, R2, R1
        ADD         R1, R1, #-1
        BRnzp       LOOP
DONE    ST          TOTAL
N       .FILL       x000B
TOTAL   .BLKW       #1
        .STOP

I thought there were no bugs but showed my professor and he said there were 3 (2 syntax and 1 logic). I need to figure out what the bugs are in my program but I am stumped. Does anybody have any input on this? Any resources that can help me understand LC-3 programs better?

0

There are 0 answers