From 5b6bcfa221a784cce1647827207c6264bca2807b Mon Sep 17 00:00:00 2001 From: Antoine Vignau <34219772+antoinevignau@users.noreply.github.com> Date: Tue, 10 Nov 2020 11:17:09 +0100 Subject: [PATCH] Upload of latest version I changed the output filename from prozap.system to prozap, still a SYS file --- source/prozap.s | 2357 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2357 insertions(+) create mode 100644 source/prozap.s diff --git a/source/prozap.s b/source/prozap.s new file mode 100644 index 0000000..4571635 --- /dev/null +++ b/source/prozap.s @@ -0,0 +1,2357 @@ +* +* ProZAP +* +* (c) 1984, Gary W. Charpentier +* (s) 2020, Antoine Vignau +* +* + + mx %11 + org $2000 + typ SYS + dsk ProZAP + lst off + +*---------------------------- + +L0200 = $0200 ; keyboard buffer +L0280 = $0280 ; ProDOS 8 prefix buffer +L0800 = $0800 ; launch SYS code buffer +L1000 = $1000 ; buffer for READ and READ_BLOCK +L1100 = $1100 +L1400 = $1400 ; buffer for GET_PREFIX +L1500 = $1500 ; buffer for ONLINE + +CH = $24 +CV = $25 + +SOFTEV EQU $03F2 +PWREDUP EQU $03F4 +PRODOS8 EQU $BF00 +P8DEATHV EQU $BF03 +BITMAP EQU $BF58 +FLEVEL EQU $BF94 +MACHID EQU $BF98 +MINIVERS EQU $BFFC +IVERSION EQU $BFFD + +KBD EQU $C000 +CLR80VID EQU $C00C +CLRALTCHAR EQU $C00E +LCBANK1 EQU $C08B + +INIT EQU $FB2F +SETPWRC EQU $FB6F +VTAB EQU $FC22 +HOME EQU $FC58 +CLREOL EQU $FC9C +RDKEY EQU $FD0C +GETLN EQU $FD6A +PRBYTE EQU $FDDA +COUT EQU $FDED +SETNORM EQU $FE84 +SETKBD EQU $FE89 +SETVID EQU $FE93 +BELL EQU $FF3A + +*---------------------------- + +THEBEGIN = * + +*--- Entry point + +L2000 LDA #$00 + STA MINIVERS + STA IVERSION + STA FLEVEL + STA CLR80VID + STA CLRALTCHAR + STA KBD + CLD + LDX #$FF + TXS + LDA #L2C5F + STA SOFTEV+1 + JSR SETPWRC + JSR SETNORM + JSR INIT + JSR SETVID + JSR SETKBD + +*--- Save bitmap + + LDY #$00 +L2033 LDA BITMAP,Y + STA L2050,Y + INY + CPY #$18 + BNE L2033 + +*--- Mark $2000..$33ff busy + + LDA #>THEBEGIN + STA $04 +L2042 JSR L2068 + INC $04 + LDA $04 + CMP #>THEEND + BNE L2042 + JMP L2B9B + +*--- ProDOS 8 bitmap buffer + +L2050 HEX FCFCFCFCFCFCFCFCFCFCFCFCFFFCFCFC + HEX FCFDFCFCFFFCFCFC + +*--- Mark page busy + +L2068 CMP #$C0 + BCS L2084 + TAX + LSR + LSR + LSR + TAY + TXA + AND #$07 + TAX + LDA #$80 +L2077 DEX + BMI L207E + LSR + JMP L2077 + +L207E ORA BITMAP,Y + STA BITMAP,Y +L2084 RTS + +*--- Restore bitmap + +L2085 LDY #$00 +L2087 LDA L2050,Y + STA BITMAP,Y + INY + CPY #$18 + BNE L2087 + + JSR PRODOS8 ; GET_FILE_INFO + DB $C4 + DA proGETINFO + BEQ L20A0 + + JSR L292B + JMP L2C5F + +L20A0 LDA proGETINFO+4 + CMP #$FF + BEQ L20DC + JSR saveXY + LDA #$01 + STA CV + LDA #$14 + STA CH + JSR VTAB + JSR BELL + LDY #$00 +L20BA LDA L20CC+1,Y + JSR L2486 + INY + CPY L20CC + BNE L20BA + JSR restoreXY + JMP L2C5F + +L20CC STR "Not a SYS file." + +L20DC LDA #L214D + STA $01 + LDA #L0800 + STA $03 + SEC + LDA # Moves cursor"8D + ASC "0-9,A-F Enters data at cursor"8D + ASC "H or ? Prints this message"8D + ASC "A### Alter ASCII at ###"8D + ASC "A Alter ASCII at cursor"8D + ASC "Q Path " + +L2410 ASC " Quit to Path"8D + ASC "Q Quit to BASIC.SYSTEM"8D + +L2440 STR "MLI Error = " + +L244D STR " *** Cmd unknown" + +L245F STR "Bad block number" + +proGETPFX DB $01 ; GET_PREFIX + DA L1400 + +proONLINE DB $02 ; ON_LINE + DB $00 + DA L1500 + +proREADBLK DB $03 ; READ_BLOCK + DB $00 + DA L1000 +curBLOCK DA $0000 + +L247D DB $00 +L247E DB $00 +L247F DB $00 +maxBLOCK DW $0000 +L2482 DB $00 +L2483 DB $00 +L2484 DB $00 +L2485 DB $00 + +L2486 PHA + LDA $32 + CMP #$7F + BNE L249D + PLA + PHA + CMP #$80 + BCC L24B0 + CMP #$C0 + BCS L249D + PLA + CLC + ADC #$40 + BNE L24AD +L249D LDA MACHID + AND #$C0 + CMP #$80 + BEQ L24B0 + PLA + CMP #$E0 + BCC L24AD + SBC #$20 +L24AD JMP COUT + +L24B0 PLA + JMP COUT + +valueCH DB $00 +valueCV DB $00 + +saveXY LDA CH + STA valueCH + LDA CV + STA valueCV + RTS + +restoreXY LDA valueCH + STA CH + LDA valueCV + STA CV + JMP VTAB + +displayHELP JSR saveXY + LDA #$00 + STA CH + LDA #$02 + STA CV + STA $22 + LDA $23 + STA L27D2 + LDA #$18 + STA $23 + JSR HOME + LDY #$00 +L24E9 LDA L2210,Y + JSR L2486 + INY + BNE L24E9 +L24F2 LDA L2310,Y + JSR L2486 + INY + BNE L24F2 +L24FB LDA L2410,Y + JSR L2486 + INY + CPY #$30 + BNE L24FB + LDA #$00 + STA $22 + LDA L27D2 + STA $23 + JMP restoreXY + +*---------------------------- +* H or ? - HELP COMMAND +*---------------------------- + +doHELP LDA curBLOCK + CMP #$FF + BNE L2522 + LDA curBLOCK+1 + CMP #$FF + BNE L2522 + BEQ displayHELP +L2522 JSR displayHELP + LDA #$00 + STA CH + LDA #$16 + STA CV + JSR VTAB + JSR RDKEY + JSR restoreXY + JMP L2780 + +*--- Show first line + +L2539 JSR saveXY + LDA #$00 + STA CV + STA CH + JSR VTAB + LDY #$00 +L2547 LDA L21EA+1,Y + JSR L2486 + INY + CPY L21EA + BNE L2547 + +* Output SLOT + + LDA #$09 + STA CH + LDA #$00 + STA CV + JSR VTAB + LDA proREADBLK+1 + AND #$70 + LSR + LSR + LSR + LSR + CLC + ADC #$B0 + JSR L2486 + +* Output DRIVE + + INC CH + LDA proREADBLK+1 + AND #$80 + LSR + LSR + LSR + LSR + LSR + LSR + LSR + CLC + ADC #$B1 + JSR L2486 + +* Output BLOCK + + LDA #$12 + STA CH + LDA curBLOCK + CMP #$FF + BNE L25E7 + LDA curBLOCK+1 + CMP #$FF + BNE L25E7 + + DEC CH + LDA L2484 + BNE L259F + LDA #$A4 ; $ + JMP L25A6 +L259F LDA #$A3 ; # + JSR L2486 + LDA #$BF ; ? +L25A6 JSR L2486 + LDA #$BF ; ???? + JSR L2486 + JSR L2486 + JSR L2486 + JSR L2486 + LDA #$1A + STA CH + LDA L2484 + BNE L25C5 + LDA #$A4 ; $ + JMP L25C7 + +L25C5 LDA #$A3 ; # +L25C7 JSR L2486 + LDA #$BF ; ??? + JSR L2486 + JSR L2486 + JSR L2486 + LDA #$1E + STA CH + LDA #$A0 + LDY #$00 +L25DD JSR L2486 + INY + CPY #$08 + BNE L25DD + BEQ L2657 + +* Output BLOCK really + +L25E7 DEC CH + LDA L2484 + BNE L265A + LDA #$A4 ; $ + JSR L2486 + LDA curBLOCK+1 + JSR PRBYTE + LDA curBLOCK + JSR PRBYTE + +* Output + + +L25FF LDA #$1A + STA CH + LDA L2484 + BEQ L260B + JMP L2690 + +L260B LDA #$A4 ; $ + JSR L2486 + LDA L247E + AND #$0F + CLC + ADC #$B0 + JSR L2486 + LDA L247D + JSR PRBYTE +L2621 INC CH + LDA L247F + BEQ L262C + LDA #$4D + BNE L262E +L262C LDA #$A0 +L262E JSR L2486 + LDA #$A0 + JSR L2486 + LDA L2483 + BEQ L264D + LDA #$0D + JSR L2486 + LDA #$0F + JSR L2486 + LDA #$04 + JSR L2486 + JMP L2657 + +L264D LDY #$03 + LDA #$A0 +L2651 JSR L2486 + DEY + BNE L2651 +L2657 JMP restoreXY + +L265A LDA #$A3 + JSR L2486 + LDA curBLOCK + STA L2AE0 + LDA curBLOCK+1 + STA L2AE1 + JSR L26D3 + SEC + LDA #$05 + SBC L26CF + BEQ L267F + TAY +L2677 LDA #$B0 + JSR L2486 + DEY + BNE L2677 +L267F LDY #$00 +L2681 LDA L26C8,Y + JSR L2486 + INY + CPY L26CF + BNE L2681 + JMP L25FF + +* Output + really + +L2690 LDA #$A3 + JSR L2486 + LDA L247D + STA L2AE0 + LDA L247E + AND #$0F + STA L2AE1 + JSR L26D3 + SEC + LDA #$03 + SBC L26CF + BEQ L26B7 + TAY +L26AF LDA #$B0 + JSR L2486 + DEY + BNE L26AF +L26B7 LDY #$00 +L26B9 LDA L26C8,Y + JSR L2486 + INY + CPY L26CF + BNE L26B9 + JMP L2621 + +L26C8 DB $FC + DB $FC + DB $FC + DB $FC + DB $FC +L26CD DB $00 +L26CE DB $00 +L26CF DB $00 +L26D0 DB $00 +L26D1 DB $00 +L26D2 DB $00 + +L26D3 LDA #$00 + STA L26CF + STA L26D1 + LDA #$00 + STA L26D2 +L26E0 LDA #$00 + STA L26D0 +L26E5 LDA L26D2 + ASL + CLC + ADC #$EB + STA L26FE+1 + LDA #$00 + ADC #$29 + STA L26FE+2 + LDX #$00 + SEC + PHP +L26FA LDA L2AE0,X + PLP +L26FE SBC L29EB,X + STA L26CD,X + PHP + INX + CPX #$02 + BNE L26FA + PLP + LDA L26CE + BMI L2723 + INC L26D0 + LDX #$00 +L2715 LDA L26CD,X + STA L2AE0,X + INX + CPX #$02 + BNE L2715 + JMP L26E5 + +L2723 LDA L26D0 + BNE L272D + LDA L26D1 + BEQ L2740 +L272D LDY L26CF + LDA L26D0 + ORA #$B0 + STA L26C8,Y + INC L26CF + LDA #$01 + STA L26D1 +L2740 INC L26D2 + LDA L26D2 + CMP #$05 + BNE L26E0 + LDA L26D1 + BNE L2757 + LDA #$B0 + STA L26C8 + INC L26CF +L2757 RTS + +L2758 CMP #$0A + BCC L275F + CLC + ADC #$07 +L275F ADC #$B0 + JMP L2486 + +L2764 JSR saveXY + LDA $23 + STA L27D2 + LDA #$18 + STA $23 + LDA #$00 + STA CH + LDA #$02 + STA CV + STA $22 + JSR VTAB + JMP L2799 + +L2780 JSR saveXY + LDA $23 + STA L27D2 + LDA #$18 + STA $23 + LDA #$00 + STA CH + LDA #$02 + STA CV + STA $22 + JSR HOME +L2799 LDA L247E + LSR + LDA L247D + ROR + LSR + LSR + SEC + SBC L27D0 + ASL + ASL + ASL + STA $00 + LDA #$00 + ROL + STA $01 + CLC + LDA $01 + ADC #$10 + STA $01 + LDX #$00 + LDY #$00 +L27BC JSR L27D3 + INY + CPY #$B0 + BNE L27BC + LDA L27D2 + STA $23 + LDA #$00 + STA $22 + JMP restoreXY + +L27D0 DB $00 +L27D1 DB $00 +L27D2 DB $00 + +L27D3 CPX #$00 + BNE L27F8 + LDA #$00 + STA CH + TYA + CLC + ADC $00 + STA $04 + LDA $01 + ADC #$00 + SEC + SBC #$10 + BEQ L27EE + LDA #$B1 + BNE L27F0 +L27EE LDA #$B0 +L27F0 JSR L2486 + LDA $04 + JSR PRBYTE +L27F8 TXA + ASL + ADC #$04 + STA CH + LDA CV + STA L27D1 + LDA ($00),Y + PHA + TYA + CLC + ADC $00 + CMP L247D + BNE L285B + LDA L2483 + CMP #$01 + BEQ L281C + LDA #$3F + STA $32 + BNE L285B +L281C LDA L247E + BPL L283E + LDA #$3F + STA $32 + PLA + PHA + AND #$F0 + LSR + LSR + LSR + LSR + JSR L2758 + LDA #$7F + STA $32 + PLA + PHA + AND #$0F + JSR L2758 + JMP L2860 + +L283E LDA #$7F + STA $32 + PLA + PHA + AND #$F0 + LSR + LSR + LSR + LSR + JSR L2758 + LDA #$3F + STA $32 + PLA + PHA + AND #$0F + JSR L2758 + JMP L2860 + +L285B PLA + PHA + JSR PRBYTE +L2860 LDA #$FF + STA $32 + CLC + TXA + ADC #$16 + STA CH + LDA L2483 + CMP #$02 + BNE L2874 + JMP L2897 + +L2874 PLA + ORA #$80 + CMP #$A0 + BCS L287D + ADC #$20 +L287D JSR L2486 + LDA L27D1 + STA CV + JSR VTAB + INX + CPX #$08 + BNE L2896 + LDX #$00 + CPY #$AF + BEQ L2896 + JSR L30BA +L2896 RTS + +L2897 TYA + CLC + ADC $00 + CMP L247D + BNE L2874 + PLA + ORA #$80 + CMP #$A0 + BCS L28A9 + ADC #$20 +L28A9 CMP #$E0 + BCC L28AF + SBC #$20 +L28AF CMP #$C0 + BCC L28B8 + SBC #$80 + JMP L287D + +L28B8 SEC + SBC #$40 + JMP L287D + +L28BE LDA curBLOCK+1 + BMI L28D8 + CMP maxBLOCK+1 + BEQ L28CC + BCC L28D4 + BCS L28D8 +L28CC LDA curBLOCK + CMP maxBLOCK + BCS L28D8 +L28D4 LDA #$27 + BNE L292B +L28D8 JSR saveXY + LDA #$14 + STA CH + LDA #$01 + STA CV + JSR VTAB + JSR BELL + LDY #$00 +L28EB LDA L245F+1,Y + JSR L2486 + INY + CPY L245F + BNE L28EB + JMP restoreXY + +L28FA JSR PRODOS8 ; READ_BLOCK + DB $80 + DA proREADBLK + BEQ L2908 + + CMP #$27 + BEQ L28BE + BNE L292B +L2908 LDA #$00 + STA L247D + STA L247E + STA L27D0 + STA L247F + RTS + +L2917 JSR PRODOS8 ; WRITE_BLOCK + DB $81 + DA proREADBLK + BEQ L2925 + + CMP #$27 + BEQ L28BE + BNE L292B +L2925 LDA #$00 + STA L247F + RTS + +L292B CMP #$27 + BEQ L2962 + CMP #$44 + BEQ L2965 + CMP #$45 + BEQ L2968 + CMP #$46 + BEQ L296B + PHA + JSR saveXY + LDA #$19 + STA CH + LDA #$01 + STA CV + JSR VTAB + JSR BELL + LDY #$00 +L294F LDA L2440+1,Y + JSR L2486 + INY + CPY L2440 + BNE L294F + PLA + JSR PRBYTE + JMP restoreXY +L2962 JMP L2998 +L2965 JMP L29AC +L2968 JMP L29AC +L296B JMP L29AC + +L296E STR "I/O Error" +L2978 STR "Path not found" + +L2987 JSR saveXY + LDA #$01 + STA CV + LDA #$15 + STA CH + JSR VTAB + JMP BELL + +L2998 JSR L2987 + LDY #$00 +L299D LDA L296E+1,Y + JSR L2486 + INY + CPY L296E + BNE L299D + JMP restoreXY + +L29AC JSR L2987 + LDY #$00 +L29B1 LDA L2978+1,Y + JSR L2486 + INY + CPY L2978 + BNE L29B1 + JMP restoreXY + +L29C0 LDX #$00 +L29C2 LDA L0200,X + CMP #$20 + BEQ L29D0 + INX + CPX L2485 + BNE L29C2 + RTS + +L29D0 TXA + PHA + CLC + ADC #$01 + TAY +L29D6 LDA L0200,Y + STA L0200,X + INX + INY + CPX L2485 + BNE L29D6 + DEC L2485 + PLA + TAX + JMP L29C2 + +L29EB DB $10 + DB $27 + DB $E8 + DB $03 + DB $64 + DB $00 + DB $0A + DB $00 + DB $01 + DB $00 +L29F5 DB $00 +L29F6 DB $00 +L29F7 DB $00 + +L29F8 LDA #$01 + STA L2484 + LDA L2485 + SEC + SBC #$01 + STA L29F6 + LDA #$00 + STA L29F5 +L2A0B LDY L29F6 + LDA L0200,Y + CMP #$30 + BCC L2A62 + CMP #$3A + BCS L2A62 + AND #$0F +L2A1B BEQ L2A54 + STA L29F7 + SEC + LDA #$04 + SBC L29F5 + ASL + CLC + ADC #$EB + STA L2A3C+1 + LDA #$29 + ADC #$00 + STA L2A3C+2 + LDX #$00 + CLC + PHP +L2A38 LDA L2AE0,X + PLP +L2A3C ADC L29EB,X + STA L2AE0,X + PHP + INX + CPX #$02 + BNE L2A38 + PLP + BCS L2A62 + DEC L29F7 + LDA L29F7 + JMP L2A1B + +L2A54 INC L29F5 + DEC L29F6 + LDA L29F6 + BNE L2A0B + JMP L2B7C + +L2A62 PLA + PLA + JSR saveXY + LDA #$14 + STA CH + LDA #$01 + STA CV + JSR VTAB + JSR BELL + LDY #$00 +L2A77 LDA L2AA6+1,Y + JSR L2486 + INY + CPY L2AA6 + BNE L2A77 + JSR restoreXY + JMP L2C5F + +L2A89 LDX #$01 + LDA L2485 + CMP #$08 + BCC L2AE2 + PLA + PLA + JMP jQUIT + +L2A97 STR "Hex # expected" +L2AA6 STR "Decimal # expected" + +L2AB9 PLA + PLA + JSR saveXY + LDA #$14 + STA CH + LDA #$01 + STA CV + JSR VTAB + LDY #$00 +L2ACB LDA L2A97+1,Y + JSR L2486 + INY + CPY L2A97 + BNE L2ACB + JSR BELL + JSR restoreXY + JMP L2C5F + +L2AE0 DB $00 +L2AE1 DB $00 + +L2AE2 LDA #$00 + STA L2AE0 + STA L2AE1 + LDA L0200,X + CMP #$24 + BEQ L2B14 + CMP #$23 + BEQ L2AFD + LDA L2484 + BEQ L2B1A + JMP L29F8 + +L2AFD LDY #$02 + LDX #$01 +L2B01 LDA L0200,Y + STA L0200,X + INX + INY + CPX L2485 + BNE L2B01 + DEC L2485 + JMP L29F8 + +L2B14 INX + LDA #$00 + STA L2484 +L2B1A LDA L0200,X + CMP #$30 + BCC L2AB9 + CMP #$3A + BCC L2B30 + CMP #$41 + BCC L2AB9 + CMP #$47 + BCS L2AB9 + SEC + SBC #$07 +L2B30 SEC + SBC #$30 + PHA + TXA + STA $04 + SEC + LDA L2485 + SBC $04 + CMP #$04 + BEQ L2B6B + CMP #$03 + BEQ L2B61 + CMP #$02 + BEQ L2B53 + PLA + ORA L2AE0 + STA L2AE0 + JMP L2B76 + +L2B53 PLA + ASL + ASL + ASL + ASL + ORA L2AE0 + STA L2AE0 + JMP L2B76 + +L2B61 PLA + ORA L2AE1 + STA L2AE1 + JMP L2B76 + +L2B6B PLA + ASL + ASL + ASL + ASL + ORA L2AE1 + STA L2AE1 +L2B76 INX + CPX L2485 + BNE L2B1A +L2B7C RTS + +L2B7D STR "(C) 1984 Gary W. Charpentier." + +L2B9B JSR HOME + LDY #$00 +L2BA0 LDA L21EA+1,Y + JSR L2486 + INY + CPY L21EA + BNE L2BA0 + JSR L30BA + LDA #$16 + STA CV + JSR VTAB + LDY #$00 +L2BB8 LDA L2B7D+1,Y + JSR L2486 + INY + CPY L2B7D + BNE L2BB8 + JSR L30BA + LDA #$01 + STA CV + JSR VTAB + LDA #$00 + STA L2483 + STA L2484 + LDA #$60 + STA proREADBLK+1 + LDA #$18 ; $118 blocks + STA maxBLOCK ; is a 5.25" + LDA #$01 ; floppy + STA maxBLOCK+1 ; disk + + JSR PRODOS8 ; GET_PREFIX + DB $C7 + DA proGETPFX + + LDA L1400 + BEQ L2C4E + LDA #$00 + STA proONLINE+1 + + JSR PRODOS8 ; ONLINE + DB $C5 + DA proONLINE + + LDY #$00 +L2BFD LDA L1500,Y + BEQ L2C4E + AND #$0F + BNE L2C0D +L2C06 CLC + TYA + ADC #$10 + TAY + BNE L2BFD +L2C0D LDX #$02 + STY $04 +L2C11 INY + LDA L1400,X + CMP #$2F + BEQ L2C26 + CMP L1500,Y + BNE L2C21 + INX + BNE L2C11 +L2C21 LDY $04 + JMP L2C06 + +L2C26 LDY $04 + LDA L1500,Y + AND #$F0 + STA proREADBLK+1 + LDA #$02 + STA curBLOCK + LDA #$00 + STA curBLOCK+1 + + JSR PRODOS8 ; READ_BLOCK + DB $80 + DA proREADBLK + BNE L2C4E + + LDA L1000+$29 + STA maxBLOCK + LDA L1000+$2A + STA maxBLOCK+1 +L2C4E LDA #$FF + STA curBLOCK + STA curBLOCK+1 + LDA #$00 + STA L2482 + LDA #$BA + STA $33 +L2C5F JSR L2539 + LDA #$00 + STA CH + LDA #$01 + STA CV + JSR VTAB + LDA curBLOCK + CMP #$FF + BNE L2CA0 + LDA curBLOCK+1 + CMP #$FF + BNE L2CA0 + JSR displayHELP + JSR saveXY + LDA #$00 + STA CH + LDA #$16 + STA CV + JSR VTAB + LDY #$00 +L2C8E LDA L2B7D+1,Y + JSR L2486 + INY + CPY L2B7D + BNE L2C8E + JSR restoreXY + JMP L2CA3 + +L2CA0 JSR L2780 +L2CA3 LDA #$01 + STA $22 + LDA #$03 + STA $23 + JSR L304E + LDA #$00 + STA $22 + LDA #$18 + STA $23 + CPX #$00 ; length is null + BEQ L2C5F + STX L2485 ; store length + LDX #$00 ; make it lowe case +L2CBF LDA L0200,X + AND #$7F + CMP #$60 + BCC L2CCF + CMP #$7B + BCS L2CCF + SEC + SBC #$20 +L2CCF STA L0200,X + INX + CPX L2485 + BNE L2CBF + JSR L29C0 + LDA L2485 + BNE L2CE3 + JMP L2C5F + +L2CE3 LDA L0200 + CMP #$52 ; R + BEQ jREAD + CMP #$2B ; + + BEQ jPLUS + PHA + LDA MACHID + AND #$C0 + CMP #$80 + BEQ L2D03 + PLA + CMP #$3B ; ; + BEQ jPLUS + CMP #$3D ; = + BEQ jMINUS + BNE L2D0C +L2D03 PLA + CMP #$3D ; = + BEQ jPLUS + CMP #$5F ; + BEQ jMINUS +L2D0C CMP #$2D ; - + BEQ jMINUS + CMP #$57 ; W + BEQ jWRITE + CMP #$4D ; M + BEQ jMODIFY + CMP #$41 ; A + BEQ jALTER + CMP #$53 ; S + BEQ jSLOT + CMP #$3F ; ? + BEQ jHELP + CMP #$48 ; H + BEQ jHELP + CMP #$2F ; / + BEQ jHELP + CMP #$51 ; Q + BNE jQUIT + JMP L2D73 + +jHELP JSR doHELP + JMP L2C5F +jWRITE JMP doWRITE +jMINUS JMP doMINUS +jPLUS JMP doPLUS +jREAD JMP doREAD +jSLOT JMP doSLOT +jMODIFY JMP doMODIFY +jALTER JMP doALTER + +jQUIT JSR saveXY + LDA #$01 + STA CV + LDA #$14 + STA CH + JSR VTAB + JSR BELL + LDY #$00 +L2D61 LDA L244D+1,Y + JSR L2486 + INY + CPY L244D + BNE L2D61 + JSR restoreXY + JMP L2C5F + +L2D73 LDA L2485 + CMP #$01 + BNE L2D91 + LDY #$00 +L2D7C LDA L21CB,Y + STA L0280,Y + INY + CPY L21CB + BNE L2D7C + LDA L21CB,Y + STA L0280,Y + JMP L2085 + +L2D91 LDY #$00 + SEC + SBC #$01 + STA L0280,Y + INY +L2D9A LDA L0200,Y + STA L0280,Y + INY + CPY L2485 + BNE L2D9A + JMP L2085 + +*---------------------------- +* R - READ BLOCK +*---------------------------- + +doREAD LDA L2485 + CMP #$01 + BEQ L2DBF + JSR L2A89 + LDA L2AE0 + STA curBLOCK + LDA L2AE1 + STA curBLOCK+1 +L2DBF JSR L2E46 + JSR L28FA + JMP L2C5F + +*---------------------------- +* W - WRITE BLOCK +*---------------------------- + +doWRITE JSR L2E46 + LDA L2485 + CMP #$01 + BEQ L2DE1 + JSR L2A89 + LDA L2AE0 + STA curBLOCK + LDA L2AE1 + STA curBLOCK+1 +L2DE1 JSR L2E46 + JSR L2917 + JMP L2C5F + +*---------------------------- +* + - READS NEXT BLOCK +*---------------------------- + +doPLUS JSR L2E46 + CLC + LDA curBLOCK + ADC #$01 + STA curBLOCK + LDA curBLOCK+1 + ADC #$00 + STA curBLOCK+1 + LDA curBLOCK + CMP maxBLOCK + BNE L2E16 + LDA curBLOCK+1 + CMP maxBLOCK+1 + BNE L2E16 + LDA #$00 + STA curBLOCK + STA curBLOCK+1 +L2E16 JMP L2DBF + +*---------------------------- +* - - READS PREVIOUS BLOCK +*---------------------------- + +doMINUS JSR L2E46 + LDA curBLOCK + BNE L2E32 + LDA curBLOCK+1 + BNE L2E32 + LDA maxBLOCK + STA curBLOCK + LDA maxBLOCK+1 + STA curBLOCK+1 +L2E32 SEC + LDA curBLOCK + SBC #$01 + STA curBLOCK + LDA curBLOCK+1 + SBC #$00 + STA curBLOCK+1 + JMP L2DBF + +L2E46 LDA curBLOCK + CMP #$FF + BNE L2E78 + LDA curBLOCK+1 + CMP #$FF + BNE L2E78 + PLA + PLA + JSR saveXY + LDA #$14 + STA CH + LDA #$01 + STA CV + JSR VTAB + JSR BELL + LDY #$00 +L2E69 LDA L245F+1,Y + JSR L2486 + INY + CPY L245F + BNE L2E69 + JMP L2C5F +L2E78 RTS + +L2E79 STR "Slot 1 to 7 only" +L2E8A STR "Drive 1 or 2 only" + +L2E9C JSR saveXY + LDA #$01 + STA CV + LDA #$14 + STA CH + JSR VTAB + JSR BELL + LDY #$00 +L2EAF LDA L2E79+1,Y + JSR L2486 + INY + CPY L2E79 + BNE L2EAF + JSR restoreXY + JMP L2C5F + +L2EC1 JSR saveXY + LDA #$01 + STA CV + LDA #$14 + STA CH + JSR VTAB + JSR BELL + LDY #$00 +L2ED4 LDA L2E8A+1,Y + JSR L2486 + INY + CPY L2E8A + BNE L2ED4 + JSR restoreXY + JMP L2C5F + +*---------------------------- +* S - SET SLOT AND DRIVE +*---------------------------- + +doSLOT LDY #$01 + LDA L0200,Y + CMP #$2F ; / + BNE L2EF2 + JMP L2FAC + +L2EF2 LDA L2485 + CMP #$04 + BEQ L2EFC + JMP jQUIT + +L2EFC LDY #$01 + LDA L0200,Y + CMP #$31 ; 1 + BCS L2F08 + JMP L2E9C + +L2F08 CMP #$38 ; 8 + BCC L2F0F + JMP L2E9C + +L2F0F SEC ; MAKE SLOT + SBC #$30 + ASL + ASL + ASL + ASL + STA $04 + + INY ; CHECK COMMA + LDA L0200,Y + CMP #$2C ; , + BEQ L2F23 + JMP jQUIT + +L2F23 INY + LDA L0200,Y + CMP #$31 ; 1 + BCS L2F2E + JMP L2EC1 + +L2F2E CMP #$33 ; 3 + BCC L2F35 + JMP L2EC1 + +L2F35 CMP #$31 ; MAKE DRIVE + BEQ L2F3D + LDA #$80 + BNE L2F3F +L2F3D LDA #$00 +L2F3F ORA $04 + STA proONLINE+1 + + JSR PRODOS8 ; ONLINE + DB $C5 + DA proONLINE + + LDA L1500 + AND #$0F + BNE L2F7B + + LDA L1500+1 + CMP #$28 + BEQ L2F62 + CMP #$52 + BEQ L2F65 + JSR L292B + JMP L2C5F +L2F62 JMP L3029 + +L2F65 LDA proONLINE+1 + STA proREADBLK+1 + LDA #$01 + STA L2482 + LDA #$FF + STA curBLOCK + STA curBLOCK+1 + JMP L2C5F + +L2F7B LDA proONLINE+1 + STA proREADBLK+1 +L2F81 LDA #$18 + STA maxBLOCK + LDA #$01 + STA maxBLOCK+1 + LDA #$02 + STA curBLOCK + LDA #$00 + STA curBLOCK+1 + JSR L28FA + LDA #$00 + STA L2482 + LDA L1000+$29 + STA maxBLOCK + LDA L1000+$2A + STA maxBLOCK+1 + JMP L2C5F + +L2FAC LDA #$00 + STA proONLINE+1 + + JSR PRODOS8 ; ONLINE + DB $C5 + DA proONLINE + + LDY #$00 +L2FB9 LDA L1500,Y + BEQ L2FF3 + AND #$0F + BNE L2FC9 +L2FC2 CLC + TYA + ADC #$10 + TAY + BNE L2FB9 +L2FC9 LDX #$02 + STY $04 +L2FCD INY + LDA L0200,X + CMP #$2F + BEQ L2FE6 + CMP #$8D + BEQ L2FE6 + CMP L1500,Y + BNE L2FE1 + INX + BNE L2FCD +L2FE1 LDY $04 + JMP L2FC2 + +L2FE6 LDY $04 + LDA L1500,Y + AND #$F0 + STA proREADBLK+1 + JMP L2F81 + +L2FF3 JSR saveXY + LDA #$17 + STA CH + LDA #$01 + STA $25 + JSR VTAB + JSR BELL + LDY #$00 +L3006 LDA L2978+1,Y + JSR L2486 + INY + CPY L2978 + BNE L3006 + JSR restoreXY + JMP L2C5F + +L3018 STR "Not a disk drive" + +L3029 JSR saveXY + LDA #$18 + STA CH + LDA #$01 + STA $25 + JSR VTAB + JSR BELL + LDY #$00 +L303C LDA L3018+1,Y + JSR L2486 + INY + CPY L3018 + BNE L303C + JSR restoreXY + JMP L2C5F + +L304E LDA curBLOCK + CMP #$FF + BNE L3092 + LDA curBLOCK+1 + CMP #$FF + BNE L3092 + JMP GETLN + +L305F LDA $32 + PHA + LDA #$FF + STA $32 + LDA L0200,X + JSR COUT + PLA + STA $32 + LDA L0200,X + CMP #$88 + BEQ L3099 + CMP #$98 + BEQ L3084 + CPX #$F8 + BCC L3081 + JSR BELL +L3081 INX + BNE L309D +L3084 LDA #$01 + STA $25 + LDA #$00 + STA CH + JSR VTAB +L308F JSR CLREOL +L3092 LDA $33 + JSR L2486 +L3097 LDX #$01 +L3099 TXA + BEQ L308F + DEX +L309D JSR RDKEY + CPX #$00 + BEQ L30BF +L30A4 CMP #$95 + BNE L30AA + LDA ($28),Y +L30AA CMP #$E0 + BCC L30B0 + AND #$FF +L30B0 STA L0200,X + CMP #$8D + BNE L305F + JSR CLREOL +L30BA LDA #$8D + JMP COUT + +L30BF PHA + CMP #$AB + BEQ L3108 + LDA MACHID + AND #$C0 + CMP #$80 + BEQ L30D9 + PLA + PHA + CMP #$BB + BEQ L3108 + CMP #$BD + BEQ L310E + BNE L30E3 +L30D9 PLA + PHA + CMP #$BD + BEQ L3108 + CMP #$DF + BEQ L310E +L30E3 CMP #$AD + BEQ L310E + CMP #$E1 + BCC L30F1 + CMP #$FB + BCS L30F1 + AND #$DF +L30F1 CMP #$AF + BEQ L3101 + CMP #$BF + BEQ L3101 + CMP #$C8 + BEQ L3101 + PLA + JMP L30A4 + +L3101 PLA + JSR doHELP + JMP L3097 + +L3108 JSR CLREOL + JMP doPLUS + +L310E JSR CLREOL + JMP doMINUS + +L3114 PLA + LDA L247E + BMI L3122 + ORA #$80 + STA L247E + JMP L31E2 + +L3122 AND #$7F + STA L247E + CLC + LDA L247D + ADC #$01 + STA L247D + LDA L247E + ADC #$00 + STA L247E + AND #$0F + CMP #$02 + BCS L3152 + LDA L247D + AND #$07 + BNE L314F + LDA L27D0 + CMP #$15 + BEQ L314F + INC L27D0 +L314F JMP L31E2 + +L3152 LDA #$FF + STA L247D + LDA #$81 + STA L247E + JSR BELL + JMP L31E2 + +L3162 PLA + LDA L247E + BPL L3170 + AND #$7F + STA L247E + JMP L31E2 + +L3170 SEC + LDA L247D + SBC #$01 + STA L247D + LDA L247E + SBC #$00 + STA L247E + BCS L3191 + LDA #$00 + STA L247D + STA L247E + JSR BELL + JMP L31E2 + +L3191 LDA L247E + ORA #$80 + STA L247E + LDA L247D + AND #$07 + CMP #$07 + BNE L31AA + LDA L27D0 + BEQ L31AA + DEC L27D0 +L31AA JMP L31E2 + +L31AD PLA + LDA L27D0 + CMP #$15 + BEQ L31B8 + INC L27D0 +L31B8 LDA L247D + CLC + ADC #$08 + STA L247D + LDA L247E + ADC #$00 + STA L247E + AND #$7F + CMP #$02 + BCC L31E2 + LDA L247D + SBC #$08 + STA L247D + LDA L247E + SBC #$00 + STA L247E + JSR BELL +L31E2 JSR L2539 + JSR CLREOL + JSR L2764 + JMP L32EC + +L31EE PLA + LDA L27D0 + BEQ L31F7 + DEC L27D0 +L31F7 LDA L247D + SEC + SBC #$08 + STA L247D + LDA L247E + SBC #$00 + STA L247E + AND #$7F + CMP #$7F + BEQ L3211 + JMP L31E2 + +L3211 LDA L247D + CLC + ADC #$08 + STA L247D + LDA L247E + ADC #$00 + STA L247E + JSR BELL + JMP L31E2 + +L3228 STR "Offset too big" + +*---------------------------- +* M - MODIFY COMMAND +*---------------------------- + +doMODIFY LDA curBLOCK + CMP #$FF + BNE L3271 + LDA curBLOCK+1 + CMP #$FF + BNE L3271 + JSR BELL +L3248 LDA #$01 + STA $25 + LDA #$19 + STA CH + JSR VTAB + LDY #$00 +L3255 LDA L3264+1,Y + JSR L2486 + INY + CPY L3264 + BNE L3255 + JMP L2C5F + +L3264 STR "No block yet" + +L3271 LDA L2485 + CMP #$01 + BNE L327E + STA L2483 + JMP L32E9 + +L327E JSR L2A89 + LDA L2AE1 + CMP #$02 + BCC L32A7 +L3288 LDA #$01 + STA $25 + LDA #$19 + STA CH + JSR VTAB + LDY #$00 +L3295 LDA L3228+1,Y + JSR L2486 + INY + CPY L3228 + BNE L3295 + JSR BELL + JMP L2C5F + +L32A7 LDA L2AE0 + STA L247D + LDA L2AE1 + STA L247E + LDA #$01 + STA L2483 + LDA #$0A + STA L27D0 + LDA L247E + BEQ L32DC + LDA L247D + CMP #$A8 + BCC L32E9 + LDA L247E + LSR + LDA L247D + ROR + LSR + LSR + SEC + SBC #$2A + STA L27D0 + JMP L32E9 + +L32DC LDA L247D + CMP #$50 + BCS L32E9 + LSR + LSR + LSR + STA L27D0 +L32E9 JSR L2764 +L32EC JSR L2539 + LDA #$01 + STA CH + STA $25 + JSR VTAB + JSR RDKEY + CMP #$8D + BEQ L3347 + CMP #$95 + BEQ L334F + CMP #$88 + BEQ L3352 + CMP #$8B + BEQ L3355 + CMP #$8A + BEQ L3358 + CMP #$AF + BEQ L3341 + CMP #$BF + BEQ L3341 + CMP #$C8 ; H + BEQ L3341 + CMP #$B0 ; 0 + BCC L333B + CMP #$BA ; 9+1 + BCC L335E + CMP #$C1 ; A + BCC L333B + CMP #$C7 ; G + BCC L335B + CMP #$C9 ; I + BEQ L3355 + CMP #$CA ; J + BEQ L3352 + CMP #$CB ; K + BEQ L334F + CMP #$CD ; M + BEQ L3358 +L333B JSR BELL + JMP L32EC + +L3341 JSR doHELP + JMP L32EC + +L3347 LDA #$00 + STA L2483 + JMP L2C5F +L334F JMP L3114 +L3352 JMP L3162 +L3355 JMP L31EE +L3358 JMP L31AD + +L335B SEC + SBC #$07 +L335E AND #$0F + STA $04 + PLA + LDA L247E + BMI L3370 + LDA $04 + ASL + ASL + ASL + ASL + STA $04 +L3370 LDA L247E + AND #$0F + BEQ L3394 + LDY L247D + LDA L1100,Y + PHA + LDA L247E + BMI L3389 + PLA + AND #$0F + JMP L338C + +L3389 PLA + AND #$F0 +L338C ORA $04 + STA L1100,Y + JMP L33AE + +L3394 LDY L247D + LDA L1000,Y + PHA + LDA L247E + BMI L33A6 + PLA + AND #$0F + JMP L33A9 + +L33A6 PLA + AND #$F0 +L33A9 ORA $04 + STA L1000,Y +L33AE LDA #$01 + STA L247F + PHA + JMP L3114 + +*---------------------------- +* A - ALTER MEMORY +*---------------------------- + +doALTER LDA curBLOCK + CMP #$FF + BNE L33C8 + LDA curBLOCK+1 + CMP #$FF + BNE L33C8 + JMP L3248 + +L33C8 LDA L2485 + CMP #$01 + BNE L33D7 + LDA #$02 + STA L2483 + JMP L3426 + +L33D7 JSR L2A89 + LDA L2AE1 + CMP #$02 + BCC L33E4 + JMP L3288 + +L33E4 LDA L2AE0 + STA L247D + LDA L2AE1 + STA L247E + LDA #$02 + STA L2483 + LDA #$0A + STA L27D0 + LDA L247E + BEQ L3419 + LDA L247D + CMP #$A8 + BCC L3426 + LDA L247E + LSR + LDA L247D + ROR + LSR + LSR + SEC + SBC #$2A + STA L27D0 + JMP L3426 + +L3419 LDA L247D + CMP #$50 + BCS L3426 + LSR + LSR + LSR + STA L27D0 +L3426 JSR L2764 +L3429 JSR L2539 + LDA #$01 + STA CH + STA $25 + JSR VTAB + JSR RDKEY + CMP #$8D + BNE L343F + JMP L3347 + +L343F AND #$7F + PHA + LDY L247D + LDA L247E + AND #$0F + BEQ L3453 + PLA + STA L1100,Y + JMP L3457 + +L3453 PLA + STA L1000,Y +L3457 LDA #$01 + STA L247F + LDA L247E + AND #$7F + STA L247E + CLC + LDA L247D + ADC #$01 + STA L247D + LDA L247E + ADC #$00 + STA L247E + AND #$0F + CMP #$02 + BCS L348F + LDA L247D + AND #$07 + BNE L349C + LDA L27D0 + CMP #$15 + BEQ L349C + INC L27D0 + JMP L349C + +L348F LDA #$FF + STA L247D + LDA #$81 + STA L247E + JSR BELL +L349C JSR L2539 + JSR CLREOL + JSR L2764 + JMP L3429 + +THEEND = *