 .OPT NO LIST›;  SAVE #D1:SCREEN2.M65›;›;›;  LOAD #D1:SCREEN3.M65›;›  LIST  ›; begin keyboard handler›;›IGN› LDA #$FF    Ignore character› STA CH      do›;›KGB› LDA #0      Keybrd get-byte› STA SUPERF› LDA ICAX1Z  If forced read› LSR A       mode, exit› BCS ?GETOUT› LDA #$80    Test break key› LDX BRKKEY› BEQ ?K7› LDA CH› CMP #$FF› BEQ KGB› STA HOLDCH  save for shift lock proc› LDX #$FF    Clear ch› STX CH› LDX NOCLIK› BNE ?OVRCLK› JSR CLICK   Go make noise›;›?OVRCLK› TAY › CPY #$C0    Test for shift› BCS IGN     and control› LDA (KEYDEF),Y›;›?SAVEK› STA ATACHR› TAX › BMI ?SPEC› JMP ?K6A›;›?SPEC› CMP #$80    Null?› BEQ IGN     Yeah, ignore› CMP #$81    Atari key?› BNE ?KGETC1› LDA INVFLG  Yes› EOR #$80› STA INVFLG› BCS IGN     Go always›;›?KGETC1› CMP #$82    Caps/Lower?› BNE ?K1› LDA SHFLOK  If uppercase› BEQ ?KGETC2 go switch to lower› LDA #0      Switch to› STA SHFLOK  all upper case› BEQ IGN     Go always›;›?K1› CMP #$83    Shift-Caps?› BNE ?K2›;›?KGETC2› LDA #$40    Force upper› STA SHFLOK  case› BNE IGN›;›?K2› CMP #$84    Control-Caps?› BNE ?K3› LDA #$80    Force control› STA SHFLOK  lock› JMP IGN›;›?K3› CMP #$85    Control-3?› BNE ?K6› LDA #136    Do end of file›;›?K7› STA DSTAT› STA BRKKEY  Restore break key›;›?GETOUT› LDA #155› JMP ?K8›;›?K6› CMP #$89    Control-f3?› BNE ?FN1› LDA NOCLIK  Toggle key› EOR #$FF    click› STA NOCLIK› BNE ?JMPKGB› JSR CLICK›;›?JMPKGB› JMP IGN›;›;›?FN1› CMP #$8D+1  Test for› BCS ?FN2    1200xl› CMP #$8A    function keys› BCC ?JMPKGB› SBC #$8A› ASL HOLDCH  Orig kbcode› BPL ?GETFK  Go if not shifted› ORA #4      Add 4 to index›;›?GETFK› TAY         Get 1200xl› LDA (FKDEF),Y function key› JMP ?SAVEK›;›?FN2› CMP #$91+1  If >Shift+Fn› BCS ?K6A› CMP #$8E    If just fn key› BCC ?JMPKGB exit› SBC #$72    Convert code› INC SUPERF  Flag fn› BNE ?K8     Go always›;›?K6A› LDA HOLDCH  Process shift locks› CMP #$40    Regular take precedence› BCS ?K5     over lock› LDA ATACHR  Test for alpha› CMP #'a› BCC ?K5› CMP #'z+1› BCS ?K5› LDA SHFLOK  Do shift/control lock› BEQ ?K5     If none don't redo› ORA HOLDCH› JMP ?OVRCLK Do retry›;›?K5› JSR ?TSTCTL Don't invert msb› BEQ ?K4     of control chars› LDA ATACHR› EOR INVFLG›;›?K8› STA ATACHR›;›?K4› JMP STATUS.S Done›;›;›ESCAPE› LDA #$80    Handle Esc› STA ESCFLG› RTS ›;›CRSRUP› DEC ROWCRS  Cursor up› BPL ?COMRET› LDX BOTSCR  wrap around› DEX ›;›?UPDNCM› STX ROWCRS›;›?COMRET› JMP ?STRBEG Convert to log col and return›;›;›CRSRDN› INC ROWCRS  Cursor down› LDA ROWCRS› CMP BOTSCR› BCC ?COMRET› LDX #0› BEQ ?UPDNCM Always›;›CRSRLF› DEC COLCRS  Cursor left› LDA COLCRS› BMI CRSRL1  If outside lmargn› CMP LMARGN  then wrap around› BCS ?COMRE1›;›CRSRL1› LDA RMARGN  To rt margin›;›?LFRTCM› STA COLCRS  Set column›;›?COMRE1› JMP ?DOLCOL To log col›;›;›CRSRRT› INC COLCRS  Move cursor› LDA COLCRS  right› CMP RMARGN› BCC ?COMRE1› BEQ ?COMRE1›;›CRSRLM› LDA LMARGN  To lt margin› JMP ?LFRTCM›;›CLRSCR› JSR ?PUTMSC Clear screen› LDY ADRESS› LDA #0› STA ADRESS›;›?CLRSC2› STA (ADRESS),Y› INY › BNE ?CLRSC2› INC ADRESS+1› LDX ADRESS+1› CPX RAMTOP› BCC ?CLRSC2› LDA #$FF›;›?CLRSC3› STA LOGMAP,Y› INY         Clean up logical› CPY #4      line bit map› BCC ?CLRSC3›;›HOME› JSR ?COLCR  Home cursor› STA LOGCOL  Place colcrs at left edge› STA BUFSTR+1› LDA #0› STA ROWCRS› STA COLCRS+1› STA BUFSTR› RTS ›;›BKSDEL› LDA LOGCOL  Backspace› CMP LMARGN› BEQ ?BS1› LDA COLCRS  Left edge?› CMP LMARGN› BNE ?BS3    No› JSR ?DELTIM See if line should be deleted›;›?BS3› JSR CRSRLF  Move left› LDA COLCRS› CMP RMARGN  Up a line?› BNE ?BS2    No› LDA ROWCRS  Move up unless› BEQ ?BS2    at top› JSR CRSRUP  Move up›;›?BS2› LDA #32     Destructive› STA ATACHR› JSR ?OUTPLT›;›?BS1› JMP ?DOLCOL Done›;›;›TABKEY› JSR CRSRRT  Handle TAB› LDA COLCRS  Begin search› CMP LMARGN  Test for new line› BNE ?TAB1› JSR ?DOCR   Do carriage return› JSR ?LOGGET Test end of log line› BCS ?TAB2›;›?TAB1› LDA LOGCOL  Check for› JSR ?BITGET tab stop› BCC TABKEY  Keep looking›;›?TAB2› JMP ?DOLCOL›;›;›SETTAB› LDA LOGCOL  Set TAB› JMP ?BITSET Set bit in map›;›CLRTAB› LDA LOGCOL  Clear TAB› JMP ?BITCLR Clear bit in map›;›INSCHR› JSR ?PHACRS Insert char› JSR ?GETPLT Get char under crsr› STA INSDAT› LDA #0› STA SCRFLG›;›?INSCH4› JSR ?OUTCH2 Store data› LDA LOGCOL  Save logcol. If after› PHA         incrsa, logcol< than› JSR ?INCRSA now, end loop› PLA › CMP LOGCOL› BCS ?INSCH3 Quit› LDA INSDAT  Keep going› PHA › JSR ?GETPLT› STA INSDAT› PLA › JMP ?INSCH4›;›?INSCH3› JSR ?PLACRS›;›?INSCH6› DEC SCRFLG  If scroll› BMI ?INSCN5 occurred, move› DEC ROWCRS  cursor up› BNE ?INSCH6 Repeat until scrflg is -ve›;›?INSCN5› JMP ?DOLCOL›;›;›DELCHR› JSR ?PHACRS Delete chr›;›?DELCH1› JSR ?CONVRT Get data to rt of cursor› LDA ADRESS  Save destination› STA SAVADR  address› LDA ADRESS+1› STA SAVADR+1› LDA LOGCOL› PHA › JSR ?INCRSB Put crsr over next chr› PLA         Test new logcol› CMP LOGCOL  against old. Done› BCS ?DELCH2 if old >= new› LDA ROWCRS  row off screen› CMP BOTSCR› BCS ?DELCH2› JSR ?GETPLT Get data under› LDY #0      cursor› STA (SAVADR),Y Put in prior spot› BEQ ?DELCH1 Go always›;›?DELCH2› LDY #0      Clear last› TYA         position› STA (SAVADR),Y› JSR ?DELTIA Try to delete line› JSR ?PLACRS› JMP ?DOLCOL Done›;›INSLIN› SEC         Insert line›;›?INSLIA› JSR ?EXTEND› LDA LMARGN  Do carriage ret› STA COLCRS  no line feed› JSR ?CONVRT get address› JSR ?MOVLIN Copy line down› JSR ?CLRLIN Clear present line› JMP ?DOLCOL Done›;›DELLIN› JSR ?DOLCOL Del line› LDY HOLD1   Squeeze bitmap› STY ROWCRS  put cursor there›;›?DELLIB› LDY ROWCRS›;›?DELLI1› TYA › SEC › JSR ?LO2GET Get next bit› PHP › TYA › CLC › ADC #120› PLP › JSR ?BITPUT Write over present› INY         bit› CPY #24› BNE ?DELLI1› LDA LOGMAP+2 Set lsb› ORA #1› STA LOGMAP+2› LDA #0› STA COLCRS› JSR ?CONVRT› JSR ?SCROL1› JSR ?LOGGET Test next for continuation› BCC ?DELLIB Not new log line› JMP CRSRLM›;›BELL› LDY #$20    Sound bell›;›?BELL1› JSR CLICK› DEY › BPL ?BELL1› RTS ›;›CRSBOT› JSR HOME    Cursor to› JMP CRSRUP  bottom›