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 3Dh
 Detail Example                          Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Interrupt:   21h     Function:   3Dh
 
  Title:       Open File
 
  See also:    Close File, Extended Open File, Create File, @OpenFile
 
  Description:
 
     Given an ASCIIZ path name, the function opens the specified file
     in the designated or default directory on the designated or
     default disk drive. A handle is returned that can be used by the
     program for subsequent access to the file.
 
     Input                                   Output
 
     AH = 3Dh                                If function successful
     AL = Access mode                          Carry flag: clear
                                               AX = Handle
          Bits    Significance
                                             If function unsuccessful
          0-2     Access mode                  Carry flag: set
                  000 = read access            AX = Error code (02h, 03h,
                  001 = write access                04h, 05h, or 0Ch)
                  010 = read/write access      See: Error codes
          3       Reserved (0)
          4-6     Sharing mode
                  [Version 3.0+]
                  000 = compatibility mode
                  001 = deny all
                  010 = deny write
                  011 = deny read
                  100 = deny none
          7       Inheritance flag
                  [Version 3.0+]
 
     0 = Child process inherits handle
     1 = Child does not inherit handle
     DS:DX = segment:offset of ASCIIZ
             path name
                                    -♦-