10 ;COM-DOS By Robert Berry 20 ;Replacement Disk Utilities 30 ;Package 40 ; 50 ;Created using MAC/65 Macros 60 ; and another one, POKE. 70 .INCLUDE #D:SYSEQU.M65 80 LBUFF = $0580 90 PTR = $CB 0100 AFP = $D800 0110 FSUB = $DA60 0120 FPI = $D9D2 0130 FR0 = $D4 0140 FR1 = $E0 0150 INBUFF = $F3 0160 CIX = $F2 0170 IFP = $D9AA 0180 FASC = $D8E6 0190 FMOVE = $DDB6 0200 TRAMSZ = $08 0210 RESETV = $E474 0220 REBOOT = $E477 0230 RAMTOP = $6A 0240 DOSLOAD = $15C8 0250 LOLEN = $CB 0260 HILEN = $CC 0270 DRVBYT = $070A 0280 WVERIFY = $0779 0290 SABYTE = $0709 0300 POKMSK = $10 0310 IRQEN = $D20E 0320 CONSOL = $D01F 0330 CDTMV2 = $021A 0340 CDTMA2 = $0228 0350 CHACT = $02F3 0360 NOCLIK = $02DB 0370 COLOR1 = $02C5 0380 COLOR2 = $02C6 0390 FINE = $026E 0400 LOBYTE = $CD 0410 HIBYTE = $CE 0420 *= $1CFC 0430 CBUFF 0440 *= *+15 0450 N1BUFF 0460 *= *+7 0470 N2BUFF 0480 *= *+7 0490 DRNUM 0500 *= *+1 0510 BUFF2 0520 .BYTE "1 " 0530 INIDAT ; Run address data 0540 .BYTE 224,2,225,2 0550 RUNDAT 0560 .BYTE 0,0 0570 NNN 0580 .BYTE 255,255 0590 PROG 0600 .BYTE 255,255,128,6,188,6 0610 .BYTE 169,2,133,84,162,0 0620 .BYTE 169,9,157,66,3,169 0630 .BYTE 170,157,68,3,169,6 0640 .BYTE 157,69,3,169,1,157 0650 .BYTE 72,3,157,73,3,32 0660 .BYTE 86,228,169,0,133,84 0670 .BYTE 169,12,141,252,2,96 0680 .BYTE 82,85,78,34,68,58 0690 FILEDAT 0700 .BYTE 0,0,0,0,0,0 0710 .BYTE 0,0,46,0,0,0 0720 .BYTE 155,224,2,225,2,128,6 0730 HEX 0740 .BYTE 0,1,2,3,4,5,6,7,8,9,0 0741 .BYTE 0,0,0,0,0,0,10,11,12 0742 .BYTE 13,14,15 0750 CHECK 0760 LDY #0 0770 LDX #0 0780 CMPLOOP 0790 LDA TAB,Y 0800 CMP #EOL ;End of command? 0810 BEQ GOTCOM ;Yes! 0820 CMP LBUFF,X ;No, compare next 0830 BNE FINDEND ;branch FINDEND 0840 INX 0850 INY 0860 JMP CMPLOOP 0870 ; 0880 ;Commands are not the same so 0881 ; far, so we must move to next 0882 ; command. 0890 ; 0900 FINDEND 0910 INY 0920 LDA TAB,Y 0930 CMP #EOL ;End of next command? 0940 BNE FINDEND ;No, do it again 0950 INY ;Skip over 0960 INY 0970 INY 0980 LDA TAB,Y 0990 CMP #255 ;End reached? 1000 BEQ ENDTAB 1010 ; 1020 ;Not end of table, so reset X-reg 1021 ;and jump back to CMPLOOP 1030 ; 1040 LDX #0 1050 JMP CMPLOOP 1060 ENDTAB 1070 PRINT 0,"$)Command not supported!" 1080 JMP MAINLOOP 1090 GOTCOM 1100 ; 1110 ;Goes here if a command is found. 1120 ; 1130 LDA TAB+1,Y 1140 STA PTR 1150 LDA TAB+2,Y 1160 STA PTR+1 1170 JMP (PTR) 1180 ; 1190 ;This is the command table. The 1200 ;format is: 1210 ;.BYTE "COMMAND",EOL 1220 ;.WORD COMMAND 1230 ; 1240 ;A 255 should be placed at the 1250 ;end of the table. 1260 ; 1270 TAB 1280 .BYTE "FORMAT",EOL 1290 .WORD FORMAT 1300 .BYTE "LOCK",EOL 1310 .WORD LOCK 1320 .BYTE "UNLOCK",EOL 1330 .WORD UNLOCK 1340 .BYTE "DELETE",EOL 1350 .WORD DELETE 1360 .BYTE "RENAME",EOL 1370 .WORD RENAME 1380 .BYTE "DIR",EOL 1390 .WORD DIR 1400 .BYTE "BASIC",EOL 1410 .WORD BASIC 1420 .BYTE "REBOOT",EOL 1430 .WORD REBOOT 1440 .BYTE "BLOAD",EOL 1450 .WORD BLOAD 1460 .BYTE "COPY",EOL 1470 .WORD COPY 1480 .BYTE "DUP",EOL 1490 .WORD DUPLICATE 1500 .BYTE "WDOS",EOL 1510 .WORD WDOS 1520 .BYTE "WMEM",EOL 1530 .WORD WMEM 1540 .BYTE "BSAVE",EOL 1550 .WORD BSAVE 1560 .BYTE "BOOT",EOL 1570 .WORD BOOT 1580 .BYTE "HELP",EOL 1590 .WORD HELP 1600 .BYTE "GO",EOL 1610 .WORD GO 1620 .BYTE "STATUS",EOL 1630 .WORD STATUS 1640 .BYTE "CLICK",EOL 1650 .WORD CLICK 1660 .BYTE "?",EOL 1670 .WORD HEXDEC 1680 .BYTE 255 ;End of table 1690 FMTFILE 1700 .BYTE "D1:",EOL 1710 DIRFILE 1720 .BYTE "D1:*.*",EOL 1730 DIRMSG 1740 .BYTE "Directory - Drive #1" 1741 .BYTE EOL 1750 DOSSYS 1760 .BYTE "D1:DOS.SYS",EOL 1770 MEMSAV 1780 .BYTE "D1:MEM.SAV",EOL 1790 WVERMSG 1800 .BYTE "Write Verify: " 1810 DRIVEMSG 1820 .BYTE "Active Drives: " 1830 MAXFILES 1840 .BYTE "Maximum # of files th" 1841 .BYTE "at can be open simu" 1842 .BYTE "ltaneously: " 1850 FORMAT 1860 LDA LBUFF+6 1870 CMP #'8 1880 BNE OKFMT 1890 PRINT 0,"Can't format drive 8 from COM-DOS!" 1900 JMP MAINLOOP 1910 OKFMT 1920 STA FMTFILE+1 1930 XIO 254,1,0,0,FMTFILE 1940 CPY #1 1950 BNE FMTERR 1960 JMP MAINLOOP 1970 FMTERR 1980 JMP ERROR 1990 LOCK 2000 XIO 35,1,0,0,LBUFF+5 2010 CPY #1 2020 BNE LCKERR 2030 JMP MAINLOOP 2040 LCKERR 2050 JMP ERROR 2060 UNLOCK 2070 XIO 36,1,0,0,LBUFF+7 2080 CPY #1 2090 BNE UNLERR 2100 JMP MAINLOOP 2110 UNLERR 2120 JMP ERROR 2130 DELETE 2140 XIO 33,1,0,0,LBUFF+7 2150 CPY #1 2160 BNE DELERR 2170 JMP MAINLOOP 2180 DELERR 2190 JMP ERROR 2200 RENAME 2210 XIO 32,1,0,0,LBUFF+7 2220 CPY #1 2230 BNE RENERR 2240 JMP MAINLOOP 2250 RENERR 2260 JMP ERROR 2270 DIR 2280 LDA LBUFF+3 2290 CMP #EOL 2300 BEQ GETDIR 2310 STA DIRFILE+1 2320 STA DIRMSG+19 2330 GETDIR 2340 OPEN 1,6,0,DIRFILE 2350 CPY #1 2360 BEQ SDIRLOOP 2370 JMP ERROR 2380 SDIRLOOP 2390 PRINT 0,DIRMSG 2400 DIRLOOP 2410 INPUT 1,LBUFF 2420 CPY #136 2430 BEQ DIRDONE 2440 CPY #1 2450 BEQ PRINTIT 2460 JMP ERROR 2470 PRINTIT 2480 PRINT 0,LBUFF 2490 JMP DIRLOOP 2500 DIRDONE 2510 CLOSE 1 2520 JMP MAINLOOP 2530 ERROR 2540 STY FR0 ;Store error 2550 ;Now close IOCB's 1 & 2 2560 CLOSE 1 2570 CLOSE 2 2580 LDA #0 ;Clear hi byte 2590 STA FR0+1 2600 JSR IFP 2610 ; 2620 ;Error code now in FP format, 2630 ;stored at FR0. 2640 ; 2650 JSR FASC 2660 ; 2670 ;Error code now in ATASCII format 2680 ;in LBUFF. 2690 ; 2700 ;Now find end of string, add 2710 ;carriage return. 2720 ; 2730 LDY #$FF 2740 ELOOP 2750 INY 2760 LDA LBUFF,Y 2770 BPL ELOOP 2780 AND #$7F ;Un-invert char. 2790 STA LBUFF,Y 2800 LDA #EOL 2810 STA LBUFF+1,Y ;Store EOL 2820 ; 2830 ;Now in ATASCII format in LBUFF 2840 ;with EOL at end of it. 2850 ; 2860 BPUT 0,ERRMSG,12 2870 PRINT 0,LBUFF 2880 JMP MAINLOOP 2890 ; 2900 ; 2910 ; 2920 ERRMSG 2930 .BYTE "I/O Error - " 2940 ; 2950 ; 2960 ; 2970 MAINLOOP 2980 LDA #202 2990 STA COLOR1 3000 LDA #240 3010 STA COLOR2 3020 BPUT 0,EMSG,16 3030 POKE 764,255 3040 INPUT 0,LBUFF 3050 JMP CHECK 3060 EMSG 3070 .BYTE EOL,"Enter command:" 3071 .BYTE EOL 3080 ; 3090 ; 3100 ; 3110 BEGIN 3120 LDA #255 3130 STA FINE 3135 ; Do I/O to enable fine scrolling 3140 OPEN 6,8,0,"E:" 3150 PRINT 0,"$)COM-DOS Ver. 3.1 02/06/86" 3160 LDA POKMSK 3170 AND #$7F 3180 STA POKMSK 3190 STA IRQEN 3200 LDA # VBROUT 3230 STA CDTMA2+1 3240 LDA #10 3250 STA CDTMV2 3260 JMP MAINLOOP 3270 VBROUT 3280 LDA CHACT 3290 EOR #$03 3300 STA CHACT 3310 LDA #10 3320 STA CDTMV2 3330 RTS 3340 ; 3350 ; 3360 ; 3370 BASIC 3380 LDA TRAMSZ 3390 BEQ NOBAS 3400 JMP RESETV 3410 NOBAS 3420 PRINT 0,"$)No Cartridge!" 3430 JMP MAINLOOP 3440 BLOAD 3450 OPEN 1,4,0,LBUFF+6 3460 JSR DOSLOAD 3470 JMP MAINLOOP 3480 ; 3490 ; 3500 COPY 3510 ;Format: COPY D1:file,D2:FILE2 3520 LDY #7 3530 CLOOP 3540 LDA LBUFF,Y 3550 CMP #', 3560 BEQ FNDCOMMA 3570 INY 3580 JMP CLOOP 3590 FNDCOMMA 3600 LDA #EOL 3610 STA LBUFF,Y 3620 INY 3630 LDX #0 3640 CLOOP2 3650 LDA LBUFF,Y 3660 STA CBUFF,X 3670 CMP #EOL 3680 BEQ MOVEDONE 3690 INY 3700 INX 3710 JMP CLOOP2 3720 MOVEDONE 3730 OPEN 1,4,0,LBUFF+5 3740 CPY #1 3750 BEQ FRSTOK 3760 JMP ERROR 3770 FRSTOK 3780 LDY #$FF 3790 SLLOOP 3800 INY 3810 LDA CBUFF,Y 3820 CMP #'/ ;Append? 3830 BEQ APPENDIT 3840 CMP #EOL 3850 BNE SLLOOP 3860 OPEN 2,8,0,CBUFF 3870 CPY #1 3880 BEQ SCNDOK 3890 JMP ERROR 3900 APPENDIT 3910 LDA #EOL 3920 STA CBUFF,Y 3930 OPEN 2,9,0,CBUFF 3940 CPY #1 3950 BEQ SCNDOK 3960 JMP ERROR 3970 SCNDOK 3980 BGET 1,ENDCOMDOS,128 3990 CPY #136 4000 BEQ ITSOK 4010 CPY #1 4020 BEQ PUT128 4030 JMP ERROR 4040 PUT128 4050 BPUT 2,ENDCOMDOS,128 4060 JMP SCNDOK 4070 ITSOK 4080 LDA ICBLEN,X 4090 STA LOLEN 4100 LDA ICBLEN+1,X 4110 STA HILEN 4120 LDX #$20 4130 JSR PUTBYTES 4140 JMP CONTCOPY 4150 PUTBYTES 4160 LDA #CPBINR 4170 STA ICCOM,X 4180 LDA # ENDCOMDOS 4210 STA ICBADR+1,X 4220 LDA LOLEN 4230 STA ICBLEN,X 4240 LDA HILEN 4250 STA ICBLEN+1,X 4260 JSR CIO 4270 RTS 4280 CONTCOPY 4290 CPY #1 4300 BEQ ITSOK2 4310 JMP ERROR 4320 ITSOK2 4330 CLOSE 1 4340 CLOSE 2 4350 PRINT 0,"File copied." 4360 JMP MAINLOOP 4370 ; 4380 ;DUPLICATE - Will duplicate the 4390 ;file specified after command. 4400 ; 4410 DUPLICATE 4420 PRINT 0,"Insert source disk, press RETURN." 4430 POKE 764,255 4440 DGLOOP 4450 LDA 764 4460 CMP #12 4470 BNE DGLOOP 4480 OPEN 1,4,0,LBUFF+4 4490 CPY #1 4500 BEQ DUPOK 4510 JMP ERROR 4520 DUPOK 4530 BGET 1,ENDCOMDOS,60000 4540 CPY #136 4550 BEQ DUPOK2 4560 JMP ERROR 4570 DUPOK2 4580 LDA ICBLEN,X 4590 STA LOLEN 4600 LDA ICBLEN+1,X 4610 STA HILEN 4620 CLOSE 1 4630 PRINT 0,"Insert destination disk, press RETURN" 4640 POKE 764,255 4650 GETLOOP 4660 LDA 764 4670 CMP #12 4680 BNE GETLOOP 4690 OPEN 1,8,0,LBUFF+4 4700 LDX #$10 4710 JSR PUTBYTES 4720 CPY #1 4730 BEQ DUPOK3 4740 JMP ERROR 4750 DUPOK3 4760 CLOSE 1 4770 PRINT 0,"Duplication complete." 4780 JMP MAINLOOP 4790 WDOS 4800 LDA LBUFF+4 4810 STA DOSSYS+1 4820 OPEN 1,8,0,DOSSYS 4830 CPY #1 4840 BNE WDOSERR 4850 CLOSE 1 4860 PRINT 0,"DOS.SYS file written." 4870 JMP MAINLOOP 4880 WDOSERR 4890 JMP ERROR 4900 WMEM 4910 LDA LBUFF+4 4920 CMP #'8 4930 BNE WMEMSAV 4940 PRINT 0,"Can't write MEM.SAV to drive 8!" 4950 JMP MAINLOOP 4960 WMEMSAV 4970 STA MEMSAV+1 4980 OPEN 1,8,0,MEMSAV 4990 CPY #1 5000 BNE WMEMERR 5010 BPUT 1,ENDCOMDOS,5625 5020 CPY #1 5030 BNE WMEMERR 5040 CLOSE 1 5050 PRINT 0,"MEM.SAV file written." 5060 JMP MAINLOOP 5070 WMEMERR 5080 JMP ERROR 5090 BSAVE 5100 LDY #6 5110 LDX #0 5120 BSVLOOP 5130 LDA LBUFF,Y 5140 CMP #', 5150 BEQ BENDFL 5160 STA CBUFF,X 5170 INY 5180 INX 5190 JMP BSVLOOP 5200 BENDFL 5210 LDA #EOL 5220 STA CBUFF,X 5230 LDX #0 ;Copy 1st # 5240 INY 5250 CN1LOOP 5260 LDA LBUFF,Y 5270 CMP #', 5280 BEQ CN1DONE 5290 STA N1BUFF,X 5300 INY 5310 INX 5320 JMP CN1LOOP 5330 CN1DONE 5340 LDA #EOL 5350 STA N1BUFF,X 5360 LDX #0 5370 INY 5380 CN2LOOP 5390 LDA LBUFF,Y 5400 STA N2BUFF,X 5410 CMP #EOL 5420 BEQ CN2DONE 5430 INY 5440 INX 5450 JMP CN2LOOP 5455 ; Filename now in LBUFF, n1 in 5456 ; N1BUFF, n2 in N2BUFF. 5460 CN2DONE 5470 ;Open IOCB 1 for output 5480 OPEN 1,8,0,CBUFF 5490 ; 5500 BPUT 1,NNN,2 5510 ;Now convert second number to FP 5520 ; 5530 LDA # N2BUFF 5560 STA INBUFF+1 5570 LDA #0 5580 STA CIX 5590 JSR AFP 5600 JSR FPI 5610 LDA FR0 5620 STA PTR 5630 LDA FR0+1 5640 STA PTR+1 5650 JSR IFP 5660 ; 5670 ;Move it to FR1 5680 ; 5690 JSR FMOVE 5700 ; 5710 ;Convert 1st number to FP 5720 ; 5730 LDA # N1BUFF 5760 STA INBUFF+1 5770 LDA #0 5780 STA CIX 5790 JSR AFP 5800 ; 5810 ;Convert # to Integer 5820 ; 5830 JSR FPI 5840 BPUT 1,FR0,2 5850 BPUT 1,PTR,2 5860 ; 5870 LDX #$10 5880 LDA FR0 5890 STA ICBADR,X 5900 LDA FR0+1 5910 STA ICBADR+1,X 5920 ; 5930 ;Convert 1st # back to FP 5940 ; 5950 JSR IFP 5960 JSR FMOVE ;Put it in FR1 5970 ; 5980 ;Convert 2nd # back to FP in FR0 5990 ; 6000 LDA # N2BUFF 6030 STA INBUFF+1 6040 LDA #0 6050 STA CIX 6060 JSR AFP 6070 ; 6080 ;Do subtraction 6090 ; 6100 JSR FSUB 6110 JSR FPI ;Convert to int 6120 ; 6130 LDX #$10 6140 INC FR0 6150 LDA FR0 6160 BEQ INCHI 6170 BNE STORIT 6180 INCHI 6190 INC FR0+1 6200 STORIT 6210 STA ICBLEN,X 6220 LDA FR0+1 6230 STA ICBLEN+1,X 6240 LDA #CPBINR 6250 STA ICCOM,X 6260 JSR CIO ;Put bytes 6270 PRINT 0,"Enter RUN address (press RETURN if none)" 6280 INPUT 0,LBUFF 6290 LDA LBUFF 6300 CMP #EOL 6310 BEQ GOMNLP 6320 LDA # LBUFF 6350 STA INBUFF+1 6360 LDA #0 6370 STA CIX 6380 JSR AFP 6390 JSR FPI 6400 LDA FR0 6410 STA RUNDAT 6420 LDA FR0+1 6430 STA RUNDAT+1 6440 BPUT 1,INIDAT,6 6450 GOMNLP 6460 CLOSE 1 6470 PRINT 0,"File saved." 6480 JMP MAINLOOP 6490 BOOT 6500 OPEN 1,4,0,"D:AUTORUN.SYS" 6510 CPY #170 6520 BEQ DOBOOT 6530 CLOSE 1 6540 PRINT 0,"$)AUTORUN.SYS file already exists!" 6550 JMP MAINLOOP 6560 DOBOOT 6570 CLOSE 1 6580 OPEN 1,8,0,"D:AUTORUN.SYS" 6590 LDY #0 6600 BOOTLOOP 6610 LDA LBUFF+5,Y 6620 STA FILEDAT,Y 6630 CMP #EOL 6640 BEQ DONEBOOT 6650 INY 6660 JMP BOOTLOOP 6670 DONEBOOT 6680 BPUT 1,PROG,73 6690 CLOSE 1 6700 JMP MAINLOOP 6710 HELP 6720 BPUT 0,HELPLST,ENDLST-HELPLST 6730 JMP MAINLOOP 6740 HELPLST 6750 .BYTE "$)" 6760 .BYTE " LOCK D:filename.ext" 6761 .BYTE " DIRn",EOL 6770 .BYTE " UNLOCK D:filename.ex" 6771 .BYTE "t FORMATn",EOL 6780 .BYTE " DELETE D:filename.ex" 6781 .BYTE "t WDOSn",EOL 6790 .BYTE " RENAME D:old,new" 6791 .BYTE " WMEMn",EOL 6800 .BYTE " BSAVE D:file,begin,e" 6801 .BYTE "nd REBOOT",EOL 6810 .BYTE " BLOAD D:filename.ext" 6811 .BYTE " GO addr",EOL 6820 .BYTE " COPY D:file1,D2:file" 6821 .BYTE "2[/] BASIC",EOL 6830 .BYTE " DUP D:filename.ext" 6831 .BYTE " STATUS",EOL 6840 .BYTE " BOOT filename.ext" 6841 .BYTE " CLICK",EOL 6850 .BYTE " ?hxnm " 6851 .BYTE " HELP",EOL 6860 .BYTE EOL,"n=drive number (1" 6861 .BYTE EOL,"-8)",EOL 6870 .BYTE "hxnm = 4-digit hex nu" 6871 .BYTE "mber",EOL 6880 .BYTE "All input MUST be in " 6881 .BYTE "decimal.",EOL 6890 ENDLST 6900 GO 6910 LDA # LBUFF+3 6940 STA INBUFF+1 6950 LDA #0 6960 STA CIX 6970 JSR AFP 6980 JSR FPI 6990 JMP (FR0) 7000 STATUS 7010 BPUT 0,WVERMSG,14 7020 LDA WVERIFY 7030 CMP #80 7040 BEQ VEROFF 7050 PRINT 0,"ON" 7060 JMP DRIVES? 7070 VEROFF 7080 PRINT 0,"OFF" 7090 DRIVES? 7100 BPUT 0,DRIVEMSG,15 7110 LDA DRVBYT 7120 AND #$01 7130 BEQ NXTBIT 7140 LDA #'1 7150 JSR PRBIT 7160 NXTBIT 7170 LDA DRVBYT 7180 AND #$02 7190 BEQ NXTBIT2 7200 LDA #'2 7210 JSR PRBIT 7220 NXTBIT2 7230 LDA DRVBYT 7240 AND #$04 7250 BEQ NXTBIT3 7260 LDA #'3 7270 JSR PRBIT 7280 NXTBIT3 7290 LDA DRVBYT 7300 AND #$08 7310 BEQ NXTBIT4 7320 LDA #'4 7330 JSR PRBIT 7340 NXTBIT4 7350 LDA DRVBYT 7360 AND #$80 7370 BEQ ENDDRIVE 7380 LDA #'8 7390 JSR PRBIT 7400 ENDDRIVE 7410 PRINT 0 7420 BPUT 0,MAXFILES,54 7430 LDA SABYTE 7440 STA FR0 7450 LDA #0 7460 STA FR0+1 7470 JSR IFP 7480 JSR FASC 7490 LDY #$FF 7500 MAXLOOP 7510 INY 7520 LDA LBUFF,Y 7530 BPL MAXLOOP 7540 AND #$7F 7550 STA LBUFF,Y 7560 LDA #EOL 7570 STA LBUFF+1,Y 7580 PRINT 0,LBUFF 7590 JMP CHANGEM 7600 PRBIT 7610 STA BUFF2 7620 BPUT 0,BUFF2,2 7630 RTS 7640 CHANGEM 7650 PRINT 0 7660 PRINT 0,"Toggle Write Verify on/off (Y/N)?" 7670 INPUT 0,CBUFF 7680 LDA CBUFF 7690 CMP #'Y 7700 BEQ CHWV 7710 CMP #EOL 7720 BNE CHCONT1 7730 JMP MAINLOOP 7740 CHCONT1 7750 JMP CHDRVS? 7760 CHWV 7770 LDA WVERIFY 7780 EOR #$07 7790 STA WVERIFY 7800 CHDRVS? 7810 PRINT 0,"Change active drives (Y/N)?" 7820 INPUT 0,CBUFF 7830 LDA CBUFF 7840 CMP #'Y 7850 BEQ CHNGDR 7860 CMP #EOL 7870 BNE CHCONT2 7880 JMP MAINLOOP 7890 CHCONT2 7900 JMP CHFLS? 7910 CHNGDR 7920 PRINT 0,"Type the drive numbers, one at a time,pressing RETURN after each one." 7930 PRINT 0,"Enter 0 when you're finished." 7940 LDA #0 7950 STA DRNUM 7960 DRLOOP 7970 INPUT 0,CBUFF 7980 LDA CBUFF 7990 CMP #'0 8000 BEQ DONEDR 8010 CMP #'1 8020 BEQ DR1 8030 CMP #'2 8040 BEQ DR2 8050 CMP #'3 8060 BEQ DR3 8070 CMP #'4 8080 BEQ DR4 8090 CMP #'8 8100 BEQ DR8 8110 JMP DONEDR 8120 DR1 8130 LDA #1 8140 CLC 8150 ADC DRNUM 8160 STA DRNUM 8170 JMP DRLOOP 8180 DR2 8190 LDA #2 8200 CLC 8210 ADC DRNUM 8220 STA DRNUM 8230 JMP DRLOOP 8240 DR3 8250 LDA #4 8260 CLC 8270 ADC DRNUM 8280 STA DRNUM 8290 JMP DRLOOP 8300 DR4 8310 LDA #8 8320 CLC 8330 ADC DRNUM 8340 STA DRNUM 8350 JMP DRLOOP 8360 DR8 8370 LDA #128 8380 CLC 8390 ADC DRNUM 8400 STA DRNUM 8410 JMP DRLOOP 8420 DONEDR 8430 LDA DRNUM 8440 STA DRVBYT 8450 CHFLS? 8460 PRINT 0,"Change number of files that can be open simultaneously?" 8470 INPUT 0,CBUFF 8480 LDA CBUFF 8490 CMP #'Y 8500 BEQ CHFLS 8510 JMP MAINLOOP 8520 CHFLS 8530 PRINT 0,"How many files do you want open at one time (1-7)?" 8540 INPUT 0,CBUFF 8550 LDA # CBUFF 8580 STA INBUFF+1 8590 LDA #0 8600 STA CIX 8610 JSR AFP 8620 JSR FPI 8630 LDA FR0 8640 STA SABYTE 8650 JMP MAINLOOP 8660 CLICK 8670 LDA NOCLIK 8680 EOR #$FF 8690 STA NOCLIK 8700 JMP MAINLOOP 8710 HEXDEC 8720 LDA LBUFF+1 8730 JSR COMP 8740 STA HIBYTE 8750 LDA LBUFF+2 8760 JSR COMP 8770 STA LOBYTE 8780 JSR MULT 8790 STA FR0+1 8800 LDA LBUFF+3 8810 JSR COMP 8820 STA HIBYTE 8830 LDA LBUFF+4 8840 JSR COMP 8850 STA LOBYTE 8860 JSR MULT 8870 STA FR0 8880 JSR IFP 8890 JSR FASC 8900 LDY #$FF 8910 HDLOOP 8920 INY 8930 LDA LBUFF,Y 8940 BPL HDLOOP 8950 AND #$7F 8960 STA LBUFF,Y 8970 LDA #EOL 8980 STA LBUFF+1,Y 8990 PRINT 0,LBUFF 9000 JMP MAINLOOP 9010 COMP 9020 SEC 9030 SBC #48 9040 TAX 9050 LDA HEX,X 9060 RTS 9070 MULT 9080 LDA HIBYTE 9090 ASL A 9100 ASL A 9110 ASL A 9120 ASL A 9130 CLC 9140 ADC LOBYTE 9150 RTS 9160 ENDCOMDOS 9170 *= $02E0 ;Run address 9180 .WORD BEGIN