Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Ralf Brown's Interrupt List (Part 1,2) - int 21 - dos 2+ - find first asciz (findfirst) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 21 - DOS 2+ - FIND FIRST ASCIZ (FINDFIRST)
        AH = 4Eh
        CX = search attributes (see AX=4301h)
        DS:DX -> ASCIZ filespec (drive, path, and wildcards allowed)
Return: CF set on error
            AX = error code (02h,12h) (see AH=59h)
        CF clear if successful
            [DTA] = data block (see below)
Notes:  for search attributes other than 08h, all files with at MOST the
          specified attribute bits, the archive (20h) bit, and the read-only
          (01h) bits set will be returned.  Under DOS 2.x, searching for
          attribute 08h (volume label) will also return normal files, while
          under DOS 3+ only the volume label (if any) will be returned.
        this call also returns successfully if given the name of a character
          device without wildcards.  DOS 2.x returns attribute 00h, size 0,
          and the current date and time.  DOS 3+ returns attribute 40h and the
          current date and time.
        under LANtastic, this call may be used to obtain a list of a server's
          shared resources by searching for "\\SERVER\*.*"; a list of printer
          resources may be obtained by searching for "\\SERVER\@*.*"
BUG:    under DOS 3.x and 4.x, the second and subsequent calls to this function
          with a character device name (no wildcards) and search attributes
          which include the volume-label bit (08h) will fail unless there is
          an intervening DOS call which implicitly or explicity performs a
          directory search without the volume-label bit.  Such implicit
          searches are performed by CREATE (AH=3Ch), OPEN (AH=3Dh), UNLINK
          (AH=41h), and RENAME (AH=56h)
SeeAlso: AH=11h,AH=4Fh,AX=4301h,INT 2F/AX=111Bh

Format of FindFirst data block:
Offset  Size    Description
---PCDOS 3.10, PCDOS 4.01, MSDOS 3.2/3.3---
 00h    BYTE    drive letter
 01h 11 BYTEs   search template
 0Ch    BYTE    search attributes
---DOS 2.x (and some DOS 3.x???)---
 00h    BYTE    search attributes
 01h    BYTE    drive letter
 02h 11 BYTEs   search template
---WILDUNIX.COM---
 00h 12 BYTEs   15-character wildcard search pattern and drive letter (packed)
 0Ch    BYTE    search attributes
---DOS 2.x and most 3.x---
 0Dh    WORD    entry count within directory
 0Fh    DWORD   pointer to DTA???
 13h    WORD    cluster number of start of parent directory
---PCDOS 4.01, MSDOS 3.2/3.3---
 0Dh    WORD    entry count within directory
 0Fh    WORD    cluster number of start of parent directory
 11h  4 BYTEs   reserved
---all versions, documented fields---
 15h    BYTE    attribute of file found
 16h    WORD    file time
                    bits 11-15: hour
                    bits 5-10:  minute
                    bits 0-4:   seconds/2
 18h    WORD    file date
                    bits 9-15:  year-1980
                    bits 5-8:   month
                    bits 0-4:   day
 1Ah    DWORD   file size
 1Eh 13 BYTEs   ASCIZ filename+extension

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson