home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / sysutl / doslike.lbr / VOL.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-07-16  |  2.4 KB  |  99 lines

  1. ;********************************************
  2. ; Program Written by: HARRIS LANDSBERG  c1985
  3. ; Name: VOL.ASM  using standard 8080 ASM code
  4. ;
  5. ; Designed as a MS-DOS diskette volume indent
  6. ;   used in conjuction with LABEL.
  7. ;
  8. ; Comment: Will read file DISKETTE.VOL which
  9. ;   was created by LABEL program, and display
  10. ;   it to the CRT device. DISKETTE.VOL is a
  11. ;   hidden file for less detraction.
  12. ;
  13. ; Run: VOL [d:]
  14. ;********************************************
  15. BDOS    EQU    0005H    ;System Call Location
  16. DMA    EQU    0080H    ;DMA Buffer Location
  17. FCB    EQU    005CH    ;File Control Block
  18. SDMA    EQU    26    ;Set DMA Address
  19. GCD    EQU    25    ;Get Current Disk
  20. READ    EQU    20    ;Read Sequential Record
  21. SFF    EQU    17    ;Search For First
  22. OPEN    EQU    15    ;Open File Function
  23. COUT    EQU    2    ;Character Output
  24. PSTR    EQU    9    ;Print String Function
  25. NOTF    EQU    255    ;File Not Found
  26. TPA    EQU    0100H    ;Transient Program Area
  27. LF    EQU    10    ;Line Feed Charcter
  28.     ;
  29. VOL    ORG    TPA    ;Program Start
  30.     ;
  31.     MVI    C,SDMA    ;Set Buffer Location
  32.     LXI    D,DMA    ;At DMA Address
  33.     CALL    BDOS
  34.     MVI    C,PSTR    ;Output MSG to Console
  35.     LXI    D,MSG
  36.     CALL    BDOS
  37.     LXI    H,FCB    ;For Which Drive?
  38.     MOV    A,M
  39.     CPI    0    ;Default Drive
  40.     CZ    GETDR    ;Get Current Drive
  41.     ADI    40H    ;Upgrade to A,B,C etc.
  42.     MVI    C,COUT    ;Display to Console
  43.     MOV    E,A
  44.     CALL    BDOS
  45.     LXI    D,FCB+1 ;Start Move to position
  46.     LXI    H,FILE    ;Start Move from posit.
  47.     MVI    B,11    ;Total 11 Characters
  48. FNAME    MOV    A,M    ;From Mem to Accumulator
  49.     STAX    D    ;Put into FCB
  50.     INX    D    ;Increment Pointers
  51.     INX    H
  52.     DCR    B    ;Decrement Counter
  53.     JNZ    FNAME    ;Not Finished?
  54.     MVI    C,SFF    ;Set Search Directory
  55.     LXI    D,FCB    ;For First Call
  56.     CALL    BDOS
  57.     CPI    NOTF    ;Not Found?
  58.     JZ    NOVOL    ;Has no label
  59.     MVI    C,OPEN    ;Open "VOL" File
  60.     LXI    D,FCB
  61.     CALL    BDOS
  62.     MVI    C,READ    ;Read First Record
  63.     LXI    D,FCB
  64.     CALL    BDOS
  65.     MVI    C,PSTR    ;Output Second string
  66.     LXI    D,YESV
  67.     CALL    BDOS
  68.     LXI    H,DMA    ;Start of Record
  69.     MVI    B,11    ;Total 11 Characters
  70. DVOL    PUSH    H    ;Save Registers
  71.     PUSH    B
  72.     MVI    C,COUT    ;Output Character
  73.     MOV    E,M
  74.     CALL    BDOS
  75.     POP    B    ;Restore Registers
  76.     POP    H
  77.     INX    H    ;Increment Pointer
  78.     DCR    B    ;Decrement Counter
  79.     JNZ    DVOL    ;Not Finished?
  80.     JMP    ENDV    ;Return to CP/M
  81. NOVOL    MVI    C,PSTR    ;Output has no label
  82.     LXI    D,NOV
  83.     CALL    BDOS
  84. ENDV    MVI    C,COUT    ;Output Extra Line Feed
  85.     MVI    E,LF
  86.     CALL    BDOS
  87.     RET
  88. GETDR    MVI    C,GCD    ;Get Current Disk
  89.     CALL    BDOS
  90.     INR    A    ;Increment Accumulator
  91.     RET
  92.     ;
  93. FILE    DB    'DISKETTEVOL'
  94. MSG    DB    LF,'Volume in drive $'
  95. NOV    DB    ' has no label$'
  96. YESV    DB    ' is $'
  97.     ;
  98.     END
  99.