home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn12h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.5 KB  |  27 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;       Function 12H: Find Next File, FCB-based              ;
  4.         ;                                                            ;
  5.         ;       int FCB_next(puXFCB)                                 ;
  6.         ;           char *puXFCB;                                    ;
  7.         ;                                                            ;
  8.         ;       Returns 0 if match found, otherwise returns -1.      ;
  9.         ;                                                            ;
  10.         ;       Note: The FCB must have the drive and                ;
  11.         ;       filename fields (bytes 07H through 12H) and          ;
  12.         ;       the extension flag (byte 00H) set before             ;
  13.         ;       the call to FCB_next (see Function 29H).             ;
  14.         ;                                                            ;
  15.         ;************************************************************;
  16.  
  17. cProc   FCB_next,PUBLIC,ds
  18. parmDP  puXFCB
  19. cBegin
  20.         loadDP  ds,dx,puXFCB    ; Pointer to unopened extended FCB.
  21.         mov     ah,12h          ; Ask MS-DOS to find next matching
  22.                                 ; file in current directory.
  23.         int     21h             ; If match found, directory entry can
  24.                                 ; be found at DTA address.
  25.         cbw                     ; Set return value to 0 or -1.
  26. cEnd
  27.