 .OPT NO LIST›;  SAVE #D1:SCREEN3.M65›;›;›;  LOAD #D1:SCREEN4.M65›  LIST  ›;›?DBDDEC› LDA #2      Double-byte› BNE ?DBSUB  double decrement›;›?TSTFINE› LDY FINE    Store data for› BEQ ?STORE  fine scrolling› ORA #$20    Set bit 5›;›?STORE› LDY DSTAT   return on error› BMI ?STROK› LDY #0› STA (ADRESS),Y›;›?DBDEC› LDA #1      Double byte›;›?DBSUB› STA SUBTMP  single dec› LDA DSTAT› BMI ?STROK› LDA ADRESS› SEC › SBC SUBTMP› STA ADRESS› BCS ?DBSUB1› DEC ADRESS+1›;›?DBSUB1› LDA APPMHI+1 Make sure› CMP ADRESS+1 nothing overwrites› BCC ?STROK  appmhi› BNE ?STRERR› LDA APPMHI› CMP ADRESS› BCC ?STROK›;›?STRERR› LDA #147    Mem too small› STA DSTAT   for screen›;›?STROK› RTS ›;›;›?SETSCROL› LDA #2     Set scrolling› JSR ?STORE  DList entry› LDA #$A2› JSR ?STORE› DEX › RTS ›;›?CONVRT› LDX #1      Convert row and› STX MLTTMP  column to real› DEX         address› STX ADRESS+1 Put 5*rowcrsr› LDA ROWCRS  into adress› ASL A› ROL ADRESS+1› ASL A› ROL ADRESS+1› ADC ROWCRS› STA ADRESS› BCC ?CONV1› INC ADRESS+1›;›?CONV1› LDY DINDEX  Shift Adress keft› LDX DHLINE,Y Dhline times›;›?CONV2› ASL ADRESS  to finish› ROL ADRESS+1› DEX › BNE ?CONV2› LDA COLCRS+1 Divide colcrs› LSR A       to account for› LDA COLCRS  partial byte› LDX DIV2TB,Y› BEQ ?CONV3›;›?CONV4› ROR A› ASL MLTTMP› DEX › BNE ?CONV4›;›?CONV3› ADC ADRESS› BCC ?CONV5› INC ADRESS+1›;›?CONV5› CLC › ADC SAVMSC› STA ADRESS› STA OLDADR› LDA ADRESS+1› ADC SAVMSC+1› STA ADRESS+1› STA OLDADR+1› LDX DIV2TB,Y› LDA TMSK,X› AND COLCRS› ADC MLTTMP› TAY › LDA DMASKT-1,Y› STA DMASK› STA SHFAMT› LDY #0›;›?INCRS3› RTS ›;›;›?INCRSB› LDA #0      Advance cursor› BEQ ?INCRSC routines›;›?INCRSR› LDA #155›;›?INCRSC› STA INSDAT›;›?INCRSA› INC LOGCOL  Inschr entry› INC COLCRS› BNE ?INCRS2› INC COLCRS+1›;›?INCRS2› LDA COLCRS  Test end of line› LDX DINDEX› CMP COLUMN,X› BEQ ?INC2A› CPX #0      Mode 0?› BNE ?INCRS3 No just return› CMP RMARGN  Test against› BEQ ?INCRS3 rmargn. <= is› BCC ?INCRS3 ok›;›?INC2A› CPX #8      If not mode 8› BNE ?DOCR1  go do it› LDA COLCRS+1 Check high byte› BEQ ?INCRS3 Only at 64, skip it›;›?DOCR1› LDA DINDEX  Skip logmap› BNE ?DOCR   if not mode 0› LDA LOGCOL  Test line over run› CMP #80+1› BCC ?DOCR1B If less, not line 3› LDA INSDAT  Only do logline overrun if Insdat <>0› BEQ ?DOCR› JSR DOCRWS› JMP ?INCRS1›;›?DOCR1B› JSR ?DOCR› LDA ROWCRS› CLC         Test logline bitmap› ADC #120› JSR ?BITGET Don't extend if overrun into middle of line› BCC ?DOCR1A› LDA INSDAT  Don't extend if› BEQ ?DOCR1A insdat is 0› CLC         Insert 0 into› JSR ?INSLIA bitmap›;›?DOCR1A› JMP ?DOLCOL exit›;›;›DOCRWS› LDA #155    Return with› STA INSDAT  scrolling›;›?DOCR› JSR ?COLCR› LDA #0      Colcrs to left› STA COLCRS+1› INC ROWCRS› LDX DINDEX› LDY #24     Set up scroll loop count› BIT SWPFLG› BPL ?DOCR2A Go if normal› LDY #4› TYA › BNE ?DOCR2B Go always›;›?DOCR2A› LDA NOROWS,X Get number›;›?DOCR2B› CMP ROWCRS  of rows› BNE ?INCRS1› STY HOLD3› TXA         Don't scroll if› BNE ?INCRS1 mode <>0› LDA INSDAT  Or insdat=0› BEQ ?INCRS1› CMP #155    If not a cr then› BEQ ?DOCR4B roll in 0 to extend logline› CLC ›;›?DOCR4B› JSR SCR     Go scroll› INC SCRFLG› DEC BUFSTR  Rows move up so bufstr does too› BPL ?DOCRX› INC BUFSTR›;›?DOCRX› DEC HOLD3› LDA LOGMAP› SEC         For partial lines roll in a 1› BPL ?DOCR4B Again if partial logline› LDA HOLD3   Place cursor at new line› STA ROWCRS›;›?INCRS1› JMP ?DOLCOL›;›;›?SUBEND› SEC         Subtract end› LDA ROWAC,X point from› SBC ENDPT   rowac or colac› STA ROWAC,X (x=0 or x=2)› LDA ROWAC+1,X› SBC ENDPT+1› STA ROWAC+1,X› RTS ›?ERANGE  LDA BOTSCR  If botscr=4› CMP #4      then in mixed mode› BEQ ?RANGE  and ok› LDA DINDEX  If mode=0 then› BEQ ?RANGE  editor mode and ok› JSR OPEN.E  Else open editor›;›?RANGE› LDA #39     Verify rmargn› CMP RMARGN  setting› BCS ?RANGE3› STA RMARGN  Bad set to 39›;›?RANGE3› LDX DINDEX› LDA NOROWS,X Check rows› CMP ROWCRS› BCC ?RNGERR Error if table is› BEQ ?RNGERR less or equal rowcrs› CPX #8      Check for two byte› BNE ?RANGE1 column (Gr.8)› LDA COLCRS+1› BEQ ?RNGOK  If msb 0 ok› CMP #1› BNE ?RNGERR Err if not 1› BEQ ?RANGE2 If 1 check lsb›;›?RANGE1› LDA COLCRS+1 For others› BNE ?RNGERR non-0 msb is err›;›?RANGE2› LDA COLUMN,X Check lsb› CMP COLCRS› BCC ?RNGERR› BEQ ?RNGERR›;›?RNGOK› LDA #1      Status ok› STA DSTAT› LDA #$80    Prepare break abort› LDX BRKKEY  Check brkkey flag› STA BRKKEY  Clear break› BEQ ?RNGER2 Exit if break pressed› RTS ›;›?RNGERR› JSR HOME    Home cursor› LDA #141    Flag range error›;›?RNGER2› STA DSTAT› PLA         Restore stack (routine› PLA         always 1 level from cio› LDA SWPFLG  If swapped› BPL ?RETUR3› JMP ?SWAP   swap back›;›?RETUR3› JMP STATUS.S›;›;›?OFFCRS› LDY #0      Restore old data› LDA OLDADR+1 under cursor› BEQ ?OFFCR2 Screen never on› LDA OLDCHR  page 0› STA (OLDADR),Y›;›?OFFCR2› RTS ›;›;›BITMAP› PHA         Bit map routines› AND #7      for Editor and› TAX         Screen› LDA DMASKT+7,X Get mask› STA BITMSK› PLA         Process index› LSR A› LSR A› LSR A› TAX › RTS ›;›?BITROL› ROL LOGMAP+2› ROL LOGMAP+1› ROL LOGMAP› RTS ›;›?BITPUT› BCC ?BITCLR›;›;›?BITSET› JSR BITMAP› LDA TABMAP,X› ORA BITMSK› STA TABMAP,X› RTS ›;›?BITCLR› JSR BITMAP› LDA BITMSK› EOR #$FF› AND TABMAP,X› STA TABMAP,X› RTS ›;›?LOGGET› LDA ROWCRS›;›?LO1GET› CLC ›;›?LO2GET› ADC #120›;›?BITGET› JSR BITMAP› CLC › LDA TABMAP,X› AND BITMSK› BEQ ?BITGE1› SEC ›;›?BITGE1› RTS ›;›;›?INATAC› LDA CHAR    If graphics› LDY DINDEX  modes then› CPY #14     don't change› BCS ?INATA1 character› CPY #12› BCS ?INATA2› CPY #3› BCS ?INATA1›;›?INATA2› ROL A› ROL A› ROL A› ROL A› AND #3› TAX › LDA CHAR› AND #$9F› ORA INTATA,X›;›?INATA1› STA ATACHR›;›?INARTS› RTS ›;›;›?MOVLIN› LDX RAMTOP› DEX › STX SAVADR+1› STX MLTTMP+1› LDA #$B0    point 80 bytes› STA SAVADR  below ramtop› LDA #$D8    point 40 bytes› STA MLTTMP  below ramtop› LDX ROWCRS›;›?MOVL1› INX         If at bottom of› CPX BOTSCR  screen, nothing› BEQ ?INARTS more to move› LDY #39›;›?MOVL2› LDA (SAVADR),Y Move 40› STA (MLTTMP),Y bytes one line› DEY         up› BPL ?MOVL2› SEC › LDA SAVADR  Copy from pointer› STA MLTTMP  to dest pointer› SBC #40     and decr from› STA SAVADR  pointer by 40› LDA SAVADR+1› STA MLTTMP+1› SBC #0      Loop until› STA SAVADR+1 bottom of› JMP ?MOVL1  screen›;›?EXTEND› PHP         Extend log line› LDY #22     from rowcrs›;›?EXTEN1› TYA › JSR ?LO1GET› PHP › TYA › CLC › ADC #121› PLP › JSR ?BITPUT› DEY › BMI ?EXTEN4› CPY ROWCRS› BCS ?EXTEN1›;›?EXTEN4› LDA ROWCRS› CLC › ADC #120› PLP › JMP ?BITPUT Store bit & return›;›?CLRLIN› LDA LMARGN  Clear line› STA COLCRS  cursor is on› JSR ?CONVRT› SEC › LDA RMARGN› SBC LMARGN› TAY › LDA #0›;›?CLRLI1› STA (ADRESS),Y› DEY › BPL ?CLRLI1› RTS ›;›SCR› JSR ?BITROL Screen› LDA FINE    scroll routines› BEQ ?SCROL2›;›?SCW1› LDA VSFLAG  Wait til› BNE ?SCW1   vblank makes this 0› LDA #8      Reset fine› STA VSFLAG  scroll amount›;›?SCW2› LDA VSFLAG  Wait til› CMP #1      last scan line› BNE ?SCW2   before coarse scroll›;›?SCW3› LDA VCOUNT  If vcount› CMP #64     below visible› BCS ?SCW3   screen wait for vbi› LDX #13     Assume not text› LDA BOTSCR  window and see› CMP #4      if true› BNE ?SCW4   It is› LDX #112    New top screen posit›;›?SCW4› CPX VCOUNT  Wait for screen› BCS ?SCW4   redraw›; Coarse scroll›;›?SCROL2› JSR ?PUTMSC Copy savmsc›;›?SCROL1› LDA ADRESS  to adress› LDX ADRESS+1›;›?SCROL3› INX         Last line?› CPX RAMTOP› BEQ ?SCROL4 maybe› SEC › SBC #16› JMP ?SCROL3›;›?SCROL4› ADC #40-1   allow for carry› BNE ?SCROL6› LDX ADRESS+1› INX         Last line?› CPX RAMTOP› BEQ ?SCROL5 yes go do it› CLC › ADC #16›;›?SCROL6› TAY › STA COUNTR› SEC › LDA ADRESS› SBC COUNTR› STA ADRESS› BCS ?SCROL7› DEC ADRESS+1›;›?SCROL7› LDA ADRESS› CLC › ADC #40› STA COUNTR› LDA ADRESS+1› ADC #0› STA COUNTR+1›;›?SCROL8› LDA (COUNTR),Y› STA (ADRESS),Y› INY › BNE ?SCROL8› LDY #$10› LDA ADRESS› CMP #$D8› BEQ ?SCROL5› CLC › ADC #$F0› STA ADRESS› BCC ?SCROL7› INC ADRESS+1› BNE ?SCROL7›;›?SCROL5› LDX RAMTOP  Do last› DEX         line› STX COUNTR+1› LDX #$D8› STX COUNTR› LDA #0      i.e. clear it› LDY #39›;›?SCROL9› STA (COUNTR),Y› DEY › BPL ?SCROL9›;›?DOLCOL› LDA #0› STA LOGCOL› LDA ROWCRS› STA HOLD1›;›?DOLCO1› LDA HOLD1   add in row› JSR ?LO1GET component› BCS ?DOCOL2 Found beginning› LDA LOGCOL  Add 40 and look back› CLC         one› ADC #40› STA LOGCOL› DEC HOLD1   up one line› JMP ?DOLCO1›;›?DOCOL2› CLC         add in colcrs› LDA LOGCOL› ADC COLCRS› STA LOGCOL› RTS ›;›CBC› JSR ?PHACRS Buffer count› LDA LOGCOL  routines› PHA › LDA BUFSTR› STA ROWCRS› LDA BUFSTR+1› STA COLCRS› LDA #1› STA BUFCNT›;›?DOBUF1› LDX #23     normal› LDA SWPFLG  if swapped, row 3› BPL ?DOB1   is last screen line› LDX #3›;›?DOB1› CPX ROWCRS  Is cursor at› BNE ?DOBU1A last screen posit?› LDA COLCRS› CMP RMARGN› BNE ?DOBU1A› INC BUFCNT  Yes so fake incrsr› JMP ?DOBUF2 to avoid scroll›;›?DOBU1A› JSR ?INCRSB› INC BUFCNT› LDA LOGCOL› CMP LMARGN› BNE ?DOBUF1 Not yet eol› DEC ROWCRS  Back up one› JSR CRSRLF›;›?DOBUF2› JSR ?GETPLT Test curr col› BNE ?DOBUF4 If<>0 quit› DEC BUFCNT  dec counter› LDA LOGCOL  Beginning of log line?› CMP LMARGN› BEQ ?DOBUF4 Yes quit› JSR CRSRLF  Back up cursor› LDA COLCRS  If logcol=rmargn› CMP RMARGN  go up one row› BNE ?DOBUF3› DEC ROWCRS›;›?DOBUF3› LDA BUFCNT› BNE ?DOBUF2 loop til 0›;›?DOBUF4› PLA › STA LOGCOL› JMP ?PLACRS›; Move bufstr to beginning of log line›;›?STRBEG› JSR ?DOLCOL Set hold1› LDA HOLD1› STA BUFSTR› LDA LMARGN› STA BUFSTR+1›;›?STRRTS› RTS ›;›;›?DELTIA› LDA LOGCOL  If logcol<>lmargn› CMP LMARGN  then don't move up› BNE ?DELTIB before testing› DEC ROWCRS›;›?DELTIB› JSR ?DOLCOL›; Time to delete a line if it is empty and an extension›;›?DELTIM› LDA LOGCOL  test for extension› CMP LMARGN› BEQ ?STRRTS No› JSR ?CONVRT› LDA RMARGN  Set up count› SEC › SBC LMARGN› TAY ›;›?DELTI1› LDA (ADRESS),Y› BNE ?STRRTS Quit on non-0› DEY › BPL ?DELTI1› JMP ?DELLIB Delete line, return›