System information

FUNCTION 34: WRITE RANDOM
Entry Parameters:
Register C: 22H
Registers DE: FCB Address
Returned Value:
Register A: Return Code
The Write Random operation is initiated similarly to the Read Random call, except that data is
written to the disk from the current DMA address. Further, if the disk extent or data block that is
the target of the write has not yet been allocated, the allocation is performed before the write
operation continues. As in the Read Random operation, the random record number is not
changed as a result of the write. The logical extent number and current record positions of the
FCB are set to correspond to the random record that is being written. Again, sequential read or
write operations can begin following a random write, with the notation that the currently
addressed record is either read or rewritten again as the sequential operation begins. You can also
simply advance the random record position following each write to get the effect of a sequential
write operation. Note that reading or writing the last record of an extent in random mode does not
cause an automatic extent switch as it does in sequential mode.
The error codes returned by a random write are identical to the random read operation with the
addition of error code 05, which indicates that a new extent cannot be created as a result of
directory overflow.
5.2 Call Conventions CP/M Operating System Manual
5-32