Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>function 22h (34) random write, using fcbs</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 22h (34)        Random Write, Using FCBs

    Writes the specified record in the current DTA to a file.

       On entry:      AH         22h
                      DX:DS      Pointer to an opened FCB

       Returns:       AL         00h       If write was successful
                                 01h       If disk full
                                 02h       If DTA too small (segment wrap)

       Network:       Requires Write access rights

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

    This function writes the record specified by the random-record field
    (offset 21h) and the record-size field (offset 0Eh) of the FCB. The
    current block and current record fields are set to reflect the random-
    record field, and the record is written to the file from the current
    Disk Transfer Address.

       Notes:         The random-record field is not updated after this
                      function. It is your program's responsibility to set
                      this field each time it calls this function.
                      Function 28h, which is similar to this function,
                      will automatically update the random-record field.
                      (Function 28h can also write multiple records.)

                      The data to be written is taken from the current
                      Disk Transfer Address (DTA). Use Function 1Ah to set
                      the DTA. If the transfer of data would cause segment
                      wraparound, an error 2 is generated.

                      If the record written doesn't fill an entire sector,
                      DOS buffers the data for an eventual write when a
                      sector's worth of data is accumulated.

                      If the file specified has the read-only attribute
                      set, the write is not performed.

See Also: 15h 1Ah 28h 40h

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