TITLE "mp2.a by Douglas Jones, fairly optimal 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. ; register use: R8 = a -- pointer used to scan mp2data ; R3 = s -- a string pointer extracted from mp2data LIL R8, MP2DATA ; char ** a = mp2data LOOP: ; for (;;) { LOADSCC R3, R8 ; char * s = *a BZS END ; if (s == NULL) break LIL R1, PUTSTR JSRS R1, R1 ; putstr( s ) ADDSI R8, 4 ; a++ BR LOOP END: ; } ; everything below here was given with the assignment ADDSI R2,-4 LOADS PC,R2 END