BR graphics_main ; Jump to main graphics_main: MML q2, q3 ; open load queue MMS q4, q5 ; open store queue main_top0: SPAWNC graphics_Frame_constructor, q1 ; f = spawn thread for constructor MAPQC q0, q0, q1 ; map to new thread PROCID q0 ; send return context MOVECL 6, q0 ; send return q MOVECL 8, q0 ; send arg: 8 MOVECL 8, q0 ; send arg: 8 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SPAWNC graphics_Line_constructor, q1 ; l = spawn thread for constructor MAPQC q0, q0, q1 ; map to new thread PROCID q0 ; send return context MOVECL 7, q0 ; send return q MOVECL 0, q0 ; send arg: 0 MOVECL 0, q0 ; send arg: 0 MOVECL 7, q0 ; send arg: 7 MOVECL 4, q0 ; send arg: 4 MOVECL 12, q0 ; send arg: 12 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect MOVE q7, q2 ; x = Access (DEQUEUE l)l MOVECL 0, q2 ; load method lookup pointer MOVE q3, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE q7, q0 ; send this l PROCID q0 ; send return context MOVECL 8, q0 ; send return q MOVE @q6, q0 ; send arg: f EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SPAWNC graphics_Line_constructor, q1 ; l = spawn thread for constructor MAPQC q0, q0, q1 ; map to new thread PROCID q0 ; send return context MOVECL 7, q0 ; send return q MOVECL 0, q0 ; send arg: 0 MOVECL 3, q0 ; send arg: 3 MOVECL 7, q0 ; send arg: 7 MOVECL 7, q0 ; send arg: 7 MOVECL 69, q0 ; send arg: 69 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect MOVE q7, q2 ; y = Access (DEQUEUE l)l MOVECL 0, q2 ; load method lookup pointer MOVE q3, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE q7, q0 ; send this l PROCID q0 ; send return context MOVECL 9, q0 ; send return q MOVE @q6, q0 ; send arg: f EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SPAWNC graphics_Circle_constructor, q1 ; c = spawn thread for constructor MAPQC q0, q0, q1 ; map to new thread PROCID q0 ; send return context MOVECL 10, q0 ; send return q MOVECL 3, q0 ; send arg: 3 MOVECL 3, q0 ; send arg: 3 MOVECL 3, q0 ; send arg: 3 MOVECL 45, q0 ; send arg: 45 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect MOVE q10, q2 ; z = Access (DEQUEUE c)c MOVECL 0, q2 ; load method lookup pointer MOVE q3, q1 ; place ptr addr in TEMP MOVECL 1, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE q10, q0 ; send this c PROCID q0 ; send return context MOVECL 11, q0 ; send return q MOVE @q6, q0 ; send arg: f EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect ADD q9, q11, q11 ; z = y + z ADD q8, q11, q11 ; z = x + z MOVE q6, q2 ; Access (DEQUEUE f)f MOVECL 0, q2 ; load method lookup pointer MOVE q3, q1 ; place ptr addr in TEMP MOVECL 2, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE q6, q0 ; send this f EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect graphics_main_end: UNMAPQ q2 ; disconnect from load UNMAPQ q4 ; disconnect from store HALT ; end of method graphics_prints: MML q2, q3 ; open load queue MMS q4, q5 ; open store queue MOVE q0, q6 ; move val to it's allocated q prints_top1: graphics_prints_end: UNMAPQ q2 ; disconnect from load UNMAPQ q4 ; disconnect from store HALT ; end of method graphics_Frame__lookup: ANDC @q0, 0xFFFFFFFF00000000, q1 ; extract high order bits BRNZ q1, graphics_Frame__lookup_int ; interface? SHLC q0, 1, q1 ; compute jump offset BREL q1 ; branch rel based on method number MOVECL graphics_Frame_setPixel, q1 ; move method addr to temp JMP q0 ; return to caller MOVECL graphics_Frame_getPixel, q1 ; move method addr to temp JMP q0 ; return to caller MOVECL graphics_Frame_print, q1 ; move method addr to temp JMP q0 ; return to caller graphics_Frame__lookup_int: HALT ; Whoops; didn't match anything! graphics_Frame_print: MOVE q0, q2 ; save this MML q3, q4 ; open load queue MMS q5, q6 ; open store queue print_top2: MOVECL 0, @q7 ; x = 0 MOVECL 0, @q8 ; y = 0 MOVECL 0, @q9 ; counter = 0 while_test3: MOVE q2, q3 ; Access this MOVECL 3, q3 ; Send ivar offset ysize MOVE q4, q10 ; TEMP$0 = (THIS).ysize SLT @q8, q10, q1 ; test y < TEMP$0 BRZ q1, after_while8 ; if false, do false while_body4: while_test5: MOVE q2, q3 ; Access this MOVECL 2, q3 ; Send ivar offset xsize MOVE q4, q11 ; TEMP$1 = (THIS).xsize SLT @q7, q11, q1 ; test x < TEMP$1 BRZ q1, after_while7 ; if false, do false while_body6: MOVE q2, q3 ; Access this MOVECL 1, q3 ; Send ivar offset screen MOVE q4, q12 ; TEMP$2 = (THIS).screen MULC @q9, 8, q13 ; TEMP$3 = counter * 8 MOVE q12, q3 ; Access array TEMP$2 MOVECL q13, q3 ; Send array offset TEMP$3 MOVE q4, q14 ; TEMP$4 = (DEQUEUE TEMP$2)[(DEQUEUE TEMP$3)] SPAWNC graphics_prints, q1 ; spawn thread for standalone method MAPQC q0, q0, q1 ; map to new thread MOVE q14, q0 ; send arg: TEMP$4 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SPAWNC graphics_prints, q1 ; spawn thread for standalone method MAPQC q0, q0, q1 ; map to new thread MOVECL \t, q0 ; send arg: \t EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect ADDC q7, 1, q7 ; x = x + 1 ADDC q9, 1, q9 ; counter = counter + 1 BR while_test5 after_while7: SPAWNC graphics_prints, q1 ; spawn thread for standalone method MAPQC q0, q0, q1 ; map to new thread MOVECL \n, q0 ; send arg: \n EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect MOVECL 0, @q7 ; x = 0 ADDC q8, 1, q8 ; y = y + 1 BR while_test3 after_while8: graphics_Frame_print_end: UNMAPQ q3 ; disconnect from load UNMAPQ q5 ; disconnect from store FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Frame_setPixel: MOVE q0, q2 ; save this MML q3, q4 ; open load queue MMS q5, q6 ; open store queue MOVE q0, q7 ; move x to it's allocated q MOVE q0, q8 ; move y to it's allocated q MOVE q0, q9 ; move value to it's allocated q setPixel_top9: MOVE q2, q3 ; Access this MOVECL 1, q3 ; Send ivar offset screen MOVE q4, q10 ; TEMP$0 = (THIS).screen MOVE q2, q3 ; Access this MOVECL 3, q3 ; Send ivar offset ysize MOVE q4, q11 ; TEMP$1 = (THIS).ysize SUBC q11, 1, q12 ; TEMP$2 = TEMP$1 - 1 SUB q12, q8, q13 ; TEMP$3 = TEMP$2 - y MOVE q2, q3 ; Access this MOVECL 2, q3 ; Send ivar offset xsize MOVE q4, q14 ; TEMP$4 = (THIS).xsize MUL q13, q14, q15 ; TEMP$5 = TEMP$3 * TEMP$4 ADD q15, q7, q16 ; TEMP$6 = TEMP$5 + x MULC q16, 8, q17 ; TEMP$7 = TEMP$6 * 8 MOVE q10, q5 ; Access array TEMP$0 MOVECL q17, q5 ; Send array offset TEMP$7 MOVE q9, q6 ; (DEQUEUE TEMP$0)[(DEQUEUE TEMP$7)] = value graphics_Frame_setPixel_end: UNMAPQ q3 ; disconnect from load UNMAPQ q5 ; disconnect from store FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Frame_constructor: MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue ALLOCATEC 4, q2 ; allocate space for object MOVE @q2, q6 ; store method lookup pointer MOVECL 0, q6 ; pointer is first element MOVECL graphics_Frame__lookup, q7 ; stash pointer EEQ q7 ; make sure it's saved before continuing MOVE q0, q8 ; move x to it's allocated q MOVE q0, q9 ; move y to it's allocated q constructor_top10: MOVE q2, q6 ; Access this MOVECL 2, q6 ; Send ivar offset xsize MOVE q8, q7 ; (THIS).xsize = x MOVE q2, q6 ; Access this MOVECL 3, q6 ; Send ivar offset ysize MOVE q9, q7 ; (THIS).ysize = y MOVE q2, q4 ; Access this MOVECL 2, q4 ; Send ivar offset xsize MOVE q5, q10 ; TEMP$0 = (THIS).xsize MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset ysize MOVE q5, q11 ; TEMP$1 = (THIS).ysize MUL q10, q11, q12 ; TEMP$2 = TEMP$0 * TEMP$1 MOVE q2, q6 ; Access this MOVECL 1, q6 ; Send ivar offset screen ALLOCATE q12, q7 ; (THIS).screen = new int[(DEQUEUE TEMP$2)]TEMP$2 BRZ @q3, graphics_Frame_constructor_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVE @q2, q3 ; return this graphics_Frame_constructor_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Frame_getPixel: MOVE q0, q2 ; save this MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue MOVE q0, q8 ; move x to it's allocated q MOVE q0, q9 ; move y to it's allocated q getPixel_top11: MOVE q2, q4 ; Access this MOVECL 1, q4 ; Send ivar offset screen MOVE q5, q10 ; TEMP$0 = (THIS).screen MOVE q2, q4 ; Access this MOVECL 2, q4 ; Send ivar offset xsize MOVE q5, q11 ; TEMP$1 = (THIS).xsize MUL q9, q11, q12 ; TEMP$2 = y * TEMP$1 ADD q12, q8, q13 ; TEMP$3 = TEMP$2 + x MULC q13, 8, q14 ; TEMP$4 = TEMP$3 * 8 BRZ @q3, graphics_Frame_getPixel_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVE q10, q4 ; Access array TEMP$0 MOVECL q14, q4 ; Send array offset TEMP$4 MOVE q5, q3 ; return (DEQUEUE TEMP$0)[(DEQUEUE TEMP$4)] graphics_Frame_getPixel_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Circle__lookup: ANDC @q0, 0xFFFFFFFF00000000, q1 ; extract high order bits BRNZ q1, graphics_Circle__lookup_int ; interface? SHLC q0, 1, q1 ; compute jump offset BREL q1 ; branch rel based on method number MOVECL graphics_Circle_circlePoints, q1 ; move method addr to temp JMP q0 ; return to caller MOVECL graphics_Circle_scan, q1 ; move method addr to temp JMP q0 ; return to caller graphics_Circle__lookup_int: HALT ; Whoops; didn't match anything! graphics_Circle_scan: MOVE q0, q2 ; save this MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue MOVE q0, q8 ; move f to it's allocated q scan_top12: MOVECL 0, @q9 ; sync = 0 MOVECL 0, @q10 ; x = 0 MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset radius MOVE q5, @q11 ; y = (THIS).radius MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset radius MOVE q5, q12 ; TEMP$0 = (THIS).radius MOVECL 1, q1 ; left-hand constants not allowed SUB q1, q12, @q13 ; d = 1 - TEMP$0 MOVECL 3, @q14 ; deltaE = 3 MOVECL 0, q1 ; left-hand constants not allowed SUBC q1, 2, q15 ; TEMP$1 = 0 - 2 MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset radius MOVE q5, q16 ; TEMP$2 = (THIS).radius MUL q15, q16, q17 ; TEMP$3 = TEMP$1 * TEMP$2 ADDC q17, 5, @q18 ; deltaSE = TEMP$3 + 5 MOVE @q2, q4 ; Access this MOVECL 0, q4 ; load method lookup pointer MOVE q5, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q2, q0 ; send this MOVE @q8, q0 ; send arg: f MOVE @q10, q0 ; send arg: x MOVE @q11, q0 ; send arg: y EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect while_test13: SLE @q11, @q10, q1 ; test y > x SEQ q1, 0, q1 ; flip due to inst set lacks BRZ q1, after_while18 ; if false, do false while_body14: SLTC @q13, 0, q1 ; test d < 0 BRZ q1, false_branch17 ; if false, do false true_branch15: ADD q13, @q14, q13 ; d = d + deltaE ADDC q14, 2, q14 ; deltaE = deltaE + 2 ADDC q18, 2, q18 ; deltaSE = deltaSE + 2 ADDC q10, 1, q10 ; x = x + 1 after_if16: MOVE @q2, q4 ; Access this MOVECL 0, q4 ; load method lookup pointer MOVE q5, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q2, q0 ; send this MOVE @q8, q0 ; send arg: f MOVE @q10, q0 ; send arg: x MOVE @q11, q0 ; send arg: y EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect BR while_test13 false_branch17: ADD q13, @q18, q13 ; d = d + deltaSE ADDC q14, 2, q14 ; deltaE = deltaE + 2 ADDC q18, 4, q18 ; deltaSE = deltaSE + 4 ADDC q10, 1, q10 ; x = x + 1 SUBC q11, 1, q11 ; y = y - 1 BR after_if16 after_while18: BRZ @q3, graphics_Circle_scan_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVE q9, q3 ; return sync graphics_Circle_scan_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Circle_constructor: MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue ALLOCATEC 5, q2 ; allocate space for object MOVE @q2, q6 ; store method lookup pointer MOVECL 0, q6 ; pointer is first element MOVECL graphics_Circle__lookup, q7 ; stash pointer EEQ q7 ; make sure it's saved before continuing MOVE q0, q8 ; move x0 to it's allocated q MOVE q0, q9 ; move y0 to it's allocated q MOVE q0, q10 ; move rad to it's allocated q MOVE q0, q11 ; move c to it's allocated q constructor_top19: MOVE q2, q6 ; Access this MOVECL 1, q6 ; Send ivar offset x MOVE q8, q7 ; (THIS).x = x0 MOVE q2, q6 ; Access this MOVECL 2, q6 ; Send ivar offset y MOVE q9, q7 ; (THIS).y = y0 MOVE q2, q6 ; Access this MOVECL 3, q6 ; Send ivar offset radius MOVE q10, q7 ; (THIS).radius = rad MOVE q2, q6 ; Access this MOVECL 4, q6 ; Send ivar offset color MOVE q11, q7 ; (THIS).color = c BRZ @q3, graphics_Circle_constructor_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVE @q2, q3 ; return this graphics_Circle_constructor_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Circle_circlePoints: MOVE q0, q2 ; save this MML q3, q4 ; open load queue MMS q5, q6 ; open store queue MOVE q0, q7 ; move f to it's allocated q MOVE q0, q8 ; move dx to it's allocated q MOVE q0, q9 ; move dy to it's allocated q circlePoints_top20: MOVE q2, q3 ; Access this MOVECL 1, q3 ; Send ivar offset x MOVE q4, q10 ; lx = (THIS).x MOVE q2, q3 ; Access this MOVECL 2, q3 ; Send ivar offset y MOVE q4, q11 ; ly = (THIS).y MOVE q2, q3 ; Access this MOVECL 4, q3 ; Send ivar offset color MOVE q4, q12 ; lcolor = (THIS).color ADD @q10, @q8, q13 ; TEMP$0 = lx + dx ADD @q11, @q9, q14 ; TEMP$1 = ly + dy MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q13, q0 ; send arg: TEMP$0 MOVE q14, q0 ; send arg: TEMP$1 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect ADD @q10, @q9, q15 ; TEMP$2 = lx + dy ADD @q11, @q8, q16 ; TEMP$3 = ly + dx MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q15, q0 ; send arg: TEMP$2 MOVE q16, q0 ; send arg: TEMP$3 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect ADD @q10, @q9, q17 ; TEMP$4 = lx + dy SUB @q11, @q8, q18 ; TEMP$5 = ly - dx MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q17, q0 ; send arg: TEMP$4 MOVE q18, q0 ; send arg: TEMP$5 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect ADD @q10, @q8, q19 ; TEMP$6 = lx + dx SUB @q11, @q9, q20 ; TEMP$7 = ly - dy MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q19, q0 ; send arg: TEMP$6 MOVE q20, q0 ; send arg: TEMP$7 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SUB @q10, @q8, q21 ; TEMP$8 = lx - dx SUB @q11, @q9, q22 ; TEMP$9 = ly - dy MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q21, q0 ; send arg: TEMP$8 MOVE q22, q0 ; send arg: TEMP$9 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SUB @q10, @q9, q23 ; TEMP$10 = lx - dy SUB @q11, @q8, q24 ; TEMP$11 = ly - dx MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q23, q0 ; send arg: TEMP$10 MOVE q24, q0 ; send arg: TEMP$11 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SUB @q10, @q9, q25 ; TEMP$12 = lx - dy ADD @q11, @q8, q26 ; TEMP$13 = ly + dx MOVE @q7, q3 ; Access (COPY f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q7, q0 ; send this f MOVE q25, q0 ; send arg: TEMP$12 MOVE q26, q0 ; send arg: TEMP$13 MOVE @q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect SUB q10, q8, q27 ; TEMP$14 = lx - dx ADD q11, q9, q28 ; TEMP$15 = ly + dy MOVE q7, q3 ; Access (DEQUEUE f)f MOVECL 0, q3 ; load method lookup pointer MOVE q4, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE q7, q0 ; send this f MOVE q27, q0 ; send arg: TEMP$14 MOVE q28, q0 ; send arg: TEMP$15 MOVE q12, q0 ; send arg: lcolor EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect graphics_Circle_circlePoints_end: UNMAPQ q3 ; disconnect from load UNMAPQ q5 ; disconnect from store FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Line__lookup: ANDC @q0, 0xFFFFFFFF00000000, q1 ; extract high order bits BRNZ q1, graphics_Line__lookup_int ; interface? SHLC q0, 1, q1 ; compute jump offset BREL q1 ; branch rel based on method number MOVECL graphics_Line_scan, q1 ; move method addr to temp JMP q0 ; return to caller graphics_Line__lookup_int: HALT ; Whoops; didn't match anything! graphics_Line_scan: MOVE q0, q2 ; save this MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue MOVE q0, q8 ; move f to it's allocated q scan_top21: MOVECL 0, q9 ; sync = 0 MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset x1 MOVE q5, q10 ; TEMP$0 = (THIS).x1 MOVE q2, q4 ; Access this MOVECL 1, q4 ; Send ivar offset x0 MOVE q5, q11 ; TEMP$1 = (THIS).x0 SUB q10, q11, q12 ; dx = TEMP$0 - TEMP$1 MOVE q2, q4 ; Access this MOVECL 4, q4 ; Send ivar offset y1 MOVE q5, q13 ; TEMP$2 = (THIS).y1 MOVE q2, q4 ; Access this MOVECL 2, q4 ; Send ivar offset y0 MOVE q5, q14 ; TEMP$3 = (THIS).y0 SUB q13, q14, q15 ; dy = TEMP$2 - TEMP$3 MOVECL 2, q1 ; left-hand constants not allowed MUL q1, @q15, q16 ; TEMP$4 = 2 * dy SUB q16, @q12, @q17 ; d = TEMP$4 - dx MOVECL 2, q1 ; left-hand constants not allowed MUL q1, @q15, @q18 ; incrE = 2 * dy SUB q15, q12, q19 ; TEMP$5 = dy - dx MOVECL 2, q1 ; left-hand constants not allowed MUL q1, q19, @q20 ; incrNE = 2 * TEMP$5 MOVE q2, q4 ; Access this MOVECL 1, q4 ; Send ivar offset x0 MOVE q5, @q21 ; x = (THIS).x0 MOVE q2, q4 ; Access this MOVECL 2, q4 ; Send ivar offset y0 MOVE q5, @q22 ; y = (THIS).y0 MOVE q2, q4 ; Access this MOVECL 5, q4 ; Send ivar offset color MOVE q5, q23 ; TEMP$6 = (THIS).color MOVE @q8, q4 ; Access (COPY f)f MOVECL 0, q4 ; load method lookup pointer MOVE q5, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q8, q0 ; send this f MOVE @q21, q0 ; send arg: x MOVE @q22, q0 ; send arg: y MOVE q23, q0 ; send arg: TEMP$6 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect while_test22: MOVE q2, q4 ; Access this MOVECL 3, q4 ; Send ivar offset x1 MOVE q5, q24 ; TEMP$7 = (THIS).x1 SLT @q21, q24, q1 ; test x < TEMP$7 BRZ q1, after_while27 ; if false, do false while_body23: SLEC @q17, 0, q1 ; test d <= 0 BRZ q1, false_branch26 ; if false, do false true_branch24: ADD q17, @q18, q17 ; d = d + incrE ADDC q21, 1, q21 ; x = x + 1 after_if25: MOVE q2, q4 ; Access this MOVECL 5, q4 ; Send ivar offset color MOVE q5, q25 ; TEMP$8 = (THIS).color MOVE @q8, q4 ; Access (COPY f)f MOVECL 0, q4 ; load method lookup pointer MOVE q5, q1 ; place ptr addr in TEMP MOVECL 0, q0 ; place method id in ARG JMPL q1, q0 ; jump to method ptr, ret point behind ARG SPAWN q1, q1 ; spawn thread for method MAPQC q0, q0, q1 ; map to new thread MOVE @q8, q0 ; send this f MOVE @q21, q0 ; send arg: x MOVE @q22, q0 ; send arg: y MOVE q25, q0 ; send arg: TEMP$8 EEQ q0 ; ensure they're sent UNMAPQ q0 ; disconnect BR while_test22 false_branch26: ADD q17, @q20, q17 ; d = d + incrNE ADDC q21, 1, q21 ; x = x + 1 ADDC q22, 1, q22 ; y = y + 1 BR after_if25 after_while27: BRZ @q3, graphics_Line_scan_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVECL 1, q3 ; return 1 graphics_Line_scan_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method graphics_Line_constructor: MOVE q0, q3 ; save return context id MOVE q0, q3 ; save return queue MML q4, q5 ; open load queue MMS q6, q7 ; open store queue ALLOCATEC 6, q2 ; allocate space for object MOVE @q2, q6 ; store method lookup pointer MOVECL 0, q6 ; pointer is first element MOVECL graphics_Line__lookup, q7 ; stash pointer EEQ q7 ; make sure it's saved before continuing MOVE q0, q8 ; move x0 to it's allocated q MOVE q0, q9 ; move y0 to it's allocated q MOVE q0, q10 ; move x1 to it's allocated q MOVE q0, q11 ; move y1 to it's allocated q MOVE q0, q12 ; move color to it's allocated q constructor_top28: MOVE q2, q6 ; Access this MOVECL 1, q6 ; Send ivar offset x0 MOVE q8, q7 ; (THIS).x0 = x0 MOVE q2, q6 ; Access this MOVECL 2, q6 ; Send ivar offset y0 MOVE q9, q7 ; (THIS).y0 = y0 MOVE q2, q6 ; Access this MOVECL 3, q6 ; Send ivar offset x1 MOVE q10, q7 ; (THIS).x1 = x1 MOVE q2, q6 ; Access this MOVECL 4, q6 ; Send ivar offset y1 MOVE q11, q7 ; (THIS).y1 = y1 MOVE q2, q6 ; Access this MOVECL 5, q6 ; Send ivar offset color MOVE q12, q7 ; (THIS).color = color BRZ @q3, graphics_Line_constructor_end ; should return? MOVE q3, q1 ; ready return id MAPQI q3, q3, q1 ; map to return point MOVE @q2, q3 ; return this graphics_Line_constructor_end: UNMAPQ q4 ; disconnect from load UNMAPQ q6 ; disconnect from store FLUSHQ q3 ; get rid of return point FLUSHQ q2 ; get rid of this HALT ; end of method