Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Int 21h Function 4Eh
 Detail Example                          Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Interrupt:   21h     Function:   4Eh
 
  Title:       Find First File
 
  See also:    Find Next File, Set DTA Address,
               DOS File Date/Time Formats, @GetFirst
 
  Description:
 
     Given a file specification in the form of an ASCIIZ string, this
     function searches the default or specified directory on the
     default or specified drive for the first matching file.
 
     Input                               Output
 
     AH = 4Eh                             If function unsuccessful (no
     CX = Attribute to use in search      matching files)
          (bits can be combined)            Carry flag: set
                                            AX = Error code (02h, 03h,
          Bits   Significance                    or 12h)
                 (if set)                   See: Error codes
 
          0      Read-only                If function successful
          1      Hidden                   (matching file found)
          2      System                     Carry flag: clear
          3      Volume label
          4      Directory                Disk transfer area (DTA)
          5      Archive                  filled in as follows:
          6-15   Reserved (0)
                                          Bytes     Description
     DS:DX = segment:offset of ASCIIZ
             path name                    00h-14h   Reserved (0)
                                          15h       Attribute of matched
                                                    file or directory
                                          16h-17h   Packed file time
                                          18h-19h   Packed file date
                                          1Ah-1Dh   File size
                                          1Eh-2Ah   ASCIIZ filename
                                    -♦-