.ORIG x3000 BR MAIN ; skip over the data ; ; start of data ; BEGIN_DATA .FILL xBBBB ;; start of provided variables SIX .FILL x0006 ; Constant NUMBER .BLKW 1 ; Variable RESULT .BLKW 1 ; Variable END_DATA .FILL xEEEE ;; end of provided variables ; ; start of program ; MAIN LD R1,SIX ; R1 = 6 LD R2,NUMBER ; R2 = NUMBER AND R3,R3,#0 ; R3 = 0 ; ; inner loop ; AGAIN ADD R3,R3,R2 ; Add NUMBER to R3 ADD R1,R1,#-1 ; Decrement loop counter BRp AGAIN ; Branch is R1 > 0 ; HALT ; Program complete .END