home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBODSG / EMPTY.MAC < prev    next >
Text File  |  2000-06-30  |  1KB  |  79 lines

  1. ; EMPTY.MAC by ESKAY - v1.00 of 05/30/85
  2. ;
  3. ; this program finds all empty user areas on the current
  4. ; drive and displays them. turbodos only.
  5. ;
  6. cr    equ    0dh
  7. lf    equ    0ah
  8. ;
  9.     cseg
  10. ;
  11. .z80
  12. .request syslib
  13. ;
  14. start:    ld    sp,stack
  15.     call    print##
  16.     cr,lf
  17.     'EMPTY v1.10 by ESKAY shows free user areas:',cr,lf,0
  18.     ld    de,fcb
  19.     call    f$open##
  20. ..lp:    ld    de,fcb
  21.     call    f$read##
  22.     jp    nz,done
  23.     ld    ix,80h
  24.     ld    hl,usrs
  25.     ld    a,(ix+0)
  26.     call    zeru
  27.     ld    a,(ix+20h)
  28.     call    zeru
  29.     ld    a,(ix+40h)
  30.     call    zeru
  31.     ld    a,(ix+60h)
  32.     call    zeru
  33.     jr    ..lp
  34. ;
  35. done:    ld    b,32
  36.     ld    c,16        ; 16 to a line max.
  37. ..dl:    ld    a,(hl)
  38.     cp    0ffh
  39.     call    nz,du
  40.     inc    hl
  41.     djnz    ..dl
  42.     call    print##
  43.     cr,lf,lf,0
  44.     rst    0
  45. ;
  46. du:    push    af
  47.     cp    10
  48.     jr    nc,..dus
  49.     ld    a,' '
  50.     call    cout##
  51. ..dus:    pop    af
  52.     call    pafdc##
  53.     ld    a,' '
  54.     call    cout##
  55.     dec    c
  56.     jp    z,crlf##
  57.     ret
  58. ;
  59. zeru:    cp    0e5h
  60.     ret    z
  61.     ld    e,a
  62.     ld    d,0
  63.     push    hl
  64.     add    hl,de
  65.     ld    (hl),0ffh
  66.     pop    hl
  67.     ret
  68. ;
  69.     dseg
  70. ;
  71. fcb:    db    0,'$       DIR',0,0,0,0
  72.     ds    22
  73. ;
  74. usrs:    db    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
  75.     db    16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
  76.     ds    100
  77. stack    equ    $
  78.     end
  79.