0005 = ENTRY EQU 0005H ;BDOS ENTRY POINT 005C = TFCB EQU 005CH ;SYSTEM FILE CONTROL BLOCK 0080 = DBUF EQU 0080H ;SYSTEM DISK BUFFER 000D = CR EQU 0DH 000A = LF EQU 0AH 0001 = RCFC EQU 01 ;READ CONSOLE 0002 = WCFC EQU 02 ;WRITE CONSOLE 000D = RDFC EQU 13 ;RESET DISK 000F = OFFC EQU 15 ;OPEN FILE 0010 = CFFC EQU 16 ;CLOSE FILE 0011 = SFFC EQU 17 ;SEARCH FIRST 0012 = SNFC EQU 18 ;SEARCH NEXT 0013 = DFFC EQU 19 ;DELETE FILE 0014 = RRFC EQU 20 ;READ RECORD 0015 = WRFC EQU 21 ;WRITE RECORD 0016 = MFFC EQU 22 ;MAKE FILE 001A = SAFC EQU 26 ;SET ADDRESS 0001 = FN EQU 01 ;FILE NAME OFFSET 0009 = FT EQU 09 ;FILE TYPE OFFSET 000C = EX EQU 12 ;EXTENT NUMBER OFFSET 0020 = NR EQU 32 ;NEXT RECORD OFFSET 0100 ORG 100H 0100 31D10A MFT: LXI SP,STACK+64 0103 219705 LXI H,MSG1 ;PRINT 'MFT V3.1' 0106 CD8E04 CALL WASC 0109 AF XRA A ;CLEAR BREAK FLAGS 010A 32940B STA IBFLG 010D 32950B STA OBFLG ; CALCULATE BUFFER SIZE = FWA(BDOS) - FWA(MBUF) 0110 2A0600 LHLD ENTRY+1 ;HL = (ENTRY+1) - 6 0113 11FAFF LXI D,-6 0116 19 DAD D 0117 7D MOV A,L 0118 E680 ANI 80H ;HL = HL MOD 128 011A 6F MOV L,A 011B 11960B LXI D,MBUF ;HL = HL - FWA(MBUF) 011E 7D MOV A,L 011F 93 SUB E 0120 6F MOV L,A 0121 7C MOV A,H 0122 9A SBB D 0123 67 MOV H,A 0124 29 DAD H ;HL = HL / 128 0125 6C MOV L,H 0126 3E00 MVI A,0 0128 CE00 ACI 0 012A 67 MOV H,A 012B 2B DCX H ;SUBTRACT ONE 012C 22D10A SHLD SPACE ;SAVE AS BUFFER SIZE 012F 21A205 LXI H,MSG2 ;WRITE 'BUFFER SIZE = ' 0132 CD8E04 CALL WASC 0135 2AD10A LHLD SPACE ;WRITE SIZE OF BUFFER 0138 CDA204 CALL WDWC 013B 21B105 LXI H,MSG3 ;WRITE ' SECTORS' 013E CD8E04 CALL WASC ; ASK USER TO MOUNT INPUT DISK 0141 21BC05 MFT1: LXI H,MSG4 ;WRITE 'MOUNT INPUT DISK, TYPE CR' 0144 CD8E04 CALL WASC 0147 CD0105 CALL RACC ;READ RESPONSE 014A FE0D CPI CR ;LOOP IF ANYTHING BUT CR 014C C24101 JNZ MFT1 014F CD9804 CALL WEOLC ;ECHO CR,LF 0152 3A940B LDA IBFLG ;JUMP IF IBFLG SET 0155 B7 ORA A 0156 C27D01 JNZ MFT2A ; COPY COMMAND LINE INTO CBUF 0159 218000 LXI H,DBUF ;FWA OF COMMAND LINE IMAGE 015C 11D50A LXI D,CBUF ;FWA OF COMMAND BUFFER 015F 46 MOV B,M ;FETCH COMMAND LINE IMAGE LENGTH 0160 23 INX H 0161 7E MFT2: MOV A,M ;FETCH NEXT BYTE FROM CLI 0162 23 INX H 0163 12 STAX D ;STORE IN DBUF 0164 13 INX D 0165 05 DCR B ;DECREMENT COUNT 0166 C26101 JNZ MFT2 ;LOOP UNTIL ZERO 0169 AF XRA A ;STORE ZERO BYTE AT END 016A 12 STAX D 016B 21D50A LXI H,CBUF ;RESET CBUFP 016E 22250B SHLD CBUFP 0171 CD1E04 CALL CFNT ;CREATE FILE NAME TABLE 0174 219006 LXI H,FNT ;RESET FNT POINTERS 0177 222B0B SHLD IFNTP 017A 222D0B SHLD OFNTP 017D 21960B MFT2A: LXI H,MBUF ;RESET MBUF POINTER 0180 222F0B SHLD MBUFP 0183 2AD10A LHLD SPACE ;RESET MSIZE 0186 22D30A SHLD MSIZE 0189 3A940B LDA IBFLG ;JUMP IF IBFLG NOT SET 018C B7 ORA A 018D CAC101 JZ MFT3 0190 21310B LXI H,IFCB ;COPY IFCB INTO TFCB 0193 115C00 LXI D,TFCB 0196 0621 MVI B,33 0198 CD9803 CALL MOVE 019B AF XRA A ;CLEAR IBFLG 019C 32940B STA IBFLG 019F 3E01 MVI A,1 ;SET OBFLG 01A1 32950B STA OBFLG 01A4 2A2B0B LHLD IFNTP ;BACK IFNTP UP 4 BYTES 01A7 11FCFF LXI D,-4 01AA 19 DAD D 01AB 222B0B SHLD IFNTP 01AE 215D00 LXI H,TFCB+FN ;WRITE FILENAME 01B1 CD8E04 CALL WASC 01B4 21F105 LXI H,MSG6 ;WRITE ' - ' 01B7 CD8E04 CALL WASC 01BA 2A2B0B LHLD IFNTP ;DE = IFNTP 01BD EB XCHG 01BE C3F501 JMP MFTU ;CONTINUE READING PREVIOUS FILE ; PARSE OFF NEXT NAME FROM CBUF 01C1 2A2B0B MFT3: LHLD IFNTP ;FETCH INPUT FNT POINTER 01C4 7E MOV A,M ;JUMP IF END OF TABLE 01C5 FEFF CPI 0FFH 01C7 CA7B02 JZ MFT9 01CA 3601 MVI M,1 ;SET 'FILE READ' FLAG 01CC 23 INX H 01CD 115D00 LXI D,TFCB+FN ;COPY FILENAME INTO TFCB 01D0 060B MVI B,11 01D2 CD9803 CALL MOVE 01D5 222B0B SHLD IFNTP ;SAVE INPUT FNT POINTER 01D8 215D00 LXI H,TFCB+FN ;WRITE FILENAME 01DB CD8E04 CALL WASC 01DE 21F105 LXI H,MSG6 ;WRITE ' - ' 01E1 CD8E04 CALL WASC 01E4 AF XRA A ;SETUP TFCB 01E5 325C00 STA TFCB 01E8 326800 STA TFCB+EX 01EB 327C00 STA TFCB+NR 01EE CD1905 CALL OPEN ;OPEN FILE 01F1 2A2B0B LHLD IFNTP 01F4 EB XCHG 01F5 2A2F0B MFTU: LHLD MBUFP 01F8 7C MOV A,H ;COPY INTO FNT ENTRY 01F9 12 STAX D 01FA 13 INX D 01FB 7D MOV A,L 01FC 12 STAX D 01FD 13 INX D 01FE EB XCHG ;SAVE FNT POINTER 01FF 222B0B SHLD IFNTP 0202 210000 LXI H,0 ;FILE SIZE (IN SECTORS) = 0 0205 22270B SHLD FSIZE ; READ NEXT FILE FROM INPUT DISK 0208 2A2F0B MFT6: LHLD MBUFP 020B EB XCHG 020C CD7305 CALL SETDMA 020F CD2805 CALL READ ;READ NEXT SECTOR 0212 B7 ORA A ;JUMP IF NORMAL TRANSFER 0213 CA2402 JZ MFT7 0216 FE01 CPI 1 ;JUMP IF EOF 0218 CA5102 JZ MFT8 021B 210206 LXI H,MSG8 ;WRITE 'READ ERROR - ' 021E CD8E04 CALL WASC 0221 C35102 JMP MFT8 ;CONTINUE AS IF EOF 0224 2A2F0B MFT7: LHLD MBUFP ;MBUFP = MBUFP + 128 0227 118000 LXI D,128 022A 19 DAD D 022B 222F0B SHLD MBUFP 022E 2A270B LHLD FSIZE ;FSIZE = FSIZE + 1 0231 23 INX H 0232 22270B SHLD FSIZE 0235 2AD30A LHLD MSIZE ;DECREMENT MSIZE 0238 2B DCX H 0239 22D30A SHLD MSIZE 023C 7C MOV A,H ;LOOP IF STILL POSITIVE 023D B5 ORA L 023E C20802 JNZ MFT6 0241 215C00 LXI H,TFCB ;COPY TFCB INTO IFCB 0244 11310B LXI D,IFCB 0247 0621 MVI B,33 0249 CD9803 CALL MOVE 024C 3E01 MVI A,1 ;SET IBFLG 024E 32940B STA IBFLG 0251 118000 MFT8: LXI D,DBUF ;RESET DMA POINTER 0254 CD7305 CALL SETDMA 0257 CD3705 CALL CLOSE ;CLOSE FILE 025A 2A270B LHLD FSIZE ;WRITE FILE SIZE 025D CDA204 CALL WDWC 0260 210F06 LXI H,MSG9 ;WRITE ' SECTORS READ' 0263 CD8E04 CALL WASC ; UPDATE FNT, LOOP 0266 2A270B LHLD FSIZE ;DE = FILE SIZE 0269 EB XCHG 026A 2A2B0B LHLD IFNTP ;STORE FILE SIZE IN FNT ENTHY 026D 72 MOV M,D 026E 23 INX H 026F 73 MOV M,E 0270 23 INX H 0271 222B0B SHLD IFNTP ;SAVE FNT POINTER 0274 3A940B LDA IBFLG ;LOOP IF IBFLG NOT SET 0277 B7 ORA A 0278 CAC101 JZ MFT3 ; ASK USER TO MOUNT OUTPUT DISK 027B 212006 MFT9: LXI H,MSGA ;WRITE 'MOUNT OUTPUT DISK, TYPE CR' 027E CD8E04 CALL WASC 0281 CD0105 CALL RACC ;READ RESPONSE 0284 FE0D CPI CR ;LOOP IF ANYTHING BUT CR 0286 C27B02 JNZ MFT9 0289 CD9804 CALL WEOLC ;ECHO CR,LF 028C CD0D05 CALL RESET ;RESET DISK SYSTEM (MAKE R/W) 028F 3A950B LDA OBFLG ;JUMP IF OBFLG NOT SET 0292 B7 ORA A 0293 CABD02 JZ MFTA 0296 21520B LXI H,OFCB ;COPY OFCB INTO TFCB 0299 115C00 LXI D,TFCB 029C 0621 MVI B,33 029E CD9803 CALL MOVE 02A1 CD1905 CALL OPEN ;OPEN PREVIOUS FILE 02A4 2A2D0B LHLD OFNTP ;BACKUP OUTPUT FNT POINTER 4 BYTES 02A7 11FCFF LXI D,-4 02AA 19 DAD D 02AB 222D0B SHLD OFNTP 02AE 215D00 LXI H,TFCB+FN ;WRITE FILE NAME 02B1 CD8E04 CALL WASC 02B4 21F105 LXI H,MSG6 ;WRITE ' - ' 02B7 CD8E04 CALL WASC 02BA C31003 JMP MFTB ;CONTINUE WRITING PREVIOUS FILE ; WRITE NEXT FILE TO OUTPUT DISK 02BD 2A2D0B MFTA: LHLD OFNTP 02C0 7E MOV A,M 02C1 B7 ORA A 02C2 CA8E03 JZ MFTF 02C5 FEFF CPI 0FFH 02C7 CA8E03 JZ MFTF 02CA 23 INX H 02CB 115D00 LXI D,TFCB+FN 02CE 060B MVI B,11 02D0 CD9803 CALL MOVE 02D3 222D0B SHLD OFNTP 02D6 215D00 LXI H,TFCB+FN 02D9 CD8E04 CALL WASC 02DC 21F105 LXI H,MSG6 02DF CD8E04 CALL WASC 02E2 AF XRA A 02E3 325C00 STA TFCB 02E6 326800 STA TFCB+EX 02E9 327C00 STA TFCB+NR 02EC 3A6500 LDA TFCB+9 ;FORCE TO $R/W FOR 2.0 02EF E67F ANI 7FH 02F1 326500 STA TFCB+9 02F4 3A6600 LDA TFCB+10 ;FORCE TO $DIR FOR 2.0 02F7 E67F ANI 7FH 02F9 326600 STA TFCB+10 02FC CD4605 CALL DELT ;TRY TO CREATE OUTPUT FILE 02FF CD5505 CALL MAKE 0302 FEFF CPI 255 ;JUMP IF OK 0304 C21003 JNZ MFTB 0307 213B06 LXI H,MSGB ;WRITE 'UNABLE TO CREATE' 030A CD8E04 CALL WASC 030D C39503 JMP MFTG 0310 2A2D0B MFTB: LHLD OFNTP 0313 56 MOV D,M ;FETCH FWA OF FILE FROM FNT 0314 23 INX H 0315 5E MOV E,M 0316 23 INX H 0317 EB XCHG 0318 222F0B SHLD MBUFP ;SAVE IT 031B EB XCHG 031C 56 MOV D,M ;FETCH SIZE OF FILE FROM FNT 031D 23 INX H 031E 5E MOV E,M 031F 23 INX H 0320 EB XCHG 0321 22270B SHLD FSIZE ;SAVE IT 0324 22290B SHLD XSIZE ;SAVE FOR PRINTOUT 0327 EB XCHG 0328 222D0B SHLD OFNTP 032B 2A270B LHLD FSIZE ;JUMP IF FSIZE=0 032E 7C MOV A,H 032F B5 ORA L 0330 CA6003 JZ MFTDA 0333 2A2F0B MFTC: LHLD MBUFP ;SET DMA ADDRESS TO MBUFP 0336 EB XCHG 0337 CD7305 CALL SETDMA 033A CD6405 CALL WRITE ;WRITE NEXT SECTOR 033D B7 ORA A ;JUMP IF OK 033E CA4A03 JZ MFTD 0341 214E06 LXI H,MSGC ;WRITE 'ERROR WRITING FILE' 0344 CD8E04 CALL WASC 0347 C39503 JMP MFTG 034A 2A2F0B MFTD: LHLD MBUFP ;MBUFP = MBUFP + 128 034D 118000 LXI D,128 0350 19 DAD D 0351 222F0B SHLD MBUFP 0354 2A270B LHLD FSIZE ;FSIZE = FSIZE - 1 0357 2B DCX H 0358 22270B SHLD FSIZE 035B 7C MOV A,H ;LOOP UNTIL ZERO 035C B5 ORA L 035D C23303 JNZ MFTC 0360 215C00 MFTDA: LXI H,TFCB ;COPY TFCB INTO OFCB 0363 11520B LXI D,OFCB 0366 0621 MVI B,33 0368 CD9803 CALL MOVE 036B 118000 LXI D,DBUF ;RESET DMA POINTER 036E CD7305 CALL SETDMA 0371 CD3705 CALL CLOSE ;TRY TO CLOSE FILE 0374 FEFF CPI 255 ;JUMP IF OK 0376 C27F03 JNZ MFTE 0379 216306 LXI H,MSGD ;WRITE 'UNABLE TO CLOSE' 037C CD8E04 CALL WASC 037F 2A290B MFTE: LHLD XSIZE ;WRITE NUMBER OF SECTORS WRITTEN 0382 CDA204 CALL WDWC 0385 217506 LXI H,MSGE ;WRITE ' SECTORS WRITTEN' 0388 CD8E04 CALL WASC 038B C3BD02 JMP MFTA 038E 3A940B MFTF: LDA IBFLG ;LOOP IF IBFLG SET 0391 B7 ORA A 0392 C24101 JNZ MFT1 0395 C30000 MFTG: JMP 0 ;EXIT TO CP/M ; SUBROUTINES 0398 7E MOVE: MOV A,M 0399 23 INX H 039A 12 STAX D 039B 13 INX D 039C 05 DCR B 039D C29803 JNZ MOVE 03A0 C9 RET ;; GFN - GET FILE NAME ; 03A1 7E GFN: MOV A,M 03A2 B7 ORA A 03A3 C8 RZ 03A4 FE20 CPI ' ' 03A6 C2AD03 JNZ GFN0 03A9 23 INX H 03AA C3A103 JMP GFN 03AD 11730B GFN0: LXI D,XFCB 03B0 AF XRA A 03B1 12 STAX D 03B2 13 INX D 03B3 D5 PUSH D 03B4 060B MVI B,11 03B6 3E20 MVI A,' ' 03B8 12 GFN6: STAX D 03B9 13 INX D 03BA 05 DCR B 03BB C2B803 JNZ GFN6 03BE D1 POP D 03BF 0609 MVI B,9 03C1 7E GFN1: MOV A,M 03C2 B7 ORA A 03C3 CAC103 JZ GFN1 03C6 23 INX H 03C7 FE20 CPI ' ' 03C9 CA1A04 JZ GFN4 03CC FE2E CPI '.' 03CE CAF103 JZ GFN2 03D1 FE2A CPI '*' 03D3 CADF03 JZ GFN7 03D6 12 STAX D 03D7 13 INX D 03D8 05 DCR B 03D9 CA1C04 JZ GFN5 03DC C3C103 JMP GFN1 03DF 05 GFN7: DCR B 03E0 CAEA03 JZ GFN9 03E3 3E3F MVI A,'?' 03E5 12 STAX D 03E6 13 INX D 03E7 C3DF03 JMP GFN7 03EA 7E GFN9: MOV A,M 03EB FE2E CPI '.' 03ED C21A04 JNZ GFN4 03F0 23 INX H 03F1 117C0B GFN2: LXI D,XFCB+FT 03F4 0604 MVI B,4 03F6 7E GFN3: MOV A,M 03F7 B7 ORA A 03F8 CA1A04 JZ GFN4 03FB 23 INX H 03FC FE20 CPI ' ' 03FE CA1A04 JZ GFN4 0401 FE2A CPI '*' 0403 CA0F04 JZ GFN8 0406 12 STAX D 0407 13 INX D 0408 05 DCR B 0409 CA1C04 JZ GFN5 040C C3F603 JMP GFN3 040F 05 GFN8: DCR B 0410 CA1A04 JZ GFN4 0413 3E3F MVI A,'?' 0415 12 STAX D 0416 13 INX D 0417 C30F04 JMP GFN8 041A AF GFN4: XRA A 041B C9 RET 041C 37 GFN5: STC 041D C9 RET ;; CFNT - CREATE FILE NAME TABLE ; 041E 219006 CFNT: LXI H,FNT ;RESET IFNTP 0421 222B0B SHLD IFNTP 0424 2A250B CFNT1: LHLD CBUFP ;GET CBUFP 0427 7E MOV A,M ;EXIT IF END OF LIST 0428 B7 ORA A 0429 C8 RZ 042A CDA103 CALL GFN ;GET NEXT AFN 042D 22250B SHLD CBUFP ;SAVE COMMAND BUFFER PTR 0430 D23C04 JNC CFNT2 ;JUMP IF FILENAME OK 0433 21D605 LXI H,MSG5 ;WRITE 'SYNTAX ERROR IN FILENAME' 0436 CD8E04 CALL WASC 0439 C32404 JMP CFNT1 ;LOOP 043C AF CFNT2: XRA A ;CLEAR XFCB EXTENT FIELD 043D 327F0B STA XFCB+EX 0440 11730B LXI D,XFCB ;SEARCH FOR FIRST OCCURANCE 0443 CD7F05 CALL SRCHF 0446 FEFF CPI 255 ;JUMP IF FOUND 0448 C25A04 JNZ CFNT3 044B 21740B LXI H,XFCB+FN ;WRITE FILENAME 044E CD8E04 CALL WASC 0451 21F505 LXI H,MSG7 ;WRITE ' NOT FOUND' 0454 CD8E04 CALL WASC 0457 C32404 JMP CFNT1 ;LOOP 045A E603 CFNT3: ANI 3 ;INDEX INTO CBUF 045C 6F MOV L,A 045D 2600 MVI H,0 045F 29 DAD H 0460 29 DAD H 0461 29 DAD H 0462 29 DAD H 0463 29 DAD H 0464 118000 LXI D,DBUF 0467 19 DAD D 0468 EB XCHG ;COPY FILENAME INTO FNT 0469 2A2B0B LHLD IFNTP 046C EB XCHG 046D 060C MVI B,12 046F CD9803 CALL MOVE 0472 218806 LXI H,ZEROS ;ZERO FILL REST OF ENTRY 0475 0604 MVI B,4 0477 CD9803 CALL MOVE 047A EB XCHG 047B 222B0B SHLD IFNTP ;SAVE INPUT FNT POINTER 047E 36FF MVI M,0FFH ;INSURE FF BYTE AT END 0480 11730B LXI D,XFCB ;SEARCH FOR NEXT OCCURANCE 0483 CD8B05 CALL SRCHN 0486 FEFF CPI 255 ;JUMP IF FOUND 0488 C25A04 JNZ CFNT3 048B C32404 JMP CFNT1 ;GO GET NEXT AFN ;; WASC - WRITE ASCII STRING TO CONSOLK ; 048E 7E WASC: MOV A,M 048F B7 ORA A 0490 C8 RZ 0491 CDF204 CALL WACC 0494 23 INX H 0495 C38E04 JMP WASC ;; WEOLC - WRITE END OF LINE TO CONSOLE ; 0498 3E0D WEOLC: MVI A,CR 049A CDF204 CALL WACC 049D 3E0A MVI A,LF 049F C3F204 JMP WACC ;; WDWC - WRITE DECIMAL WORD TO CONSOLE ; 04A2 E5 WDWC: PUSH H 04A3 D5 PUSH D 04A4 C5 PUSH B 04A5 0600 MVI B,0 ;CLEAR 'DIGIT WRITTEN' FLAG 04A7 111027 LXI D,10000 ;WRITE 1ST DIGIT 04AA CDCB04 CALL WNDD 04AD 11E803 LXI D,1000 ;WRITE 2ND DIGIT 04B0 CDCB04 CALL WNDD 04B3 116400 LXI D,100 ;WRITE 3RD DIGIT 04B6 CDCB04 CALL WNDD 04B9 110A00 LXI D,10 ;WRITE 4TH DTGIT 04BC CDCB04 CALL WNDD 04BF 110100 LXI D,1 ;WRITE 5TH DIGIT 04C2 0601 MVI B,1 ;FORCE LAST DIGIT TO PRINT 04C4 CDCB04 CALL WNDD 04C7 C1 POP B 04C8 D1 POP D 04C9 E1 POP H 04CA C9 RET 04CB 0E00 WNDD: MVI C,0 ;C=0 04CD 7D WNDD1: MOV A,L ;HL = HL - DE 04CE 93 SUB E 04CF 6F MOV L,A 04D0 7C MOV A,H 04D1 9A SBB D 04D2 67 MOV H,A 04D3 DADA04 JC WNDD2 ;JUMP IF < 0 04D6 0C INR C ;C = C + 1 04D7 C3CD04 JMP WNDD1 ;LOOP 04DA 19 WNDD2: DAD D ;HL = HL + DE 04DB 79 MOV A,C ;JUMP IF C NON-ZERO 04DC B1 ORA C 04DD C2EA04 JNZ WNDD4 04E0 78 MOV A,B ;JUMP IF DIGIT WRITTEN 04E1 B0 ORA B 04E2 C2EA04 JNZ WNDD4 04E5 3E20 MVI A,' ' ;WRITE ONE SPACE 04E7 C3F204 JMP WACC 04EA 0601 WNDD4: MVI B,1 ;SET 'DIGIT WRITTEN' FLAG 04EC 79 MOV A,C ;ENCODE C INTO DECIMAL ASCII 04ED C630 ADI '0' 04EF C3F204 JMP WACC ;GO WRITE IT ;; WACC - WRITE ASCII CHARACTER TO CONSOLE ; 04F2 E5 WACC: PUSH H 04F3 D5 PUSH D 04F4 C5 PUSH B 04F5 F5 PUSH PSW 04F6 0E02 MVI C,WCFC 04F8 5F MOV E,A 04F9 CD0500 CALL ENTRY 04FC F1 POP PSW 04FD C1 POP B 04FE D1 POP D 04FF E1 POP H 0500 C9 RET ;; RACC - READ ASCII CHARACTER FHOM CONSOLE ; 0501 E5 RACC: PUSH H 0502 D5 PUSH D 0503 C5 PUSH B 0504 0E01 MVI C,RCFC 0506 CD0500 CALL ENTRY 0509 C1 POP B 050A D1 POP D 050B E1 POP H 050C C9 RET ;; RESET - RESET DISK SYSTEM ; 050D E5 RESET: PUSH H 050E D5 PUSH D 050F C5 PUSH B 0510 0E0D MVI C,RDFC 0512 CD0500 CALL ENTRY 0515 C1 POP B 0516 D1 POP D 0517 E1 POP H 0518 C9 RET ;; OPEN - OPEN DISK FILE ; 0519 E5 OPEN: PUSH H 051A D5 PUSH D 051B C5 PUSH B 051C 115C00 LXI D,TFCB 051F 0E0F MVI C,OFFC 0521 CD0500 CALL ENTRY 0524 C1 POP B 0525 D1 POP D 0526 E1 POP H 0527 C9 RET ;; READ - READ RECORD FROM DISK FILE ; 0528 E5 READ: PUSH H 0529 D5 PUSH D 052A C5 PUSH B 052B 115C00 LXI D,TFCB 052E 0E14 MVI C,RRFC 0530 CD0500 CALL ENTRY 0533 C1 POP B 0534 D1 POP D 0535 E1 POP H 0536 C9 RET ;; CLOSE - CLOSE DISK FILE ; 0537 E5 CLOSE: PUSH H 0538 D5 PUSH D 0539 C5 PUSH B 053A 115C00 LXI D,TFCB 053D 0E10 MVI C,CFFC 053F CD0500 CALL ENTRY 0542 C1 POP B 0543 D1 POP D 0544 E1 POP H 0545 C9 RET ;; DELT - DELETE DISK FILE ; 0546 E5 DELT: PUSH H 0547 D5 PUSH D 0548 C5 PUSH B 0549 115C00 LXI D,TFCB 054C 0E13 MVI C,DFFC 054E CD0500 CALL ENTRY 0551 C1 POP B 0552 D1 POP D 0553 E1 POP H 0554 C9 RET ;; MAKE - MAKE NEW DISK FILE ; 0555 E5 MAKE: PUSH H 0556 D5 PUSH D 0557 C5 PUSH B 0558 115C00 LXI D,TFCB 055B 0E16 MVI C,MFFC 055D CD0500 CALL ENTRY 0560 C1 POP B 0561 D1 POP D 0562 E1 POP H 0563 C9 RET ;; WRITE - WRITE RECORD TO FILE ; 0564 E5 WRITE: PUSH H 0565 D5 PUSH D 0566 C5 PUSH B 0567 115C00 LXI D,TFCB 056A 0E15 MVI C,WRFC 056C CD0500 CALL ENTRY 056F C1 POP B 0570 D1 POP D 0571 E1 POP H 0572 C9 RET ;; SETDMA - SET DMA ADDRESS ; 0573 E5 SETDMA: PUSH H 0574 D5 PUSH D 0575 C5 PUSH B 0576 0E1A MVI C,SAFC 0578 CD0500 CALL ENTRY 057B C1 POP B 057C D1 POP D 057D E1 POP H 057E C9 RET ;; SRCHF - SEARCH FOR FIRST OCCURANCE OF AFN ; 057F E5 SRCHF: PUSH H 0580 D5 PUSH D 0581 C5 PUSH B 0582 0E11 MVI C,SFFC 0584 CD0500 CALL ENTRY 0587 C1 POP B 0588 D1 POP D 0589 E1 POP H 058A C9 RET ;; SRCHN - SEARCH FOR NEXT OCCURANCE OF AFN ; 058B E5 SRCHN: PUSH H 058C D5 PUSH D 058D C5 PUSH B 058E 0E12 MVI C,SNFC 0590 CD0500 CALL ENTRY 0593 C1 POP B 0594 D1 POP D 0595 E1 POP H 0596 C9 RET 0597 4D46542056MSG1: DB 'MFT V3.1',CR,LF,0 05A2 4275666665MSG2: DB 'Buffer size = ',0 05B1 2073656374MSG3: DB ' sectors',CR,LF,0 05BC 4D6F756E74MSG4: DB 'Mount input disk, type CR',0 05D6 53796E7461MSG5: DB 'Syntax error in filename',CR,LF,0 05F1 202D2000 MSG6: DB ' - ',0 05F5 206E6F7420MSG7: DB ' not found',CR,LF,0 0602 7265616420MSG8: DB 'read error -',0 060F 2073656374MSG9: DB ' sectors read ' ,CR,LF,0 0620 4D6F756E74MSGA: DB 'Mount output disk, type CR',0 063B 756E61626CMSGB: DB 'unable to create',CR,LF,0 064E 6572726F72MSGC: DB 'error writing file',CR,LF,0 0663 756E61626CMSGD: DB 'unable to close',CR,LF,0 0675 2073656374MSGE: DB ' sectors written',CR,LF,0 0688 00000000 ZEROS: DB 0,0,0,0 0690 ORG ($+15)/16*16 0AD5 CBUF 0B25 CBUFP 0010 CFFC 041E CFNT 0424 CFNT1 043C CFNT2 045A CFNT3 0537 CLOSE 000D CR 0080 DBUF 0546 DELT 0013 DFFC 0005 ENTRY 000C EX 0001 FN 0690 FNT 0B27 FSIZE 0009 FT 03A1 GFN 03AD GFN0 03C1 GFN1 03F1 GFN2 03F6 GFN3 041A GFN4 041C GFN5 03B8 GFN6 03DF GFN7 040F GFN8 03EA GFN9 0B94 IBFLG 0B31 IFCB 0B2B IFNTP 000A LF 0555 MAKE 0B96 MBUF 0B2F MBUFP 0016 MFFC 0100 MFT 0141 MFT1 017D MFT2A 0161 MFT2 01C1 MFT3 0208 MFT6 0224 MFT7 0251 MFT8 027B MFT9 02BD MFTA 0310 MFTB 0333 MFTC 0360 MFTDA 034A MFTD 037F MFTE 038E MFTF 0395 MFTG 01F5 MFTU 0398 MOVE 0597 MSG1 05A2 MSG2 05B1 MSG3 05BC MSG4 05D6 MSG5 05F1 MSG6 05F5 MSG7 0602 MSG8 060F MSG9 0620 MSGA 063B MSGB 064E MSGC 0663 MSGD 0675 MSGE 0AD3 MSIZE 0020 NR 0B95 OBFLG 0B52 OFCB 000F OFFC 0B2D OFNTP 0519 OPEN 0501 RACC 0001 RCFC 000D RDFC 0528 READ 050D RESET 0014 RRFC 001A SAFC 0573 SETDMA 0011 SFFC 0012 SNFC 0AD1 SPACE 057F SRCHF 058B SRCHN 0A91 STACK 005C TFCB 04F2 WACC 048E WASC 0002 WCFC 04A2 WDWC 0498 WEOLC 04CB WNDD 04CD WNDD1 04DA WNDD2 04EA WNDD4 0015 WRFC 0564 WRITE 0B73 XFCB 0B29 XSIZE 0688 ZEROS 0690 FNT: DS 16*64+1 0A91 STACK: DS 64 0AD1 SPACE: DS 2 ;AVAILABLE SPACE 0AD3 MSIZE: DS 2 ;MEMORY SIZE 0AD5 CBUF: DS 80 ;COMMAND BUFFEH 0B25 CBUFP: DS 2 ;COMMAND BUFFER POINTEH 0B27 FSIZE: DS 2 ;FILE SIZE IN SECTORS 0B29 XSIZE: DS 2 ;FILE SIZE FOR PRINTOUT 0B2B IFNTP: DS 2 ;INPUT FNT POINTER 0B2D OFNTP: DS 2 ;OUTPUT FNT POINTER 0B2F MBUFP: DS 2 ;MEMORY BUFFER POINTER 0B31 IFCB: DS 33 ;INPUT FCB 0B52 OFCB: DS 33 ;OUTPUT FCB 0B73 XFCB: DS 33 ;TEMPORARY FCB 0B94 IBFLG: DS 1 ;INPUT BREAK FLAG 0B95 OBFLG: DS 1 ;OUTPUT BREAK FLAG 0B96 = MBUF EQU $ 0B96 END MFT