You are here : assembly8086 INT 21HAH3FH

AH=3FH - 8086 INT 21H

AH = 3Fh - "READ" - READ FROM FILE OR DEVICE

Entry:

  • 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)

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


Syntax

MOV AH,3FH
INT 21H


Example

MOV AH,3FH
INT 21H


Output / Return Value

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)


Limitations


Alternatives / See Also


Reference