User`s guide
Upon return, the Read Random function sets register A to zero if the read opera-
tion was successful. Otherwise, register A contains one of the following error codes:
01 Reading unwritten data (end-of-file)
03 Cannot close current extent
04 Seek to unwritten extent
06 Random record number out of range
10 Media change occurred
255 Physical Error : refer to register H
Error Code 01 is returned if no data exists at the next record position of the file.
Usually, the no data situation is encountered at the end of a file. However, it can
also occur if an attempt is made to read a data block that has not been previously
written.
Error Code 03 is returned when the Read Random function cannot close the
current extent prior to moving to a new extent.
Error Code 04 is returned when a read random operation accesses an extent that
has not been created.
Error Code 06 is returned when byte 35, r2, of the referenced FCB is greater than
3.
Error Code 10 is returned if a media change occurs on the drive after the refer-
enced FCB is activated by a BDOS Open or Make Call.
Error Code 255 is returned if a physical error is encountered, and the BDOS error
mode is one of the return modes (see Function 45). If the error mode is the default
mode, a message identifying the physical error is displayed at the console, and the
calling program is terminated. When a physical error is returned to the calling pro-
gram, register H contains one of the following error codes:
01 Disk I/O error
04 Invalid drive error
On all error returns except for physical errors, A = 255, the Read Random
function sets register H to the number of records successfully read before the error is
encountered. This value can range from 0 to 127 depending on the current BDOS
Multi-Sector Count. It is always set to zero when the Multi-Sector Count is equal to
one.
3-49
BDOS Function Calls CP/M 3 Programmers Guide