Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Function 40H (decimal 64) writes to the file or device associated with the
  handle in BX. CX specifies the number of bytes to be written; DS:DX points
  to the address of the data bytes.

  When the write operation is complete, function 40H updates the file
  pointer to point past the data just written.

  You must examine both the carry flag and the value in AX returned by
  function 40H to determine the success of the write operation:

  .  If the carry flag is clear and AX = CX, the operation completed
     successfully.

  .  If the carry flag is clear but AX < CX, then the output was written to
     a disk file that had insufficient disk space to complete the write
     operation.

  .  If the carry flag is set, AX contains an error code of 05H (access
     denied) or 06H (invalid handle).

  The fact that function 40H updates the file pointer has an interesting
  side effect: You can set the size of a file to any arbitrary value by
  executing function 40H with CX = 00H. The usual technique is to call
  function 42H to set the file pointer location and then to immediately call
  function 40H with CX = 00H to update the file size.

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