Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Assembly Language - <b>function 3fh (63) read from file or device, using a handle</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 3Fh (63)        Read from File or Device, Using a Handle

    Read bytes from a file or device into a buffer.

       On entry:      AH         3Fh
                      BX         File handle
                      CX         Number of bytes to read
                      DS:DX      Address of buffer

       Returns:       AX         Number of bytes read, or
                                 Error code, if CF is set

       Error codes:   5          Access denied
                      6          Invalid handle

                      Call Function 59h for extended error code information
                      (DOS 3.0 and above).

       Network:       Requires Read access rights

  --------------------------------------------------------------------------

    This function reads data from the file or device whose handle is in
    BX. Data is read starting at the location pointed to by the file
    pointer. The file pointer is incremented by the number of bytes read.

       Notes:         If the Carry Flag is not set and AX = 0, the file
                      pointer was at the end of the file when the function
                      was called.

                      If the Carry Flag is not set and AX is less than the
                      number of bytes requested, either the function read
                      to the end of the file, or an error occurred.

                      You can read bytes from anywhere in the file by
                      calling function 42h to move to file poniter before
                      reading data.

                      If the keyboard device is specified, this function
                      reads either the specified number of bytes, or all
                      bytes up to the next carriage return, whichever is
                      less. (If the number of bytes specified is at least
                      two larger than the number of characters typed, the
                      carriage-return line-feed pair will be returned as
                      the last two bytes, and will count as two bytes.)

See Also: 14h 21h 27h 42h 59h

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