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

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;               Function 4EH: Find First File                ;
  4.         ;                                                            ;
  5.         ;               int find_first(ppathname,attr)               ;
  6.         ;                   char *ppathname;                         ;
  7.         ;                   int  attr;                               ;
  8.         ;                                                            ;
  9.         ;               Returns 0 if a match was found,              ;
  10.         ;               otherwise returns error code.                ;
  11.         ;                                                            ;
  12.         ;************************************************************;
  13.  
  14. cProc   find_first,PUBLIC,ds
  15. parmDP  ppathname
  16. parmW   attr
  17. cBegin
  18.         loadDP  ds,dx,ppathname ; Get pointer to pathname.
  19.         mov     cx,attr         ; Get search attributes.
  20.         mov     ah,4eh          ; Set function code.
  21.         int     21h             ; Ask MS-DOS to look for a match.
  22.         jb      ff_err          ; Branch on error.
  23.         xor     ax,ax           ; Return 0 if no error.
  24. ff_err:
  25. cEnd
  26.