TITLE "mp2.a by Douglas Jones, long winded suboptimal version" USE "hawk.h" USE "stdio.h" EXT MP2DATA INT MAIN S MAIN MAIN: STORES R1,R2 ADDSI R2,4 ; everything above here was given with the assignment ; in the following, each comment covers both the line ; holding the comment and any uncommented lines above it. ; blank lines separate blocks of code with a comment at the end. ; register use: R8 = a -- pointer used to scan mp2data ; R3 = temp LIL R8, MP2DATA ; char ** a = mp2data LOOP: ; for (;;) { LOADS R3, R8 CMPI R3, 0 BZS END ; if (*a == NULL) break LOADS R3, R8 ; -- parametr LIL R1, PUTSTR JSRS R1, R1 ; putstr( *a ) LIS R3,4 ADD R8,R8,R3 ; a++ JUMP LOOP END: ; } ; everything below here was given with the assignment ADDSI R2,-4 LOADS PC,R2 END