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 28h (40) random block write, using fcbs</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 28h (40)        Random Block Write, Using FCBs

    Writes one or more records from the current Disk Transfer Address to a
    file.

       On entry:      AH         28h
                      CX         Number of records to write
                      DS:DX      Pointer to an opened FCB

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

       Network:       Requires Write access rights

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

    This function writes the number of records specified by CX, starting
    at the file offset specified by random-record (offset 21h) and record-
    size (0Eh) fields of the FCB. The current block and current record
    fields are set to reflect the random-record field, and the records are
    written to the file from the current DTA.

       Notes:         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 records being written don't fill an entire
                      sector, DOS buffers the data for an eventual write
                      when a full sector's worth of data is accumulated.

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

                      If you specify a value of 0 in CX, the function
                      writes no records, but it adjusts the file's length
                      to the position of the specified random record. This
                      is useful if you have logically deleted records at
                      the end of the file, since it enables you to
                      truncate the file appropriately and free up disk
                      space.

See Also: 15h 1Ah 22h 40h

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