;******************************************** ; Program Written by: HARRIS LANDSBERG c1985 ; Name: VOL.ASM using standard 8080 ASM code ; ; Designed as a MS-DOS diskette volume indent ; used in conjuction with LABEL. ; ; Comment: Will read file DISKETTE.VOL which ; was created by LABEL program, and display ; it to the CRT device. DISKETTE.VOL is a ; hidden file for less detraction. ; ; Run: VOL [d:] ;******************************************** BDOS EQU 0005H ;System Call Location DMA EQU 0080H ;DMA Buffer Location FCB EQU 005CH ;File Control Block SDMA EQU 26 ;Set DMA Address GCD EQU 25 ;Get Current Disk READ EQU 20 ;Read Sequential Record SFF EQU 17 ;Search For First OPEN EQU 15 ;Open File Function COUT EQU 2 ;Character Output PSTR EQU 9 ;Print String Function NOTF EQU 255 ;File Not Found TPA EQU 0100H ;Transient Program Area LF EQU 10 ;Line Feed Charcter ; VOL ORG TPA ;Program Start ; MVI C,SDMA ;Set Buffer Location LXI D,DMA ;At DMA Address CALL BDOS MVI C,PSTR ;Output MSG to Console LXI D,MSG CALL BDOS LXI H,FCB ;For Which Drive? MOV A,M CPI 0 ;Default Drive CZ GETDR ;Get Current Drive ADI 40H ;Upgrade to A,B,C etc. MVI C,COUT ;Display to Console MOV E,A CALL BDOS LXI D,FCB+1 ;Start Move to position LXI H,FILE ;Start Move from posit. MVI B,11 ;Total 11 Characters FNAME MOV A,M ;From Mem to Accumulator STAX D ;Put into FCB INX D ;Increment Pointers INX H DCR B ;Decrement Counter JNZ FNAME ;Not Finished? MVI C,SFF ;Set Search Directory LXI D,FCB ;For First Call CALL BDOS CPI NOTF ;Not Found? JZ NOVOL ;Has no label MVI C,OPEN ;Open "VOL" File LXI D,FCB CALL BDOS MVI C,READ ;Read First Record LXI D,FCB CALL BDOS MVI C,PSTR ;Output Second string LXI D,YESV CALL BDOS LXI H,DMA ;Start of Record MVI B,11 ;Total 11 Characters DVOL PUSH H ;Save Registers PUSH B MVI C,COUT ;Output Character MOV E,M CALL BDOS POP B ;Restore Registers POP H INX H ;Increment Pointer DCR B ;Decrement Counter JNZ DVOL ;Not Finished? JMP ENDV ;Return to CP/M NOVOL MVI C,PSTR ;Output has no label LXI D,NOV CALL BDOS ENDV MVI C,COUT ;Output Extra Line Feed MVI E,LF CALL BDOS RET GETDR MVI C,GCD ;Get Current Disk CALL BDOS INR A ;Increment Accumulator RET ; FILE DB 'DISKETTEVOL' MSG DB LF,'Volume in drive $' NOV DB ' has no label$' YESV DB ' is $' ; END