 .OPT NO LIST›;  SAVE #D1:SCREEN4.M65›;›;›;  LOAD #D1:STABLE2.M65›  LIST  ›;›?TSTCTL› LDX #45     Check for›;›?TSTCT1› LDA CNTRLS,X control› CMP ATACHR  character› BEQ ?TSTCT2› DEX › DEX › DEX › BPL ?TSTCT1›;›?TSTCT2› RTS ›;›;›?PHACRS› LDX #2      Save row/column›;›?PHACR1› LDA ROWCRS,X values› STA TMPROW,X› DEX › BPL ?PHACR1› RTS ›;›?PLACRS› LDX #2      Restore row›;›?PLACR1› LDA TMPROW,X and column› STA ROWCRS,X› DEX › BPL ?PLACR1› RTS ›;›?SWAP› LDA BOTSCR  Swap cursor› CMP #24     with regular› BEQ ?SWAP3  cursor position› LDX #11›;›?SWAP1› LDA ROWCRS,X› PHA › LDA TXTROW,X› STA ROWCRS,X› PLA › STA TXTROW,X› DEX › BPL ?SWAP1› LDA SWPFLG› EOR #$FF› STA SWPFLG›;›?SWAP3› JMP STATUS.S›;›;›CLICK› LDX #126    Sound key› PHA         click›;›?CLICK1› STX CONSOL› LDA VCOUNT›;›?CLICK2› CMP VCOUNT  wait for› BEQ ?CLICK2 scan line› DEX › DEX › BPL ?CLICK1› PLA › RTS ›;›?COLCR› LDA #0      Set cursor at› LDX SWPFLG  left edge› BNE ?COLCR1› LDX DINDEX› BNE ?COLCR2›;›?COLCR1› LDA LMARGN›;›?COLCR2› STA COLCRS› RTS ›;›?PUTMSC› LDA SAVMSC  Set memory› STA ADRESS  scan counter› LDA SAVMSC+1 address› STA ADRESS+1› RTS ›;›SPECIAL.S› LDX #0     Exec screen› LDA ICCOMZ  special command› CMP #17     If not draw to› BEQ ?DRAWA› CMP #18     or fill› BEQ ?DRAWB  then› LDY #132    xio syntax err› RTS ›;›?DRAWB› INX ›;›?DRAWA› STX FILFLG› LDA ROWCRS  Put cursor posit› STA NEWROW  into newrow/col› LDA COLCRS› STA NEWCOL› LDA COLCRS+1› STA NEWCOL+1› LDA #1      Set initial› STA ROWINC  directions› STA COLINC› SEC › LDA NEWROW  Determine delta row› SBC OLDROW› STA DELTAR› BCS ?DRAW1  Do direction and absolute value› LDA #$FF    Borrow attempted› STA ROWINC  Set direction down› LDA DELTAR  Negate delta rows› EOR #$FF    to get absolute› CLC         value› ADC #1› STA DELTAR›;›?DRAW1› SEC         Now delta columns› LDA NEWCOL› SBC OLDCOL› STA DELTAC› LDA NEWCOL+1 Two byte value› SBC OLDCOL+1› STA DELTAC+1› BCS ?DRAW2  direction and absolute value› LDA #$FF    Borrow attempted› STA COLINC  Reverse direction› LDA DELTAC  and set absolute› EOR #$FF    value› STA DELTAC› LDA DELTAC+1› EOR #$FF› STA DELTAC+1› INC DELTAC› BNE ?DRAW2› INC DELTAC+1›;›?DRAW2› LDX #2      Zero ram for› LDY #0      draw loop› STY COLAC+1›;›?DRAW3A› TYA › STA ROWAC,X› LDA OLDROW,X› STA ROWCRS,X› DEX › BPL ?DRAW3A› LDA DELTAC  Find larger of row or col› INX         x=0› TAY › LDA DELTAC+1› STA COUNTR+1› STA ENDPT+1› BNE ?DRAW3  larger if msb>0› LDA DELTAC  low col > low row?› CMP DELTAR› BCS ?DRAW3  yes› LDA DELTAR› LDX #2› TAY ›;›?DRAW3› TYA         Put in initial› STA COUNTR  conditions› STA ENDPT› PHA         save a› LDA ENDPT+1 put bit0 of hibyte› LSR A       into carry› PLA         restore a› ROR A       now a 9-bit ror› STA ROWAC,X›;›?DRAW4A› LDA COUNTR  test 0› ORA COUNTR+1› BNE ?DRAW11› JMP ?DRAW10 if 0 leave draw›;›?DRAW11› CLC         add row to rowac› LDA ROWAC   (plot loop)› ADC DELTAR› STA ROWAC› BCC ?DRAW5› INC ROWAC+1›;›?DRAW5› LDA ROWAC+1 Compare rowac› CMP ENDPT+1 to endpoint› BCC ?DRAW6  If less go to column› BNE ?DRAW5A› LDA ROWAC   Ditto for low byte› CMP ENDPT› BCC ?DRAW6›;›?DRAW5A› CLC         Greater or equal› LDA ROWCRS  so move point› ADC ROWINC› STA ROWCRS› LDX #0      and subtract end point› JSR ?SUBEND from rowac›;›?DRAW6› CLC         same for column› LDA COLAC   (double byte add)› ADC DELTAC› STA COLAC› LDA COLAC+1› ADC DELTAC+1› STA COLAC+1› CMP ENDPT+1 Compare hi byte› BCC ?DRAW8› BNE ?DRAE6A› LDA COLAC   Compare lo byte› CMP ENDPT› BCC ?DRAW8›;›?DRAE6A› BIT COLINC› BPL ?DRAW6B› DEC COLCRS  Do double byte› LDA COLCRS  decrement› CMP #$FF› BNE ?DRAW7› LDA COLCRS+1› BEQ ?DRAW7  Don't dec if 0› DEC COLCRS+1› BPL ?DRAW7  Go always›;›?DRAW6B› INC COLCRS  Double byte› BNE ?DRAW7  increment› INC COLCRS+1›;›?DRAW7› LDX #2      Subtract endpt› JSR ?SUBEND from colac›;›?DRAW8› JSR ?RANGE› JSR ?OUTPLT plot point› LDA FILFLG  test right fill› BEQ ?DRAW9› JSR ?PHACRS› LDA ATACHR› STA HOLD4›;›?DRAW8A› LDA ROWCRS  Save row in› PHA         case of cr› JSR ?INCRSA posit cursor one past dot› PLA         restore rowcrs› STA ROWCRS› JSR ?RANGE› JSR ?GETPLT get data› BNE ?DRAW8B stop if non-0› LDA FILDAT  fill data› STA ATACHR› JSR ?OUTPLT draw it› JMP ?DRAW8A loop›;›?DRAW8B› LDA HOLD4› STA ATACHR› JSR ?PLACRS›;›?DRAW9› SEC         double byte subtract› LDA COUNTR› SBC #1› STA COUNTR› LDA COUNTR+1› SBC #0› STA COUNTR+1› BMI ?DRAW10› JMP ?DRAW4A›;›?DRAW10› JMP STATUS.S›;›