home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / DISK3.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  1KB  |  44 lines

  1.     page    66,132
  2. ;******************************** DISK3.ASM  *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(  DISK   )
  14. FILE_COUNT - counts the number of files matching an ASCIIZ filespec string.
  15. ;
  16. ; inputs:    DS:[DX] pointing to filespec string
  17. ;            CX = file attributes
  18. ;            
  19. ; output:    AX = number of files matching the filespec string
  20. ;
  21. ; notes:     The filespec string may include the '*' and '?' wildcards.
  22. ;* * * * * * * * * * * * * *
  23. 
  24.     public    FILE_COUNT
  25. FILE_COUNT    PROC    FAR
  26.    push    bp
  27.    cld
  28.    XOR     BP,BP
  29.    MOV       AH,4Eh        ;find first file
  30. FC_01:
  31.    INT     21h
  32.    JB      FC_02
  33.    INC     BP
  34.    MOV       AH,4Fh        ;find next file
  35.    JMP     FC_01
  36. FC_02:
  37.    MOV     AX,BP
  38.    POP     BP
  39.    RETF
  40. FILE_COUNT    ENDP
  41.  
  42. LIBSEG    ENDS
  43.     end
  44.