home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / dirutl / zdr.lbr / ZDR.AQM / ZDR.ASM
Encoding:
Assembly Source File  |  1985-09-04  |  15.3 KB  |  641 lines

  1. ;              ZDR2.ASM
  2. ;Small, horizontal directory.  Sorts directory
  3. ;entries alphabetically, and presents them in
  4. ;horizontal order.  The "Z" of zdr shows the path 
  5. ;of the cursor. Will take disk specification on 
  6. ;command line:
  7. ;    A>zdr B:
  8. ;Understands user specifications in ZCPR style also:
  9. ;    A>zdr D2:
  10. ;When other disks(D) or users(U) are selected, zdr
  11. ;returns to the original DU: on exit.  If a user
  12. ;is specified, zdr shows the files in that user
  13. ;# only, though it continues to show total disk
  14. ;space, that is, space for the entire disk, all 
  15. ;users.  The object file is less than 1k in size, 
  16. ;and zdr is particularly useful when disk space is 
  17. ;limited, as in the Epson Geneva PX-8.
  18. ;
  19. ;Mike Yarus, 2231 16th Street, Boulder, CO 80302
  20. ;Compuserve 73145,513            July, 1985
  21. ;
  22. cnout    equ    02h    ;BDOS functions
  23. pstr    equ    09h    ;    |
  24. seldsk    equ    0Eh    ;    |
  25. schfrst    equ    11h    ;    |
  26. schnext    equ    12h    ;    |
  27. getdsk    equ    19h    ;    |
  28. allocv    equ    1Bh    ;    |
  29. dpbaddr    equ    1Fh    ;    |
  30. usernr    equ    20h    ;_______v______
  31. cr    equ    0Dh
  32. lf    equ    0Ah
  33. tab    equ    09h
  34. tpastrt    equ    0100h
  35. bdos    equ     0005h
  36. fcb    equ    05Ch
  37. dma    equ    080h
  38. dummy    equ    0000h    ;marks run time addr
  39.             ;
  40.     org     tpastrt
  41.             ;
  42. ;current disk and user number data
  43.             ;
  44.     mvi    c,usernr
  45.     mvi    e,0FFh    ;get user #
  46.     call     bdos    ;and store it
  47.     sta    initusr    ;for possible change
  48.             ;
  49.     mvi    c,getdsk;get current disk
  50.     call    bdos
  51.     sta    initdsk    ;store current disk
  52.             ;
  53. ;new disk and/or user number?
  54.             ; 
  55.     lda    fcb    ;get disk, CPM-style
  56.     cpi    0    ;default?
  57.     jnz    drv    ;no, disk change needed
  58.             ;also check ZCPR spec
  59.     lda    fcb+2    ;check user, ZCPR-style
  60.     cpi    ' '    ;blank?
  61.     jz    fillfcb    ;yes, no change needed
  62.     sui    30h    ;no, convert user to hex
  63.     mov    e,a    ;reset user
  64.     mvi    c,usernr
  65.     call    bdos    ;switch!
  66.             ;
  67.     lda    fcb+1    ;get disk, ZCPR-style
  68.     sui    40h    ;1=A:, 2=B:, etc.
  69.             ;
  70. drv    sui    1    ;calc disk #
  71.     mov    e,a    ;0=A:, 1=B:, etc.
  72.     mvi    c,seldsk;select new disk
  73.     call    bdos    ;switch!
  74.             ;    
  75. fillfcb    lxi    h,ambgfcb    ;write the ambiguous
  76.     lxi    d,ambgfcb+10h    ;fcb to search directory
  77.     lxi    b,fcb+1        ;CP/M did drive at fcb
  78.     call     movbyte    ;move 'em!
  79.             ;
  80. ;block size data for cases different from 1k
  81.             ;
  82.     mvi    c,dpbaddr
  83.     call    bdos    ;dpb addr in hl
  84.     lxi    d,02h    ;offset to block shift
  85.     dad    d    ;BSH addr in hl
  86.     mov    a,m    ;BSH in a
  87.     sui    3h    ;0=1k, 1=2k, 2=4k,...
  88.     xchg        ;dpb+2 -> de
  89.     cma
  90.     adi    1    ;-block power in a
  91.     lxi    h,times1;addr for x 1
  92.     add    l
  93.     mov    l,a    ;addr for x block size
  94.     shld    mult+1    ;jmp addr at run time
  95.     xchg        ;dpb+2 back
  96.     inx    h    ;dpb+3, addr BLM
  97.     mov    a,m    ;get BLM
  98.     inr    a    ;BLM+1 = sectors/block
  99.     rrc!rrc!rrc    ;(BLM+1)/8 = k/block
  100.     sta    blksiz    ;store block size in k
  101.             ;
  102. ;begin directory search 
  103.             ;
  104. getdir    lda    dirfn    ;search first or next
  105.     mov    c,a    
  106.     lxi    d,fcb    
  107.     call     bdos    ;fill dma w/ dir
  108.     cpi    0FFh    ;done?
  109.     jz    eotbl    ;yes, terminate table
  110.             ;
  111. ;calculate address of the directory entry
  112.             ;
  113.     add a!add a!add a!add a!add a    ;code*32
  114.     adi    dma    ;addr dir entry in a
  115.             ;
  116. ;read the directory entry
  117.             ;
  118.     mov    c,a    ;lo nibble, address
  119.     mvi    b,0    ;hi nibble zeroed
  120.     ldax    b    ;file name or user byte
  121.     cpi    0E5h    ;erased?
  122.     jz     setdirf    ;yes, ignore entry
  123. fname    inx    b    ;no, get next addr
  124.     ldax    b    ;get char
  125.     ani    7Fh    ;mask hi bit
  126.     cpi    20h    ;is this a char?
  127.     jm    extent    ;not char, its the extent
  128.     call    mktable    ;add to directory table
  129.     jmp     fname    ;around again
  130.             ;
  131. ;get extent and calculate size of the file
  132.             ;
  133. extent    add a!add a!add a!add a    ;# extents*16 = k
  134.     mov    d,a        ;k in extents -> d
  135.     inx b!inx b!inx b    ;addr of # records
  136.     ldax    b    ;get # records, this extent
  137.             ;
  138. ;a -> records/8, round up,= #k, add to extents
  139.             ;
  140.     rrc ! rrc ! rrc    ;records div 8, sort of
  141.     mov    b,a    ;save a
  142.     ani    0E0h    ;remainder? mask 11100000b
  143.     mov    a,b    ;a back, flags same
  144.     jz     thru    ;no remainder
  145.     adi    1    ;remainder, round up
  146. thru    ani    1Fh    ;a has #k in records
  147.     add    d    ;+k in extents
  148.             ;file size in a
  149.     call     block    ;correct to data block size
  150.     call    mktable    ;add to directory table
  151.             ;tally the entry
  152.     lda    count    ;total dir entries so far
  153.     inr    a    ;+ 1
  154.     sta    count    ;re-store
  155.             ;reset dirfn
  156. setdirf    mvi    a,schnext
  157.     sta    dirfn    ;search for next
  158.     jmp    getdir    ;next entry!
  159.             ;
  160. ;got all entries, write "end of table" into dirtbl
  161.             ;
  162. eotbl    mvi    a,60h    ;put in string of 60h
  163.     mvi    b,60h-0Ch    ;counter set
  164. mo    call     mktable    ;one 60h to dirtbl
  165.     inr    b    ;counter incremented
  166.     cmp    b    ;= a yet?
  167.     jnz    mo    ;no, move another byte
  168.             ;
  169. ;sort list of strings of length nrchar
  170. ;# strings is in location -> count
  171. ;de - address of string #2
  172. ;hl - address of string #1
  173.             ;
  174. listhed    call     init    ;counters = 0, get top addr
  175. strcomp    lda    entries    ;# directory entries done
  176.     inr    a
  177.     sta    entries
  178.     mov    b,a    ;test for end of table
  179.     lda    count    ;tot entries in table
  180.     cmp    b    ;done?
  181.     jz    endchk    ;yes, check for sort end
  182.     jm    stats    ;no entries, give disk size
  183.             ;
  184.     call     stradd    ;get string addresses
  185.     call     compar    ;compare them, nrchar=12
  186.     jm    next    ;a=0, str =: a>0, str #1 bigger
  187.             ;
  188.     call    stradd    ;#1 bigger, interchange them
  189.     call     switch    ;does it
  190.     lda    swnr
  191.     inr    a
  192.     sta    swnr    ;count the switch
  193.             ;
  194. next    call     nextstr    ;incr string addresses
  195.     jmp    strcomp    ;do next string
  196.             ;
  197. endchk    lda    swnr    ;# exchanges
  198.     ora    a    ;is it 0?
  199.     jnz    listhed    ;no, init another round
  200.             ;yes, print the ordered list
  201.             ;
  202. ;print a sorted list of directory entries
  203. ;have been sorted alfa, and also w/ increasing file size
  204. ;print when two successive file names DIFFER
  205. ;in order to handle multiple extents of the same file
  206.             ;
  207.     mvi    a,0Bh    ;11d
  208.     sta    nrchar    ;compar 11 char strings
  209.             ;
  210.     call    init    ;entries=0, string1->dirtbl
  211. nxtntry    lhld    string1    ;load address
  212.     mov    a,m    ;get first char, str #1
  213.     cpi    60h    ;is it the end of table?
  214.     jz    stats    ;yes, do space output 
  215.             ;
  216.     call    stradd    ;str addresses
  217.     call    compar    ;1st 11 char of str same?
  218.     cnz    writit    ;no, differ, write them
  219.     call    nextstr    ;incr addresses
  220.     jmp    nxtntry    ;another entry
  221.             ;
  222. ;disk size and usage section
  223.             ;
  224. stats    call     eol    ;after all files
  225.     mvi    c,getdsk;current disk
  226.     call    bdos    ;get it
  227.     adi    41h    ;make ascii
  228.     call    print    ;write disk
  229.     lxi    d,dskstr
  230.     call     prntstr    ;disk title
  231.             ;
  232. ;calc total disk space from the disk param block
  233.             ;
  234.     mvi    c,dpbaddr    ;get DPB address
  235.     call     bdos    ;addr in hl
  236.     lxi    d,05h    ;offset for DSM
  237.     dad    d    ;hl -> addr DSM
  238.     call     getwd    ;(hl) -> hl
  239.     inx    h    ;# data blocks in hl
  240.     shld    tot    ;store # blocks/disk
  241.             ;
  242.     call    mult    ;multiply by block size
  243.     call     decimal    ;#k total output from hl
  244.     lxi    d,totstr
  245.     call    prntstr    ;tot title
  246.             ;
  247. ;find the address of the allocation vector, 
  248. ;then read the bit map and mask out the space 
  249. ;allocation for the disk.  Uses word arithmetic
  250. ;for total space.
  251. ;
  252. ;a-the bit mask, tests
  253. ;hl-address of bytes to be masked, the bit map
  254.             ;
  255. getvect    mvi    c,allocv
  256.     call    bdos
  257.             ;have the alloc addr in hl
  258.     lda    mask    ;get the byte mask, 1h
  259. abyte    mov    b,m    ;get a byte
  260.     inx    h    ;addr of next byte
  261.             ;
  262. bitloop    rrc        ;shift mask right
  263.     sta    mask    ;store mask
  264.     ana    b    ;bit set?
  265.     cnz    nralloc    ;yes, count this one
  266.     push    h    ;save addr of bit map
  267.     call    totnr    ;increment total, de<- totgrps
  268.             ;
  269.     lhld    tot    ;hl <- groups/disk
  270.     call     equal    ;done? if a=0, were equal
  271.     pop    h    ;get addr back
  272.     ora    a    ;a=0?
  273.     jz    done    ;yep, done
  274.             ;o'wise, do another group
  275.     lda     mask    ;get mask back
  276.     cpi    1    ;masked the last bit?
  277.     jz    abyte    ;yes,get another byte, mask=1
  278.     jmp     bitloop    ;another bit
  279.             ;
  280. done    lhld    alcgrps    ;get allocated groups
  281.     call    mult    ;multiply by block size
  282.     call     decimal    ;output!
  283.     lxi    d,usedstr
  284.     call     prntstr    ;print used title
  285.             ;
  286.     lhld    alcgrps    ;get allocated
  287.     call     neghl    ;negate it, 2's complement
  288.     xchg        ;-alcgrps to de
  289.     lhld    totgrps    ;get tot grps/disk
  290.     dad    d    ;space word in hl
  291.             ;
  292.     call     mult    ;multiply by block size
  293.     call     decimal    ;output!
  294.     lxi    d,lftstr
  295.     call     prntstr    ;print remains title
  296.             ;
  297. ;reset to original disk and user, in case changed
  298.             ;
  299.     mvi    c,usernr
  300.     lda    initusr    ;load original user #
  301.     mov    e,a
  302.     call     bdos    ;switch!
  303.             ;
  304.     mvi    c,seldsk
  305.     lda    initdsk    ;select init disk
  306.     mov    e,a
  307.     call     bdos    ;switch!
  308.             ;done
  309. back    ret        ;back to CP/M <<< END, MAIN
  310.             ;
  311. ;format and write one dir entry to the screen
  312. ;gets address of string stored at string1
  313. ;writes 11 char, then file size thru "decimal"
  314.             ;
  315. writit    lxi    d,estr    ;'> ' before entries
  316.     call     prntstr    ;write it
  317.             ;
  318.     lhld    string1    ;load the address
  319.     mov    b,h
  320.     mov    c,l    ;set up for writit
  321.     lxi    d,0Bh    ;set counter, d=0, e=11
  322.             ;
  323. nextchr    ldax    b    ;get char
  324.     inx    b    ;next get
  325.     call    print    ;write it
  326.     inr    d    ;increment char count
  327.     mov    a,e    ;# char -> a
  328.     cmp    d    ;whole name yet?
  329.     jnz    nextchr    ;no, another char
  330.     ldax    b    ;get size of file
  331.             ;
  332.     mvi    h,0    ;set up
  333.     mov    l,a    ;for output
  334.     call    decimal    ;and do it
  335.             ;
  336.     lxi    d,kstr
  337.     call    prntstr    ;'k ' out
  338.             ;
  339.     lda    entries    ;total dir entries so far
  340.     inr    a    ;+ 1
  341.     sta    entries    ;re-store
  342.             ;
  343. ;format output into lines with four files/line
  344.             ;
  345.     ani    3    ;00000011b mask
  346.     cz    eol    ;eol if a mod 4 = 0
  347.     ret        ;end of entry
  348.             ;
  349. ;string comparison routine, compares "nrchar" bytes
  350. ;h - address of string #1 < on exit = addr of difference
  351. ;d - address of string #2 < or addr after string, if =.
  352. ;b - counter < on exit, has # chars compared
  353. ;a=0, strings same: a>0, #1 bigger: a<0, #2 bigger
  354. ;flags also set to indicate result & can be used
  355.             ;
  356. compar    mvi    b,0    ;set byte counter
  357. compar1    mov    a,m    ;str #1 char -> a
  358.     xchg        ;#2 addr -> hl
  359.     mov    c,m    ;str #2 char -> c
  360.     inr    b    ;incr counter
  361.     sub    c    ;a=c?, strings same?
  362.     rnz        ;no
  363.     xchg        ;keep #1 in hl
  364.     inx    d
  365.     inx    h    ;incr string addresses
  366.             ;
  367.     lda    nrchar    ;# char to check
  368.     sub    b    ;done?
  369.     jnz    compar1    ;no
  370.     ret        ;yes
  371.             ;
  372. ;exchange two strings of bytes of the coded length
  373. ;de - address of string #2
  374. ;hl - address of string #1
  375. ;b - counter
  376.             ;
  377. switch    mvi    b,0    ;initialize counter
  378. switch1    mov    c,m    ;str #1 char -> c
  379.     ldax    d    ;str #2 char -> a
  380.     mov    m,a    ;str #2 char -> #1
  381.     mov    a,c    ;#1 char -> a
  382.     stax    d    ;#1 char -> #2
  383.             ;
  384.     inx    d
  385.     inx    h    ;incr addresses
  386.     inr    b    ;incr byte counter
  387.     mov    a,b    ;get counter
  388.     cpi    12d    ;12 char done?
  389.     jnz    switch1    ;no
  390.     ret        ;move done
  391.             ;
  392. ;set up string #1 and string #2 addr for sort or compar
  393.             ;
  394. stradd    lhld    string1    ;get current
  395.     lxi    d,0Ch    ;str offset
  396.     dad    d    ;get str #2 addr
  397.     xchg
  398.     lhld    string1    ;get str #1 addr
  399.     ret        ;return
  400.             ;
  401. ;initialize for sort or print of sorted list
  402.             ;
  403. init    xra    a    ;a=0
  404.     sta     entries ;directory counter
  405.     sta    swnr    ;# switches, for sort
  406.     lxi    h,dirtbl
  407.     shld    string1    ;address of current string
  408.     ret        ;
  409.             ;
  410. ;increment string address
  411.             ;
  412. nextstr    lhld    string1    ;get current
  413.     lxi    d,0Ch    ;offset between str
  414.     dad    d
  415.     shld    string1    ;put back
  416.     ret        ;done
  417.             ;
  418. ;print char in a to console, save b and d
  419.             ;
  420. print    push    b    ;save b
  421.     push    d    ;save d
  422.     mov    e,a    ;posn to go -> cons
  423.     mvi    c,cnout    ;bdos #2
  424.     call     bdos
  425.     pop    d    ;d back
  426.     pop    b    ;b back
  427.     ret        ;done
  428.             ;
  429. ;bdos #9, print string at d, terminated by $
  430.             ;
  431. prntstr    mvi    c,pstr
  432.     call     bdos
  433.     ret        ;done
  434.             ;
  435. eol    lxi    d,crlf
  436.     call    prntstr
  437.     ret        ;crlf at line end done
  438.             ;
  439. ;relocate the bytes beginning at  hl
  440. ;          bytes end + 1   at  de
  441. ;            to addr   at  bc
  442.             ;
  443. movbyte    mov    a,m    ;get a byte
  444.     stax    b    ;put byte to bc
  445.     inx    b    ;increment put addr
  446.     inx    h    ;increment get addr
  447.             ;
  448.     mov    a,h    ;hi nibble, get addr
  449.     cmp    d    ; = hi nibble, end?
  450.     jnz    movbyte    ;no, move another byte
  451.             ;
  452.     mov    a,l    ;lo nibble, get addr
  453.     cmp    e    ; = lo nibble, end?
  454.     jnz    movbyte    ;no, move another byte
  455.             ;
  456.     ret        ;done w/ move
  457.             ;
  458. ;gets file size in a in kbytes, calculates real size
  459. ;in a by adjusting to end on block borders
  460.             ;
  461. block    mov    b,a    ;size in k -> b
  462.     lda     blksiz    ;get block size
  463.     dcr    a    ;mod mask
  464.     cma        ;complement of mask
  465.     mov    c,a    ;store
  466.     cma        ;mask back
  467.     ana    b    ;siz mod block = 0?
  468.     mov    a,b    ;get the number
  469.     rz        ;yes, return size unchanged
  470.     lda    blksiz    ;get block size
  471.     add    b    ;add one block to size
  472.     ana    c    ;mask off remainder
  473.     ret        ;done
  474.             ;
  475. ;output the hex number in hl as a decimal w/ lead blks
  476. ;puts the number in space 3 wide
  477.             ;
  478. decimal    mvi    b,0FFh    ;set counter to -1
  479.             ;
  480. cento    lxi    d,-100    ;100's
  481.     dad    d    ;hl - 100d
  482.     inr    b    ;count it
  483.     mov    a,h
  484.     ani    80h    ;result negative? if a=0, no.
  485.     jz    cento    ;another 100?
  486.             ;
  487.     mov    a,b    ;get 100's
  488.     sta    cs    ;store them
  489.     mvi    b,0FFh    ;reset counter to -1
  490.     lxi    d,100
  491.     dad    d    ;reset number
  492.             ;
  493. deci    lxi    d,-10    ;10's
  494.     dad    d
  495.     inr    b
  496.     mov    a,h    ;negative result?
  497.     ani    80h
  498.     jz    deci    ;no, another 10?
  499.             ;
  500.     mov    a,b    ;get 10's
  501.     sta    ts    ;store
  502.     lxi    d,10
  503.     dad    d    ;1's in hl
  504.             ;
  505.     mov    a,l    ;get 1's
  506.     sta    os    ;store them
  507.             ;
  508.     lda    cs
  509.     call     prdeci    ;100's
  510.     lda    ts
  511.     call     prdeci    ;10's
  512.     lda    os
  513.     call     prdeci    ;1's
  514.             ;
  515.     xra    a    ;zero to reset the
  516.     sta    zflag    ;print zeros flag
  517.     ret
  518.             ;
  519. ;print decimal digit in a unless it is a leading zero
  520. ;when it will be a blank
  521.             ;
  522. prdeci    mov    d,a    ;save nr
  523.     xri    0    ;is the number a zero?
  524.     jz    zero    ;yes
  525.     mvi    a,1    ;set zflag after 1st non-0
  526.     sta    zflag    ;now printing zeros
  527.     jmp     pr    ;get nr back, print
  528.             ;
  529. zero    lda    zflag    ;print a zero?
  530.     ora    a    ;0 = no
  531.     jnz    pr    ;yes, print
  532.             ;no, not printing 0's
  533.     mvi    a,' '    ;use a blank
  534.     jmp     ready    ;out the blank
  535.             ;
  536. pr    mov    a,d    ;get nr back
  537.     adi    30h    ;make into ascii
  538. ready    call     print    ;out, note bc saved
  539.     ret
  540.             ;
  541. ;multiply the word in hl by 1,2,4,8,16 in order
  542. ;to calculate space for group size <> 1k
  543.             ;
  544. mult    jmp    dummy    ;replaced at run time
  545.     dad    h    ;x 16k
  546.     dad    h    ;x 8k
  547.     dad    h    ;x 4k
  548.     dad    h    ;x 2k
  549. times1    equ    $    ;x 1k
  550.     ret
  551.             ;
  552. ;increment allocated groups, preserve hl
  553.             ;
  554. nralloc    push    h    ;save addr in hl
  555.     lhld    alcgrps
  556.     inx    h
  557.     shld    alcgrps
  558.     pop    h
  559.     ret        ;return
  560.             ;
  561. ;increment total groups, return totgrps in de
  562.             ;
  563. totnr    lhld    totgrps
  564.     inx    h
  565.     shld    totgrps
  566.     xchg        ;totgrps -> de
  567.     ret        ;return
  568.             ;
  569. ;test equality of two words in de and hl
  570. ;return a = 0 for equality, no difference
  571. ;return a <> 0 for non-equality, is a difference
  572.             ;
  573. equal    mov    a,d    ;get hi nibble, de
  574.     sub    h    ;a=h?
  575.     rnz        ;no, return
  576.     mov    a,e    ;get lo nibble
  577.     sub    l    ;lo nibbles =?
  578.     ret        ;0 if =, <>0 if not equal
  579.             ;
  580. ;load hl with word at address in hl, addr+1 -> de
  581.             ;
  582. getwd    mov    e,m    ;lo nibble into e
  583.     inx    h    ;next byte
  584.     mov    d,m    ;hi nibble into d
  585.     xchg        ;de <--> hl
  586.     ret        ;addr+1 in de
  587.             ;
  588. ;negate the word in hl, ie, take 2's complement
  589.             ;
  590. neghl    mov    a,l    ;get lo nibble
  591.     cma        ;complement it
  592.     mov    l,a    ;back
  593.     mov    a,h    ;get hi nibble
  594.     cma        ;complement
  595.     mov    h,a    ;back
  596.     inx    h    ;+1
  597.     ret        ;-hl in hl
  598.             ;
  599. ;write byte in a to the growing directory table
  600.             ;
  601. mktable    lhld    tbladdr    ;get current address
  602.     mov    m,a    ;store the current entry
  603.     inx    h    ;incr addr
  604.     shld    tbladdr    ;restore addr
  605.     ret
  606.             ;
  607. ambgfcb    db    '????????????',0,0,0    ;ambiguous fcb
  608.             ;
  609. dirfn    db    schfrst    ;search for first, init
  610. tot    dw    0000    ;allocation blocks per disk
  611. totgrps    dw    0000    ;total groups counted
  612. alcgrps    dw    0000    ;allocated groups counted
  613.             ;
  614. mask    db    1    ;the byte mask
  615. count    db    00    ;# dir entries, # output
  616. entries    db    00    ;dir entry counter
  617. nrchar    db    0Ch    ;# char to compar
  618. swnr    db    00    ;# of switches during sort
  619. string1    dw    dirtbl    ;addr of current dir string
  620.             ;
  621. initdsk    ds    1    ;initial disk: 0=A:, 1=B:, etc
  622. initusr    ds    1    ;initial user #
  623. blksiz    ds    1    ;block size
  624.             ;
  625. estr    db    '> $'    ;pre-entry string
  626. kstr    db    'k $'    ;k title
  627. crlf    db    cr,lf,'$'
  628. dskstr    db    ': $'
  629. usedstr    db    'k used >>$'
  630. totstr    db    'k total/$'
  631. lftstr    db    'k left$'
  632. zflag    db    00    ;print zero? 0 = no, 1= yes
  633. cs    db    00    ;100's    
  634. ts    db    00    ;10's
  635. os    db    00    ;1's
  636.             ;
  637. tbladdr    dw    dirtbl    ;current value of table address
  638. dirtbl    equ    $    ;start here, grow up!
  639.             ;
  640.     end
  641.