TITLE "mp2.a by Douglas Jones" S START USE "hawk.macs" USE "monitor.h" COMMON STACK,#1000 PSTACK: W STACK ; these lines provide a link to the data structures for mp2 EXT ARRAY PARRAY: W ARRAY ; -------- the structure of one item --------- TEXT = 0 ; pointer to text of this item or null X = 4 ; X coordinate of this item Y = 8 ; Y coordinate of this item ITEMSIZ = 12 ; size of an item NULL = 0 ; value of null pointers SUBTITLE "main program" ; -------------------------------------------- START: LOAD R2,PSTACK ; set up the stack LOAD R1,PDSPINI JSRS R1,R1 ; initialize the display LOAD R8,PARRAY ; p = address of first array element LOOP: ; here, R8 = p LOADCC R3,R8,TEXT ; while (p->text != null) { BZS QUIT LOAD R3,R8,X LOAD R4,R8,Y LOAD R1,PDSPAT ; dspat( p->x, p->y ) JSRS R1,R1 LOAD R3,R8,TEXT LOAD R1,PDSPST ; dspst( p->text ) JSRS R1,R1 LEA R8,R8,ITEMSIZ ; p = p + itemsiz BR LOOP ; endloop QUIT: LOAD R1,PEXIT JSRS R1,R1 ; call monitor routine to stop! END