en:docs:dos:api:int21:3f

Note: This API call is for DOS and Win16 personality only. Use Family API for portability.

2018/09/07 05:04 · prokushev · 0 Comments

Int 21H, AH=3FH

Version

2 and higher

Brief

“READ” - READ FROM FILE OR DEVICE

Family API

Input

      AH = 3Fh
      BX = file handle
      CX = number of bytes to read
      DS:DX -> buffer for data

Return

CF clear if successful

          AX = number of bytes actually read (0 if at EOF before call)
      CF set on error
          AX = error code (05h,06h) (see #01680 at AH=59h/BX=0000h)

Notes

data is read beginning at current file position, and the file position is updated after a successful read

the returned AX may be smaller than the request in CX if a partial read occurred

if reading from CON, read stops at first CR

under the FlashTek X-32 DOS extender, the pointer is in DS:EDX

BUG: Novell NETX.EXE v3.26 and 3.31 do not set CF if the read fails due to a record lock (see AH=5Ch), though it does return AX=0005h; this has been documented by Novell

See also

AH=27h,AH=40h,INT 2F/AX=1108h,INT 2F/AX=1229h

Note

2018/09/04 17:23 · prokushev · 0 Comments