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 / WILDEX.MAC < prev    next >
Text File  |  2000-06-30  |  947b  |  70 lines

  1. ;WILDEX - wildcard expansion module
  2. ; S. Kluger  04/15/84
  3. ;
  4. ; This module, for use with SYSLIB, can be used
  5. ; to expand a wildcard filename into a table of
  6. ; file names as found in current DU:
  7. ;
  8. ; ENTRY:
  9. ; HL = .buffer
  10. ; DE = .afn fcb
  11. ;
  12. ; EXIT:
  13. ; HL = number of files
  14. ; ACC= zero flag reset if ok, else error
  15. ; the buffer contains (HL) file names of 16 char each
  16. ;
  17. sfirst    equ    17
  18. snext    equ    18
  19. ;
  20.     extrn    bdos
  21. ;
  22.     public    wildex
  23. ;
  24. wildex:    shld    bufptr
  25.     lxi    h,0
  26.     shld    count
  27.     mvi    c,sfirst
  28.     call    bdos
  29.     cpi    0ffh
  30.     rz            ;nothing found -- error
  31.     call    moven        ;move name
  32. wloop:    mvi    c,snext        ;search for next
  33.     call    bdos
  34.     cpi    0ffh
  35.     jz    done        ;finished
  36.     call    moven
  37.     jmp    wloop
  38. ;
  39. done:    ora    a
  40.     lhld    count
  41.     ret
  42. ;
  43. moven:    push    d
  44.     lhld    bufptr
  45.     add    a
  46.     add    a
  47.     add    a
  48.     add    a
  49.     add    a
  50.     adi    80h
  51.     mov    c,a
  52.     mvi    b,0
  53.     mvi    d,16        ;move 16 chars
  54. movlp:    ldax    b
  55.     mov    m,a
  56.     inx    h
  57.     inx    b
  58.     dcr    d
  59.     jnz    movlp
  60.     shld    bufptr
  61.     pop    d
  62.     lhld    count
  63.     inx    h
  64.     shld    count
  65.     ret
  66. ;
  67. bufptr:    dw    0
  68. count:    dw    0
  69.     end
  70.