Chapter
1
I
System
Calls
RBRead
Random
Block
Read Function Call
27H
Reads the specified number of records (calculated from the re-
cord size field
at
offset 0EH of the FCB), starting at the record
specified by the relative record field (offset 21H). The records are
placed
at
the Disk Transfer Address. The current block (offset
BCH), current record (offset 20H), and relative record (offset
21H) fields are set to address the next record.
If the number of records
to
read is specified as zero, the call re-
turns without reading any records (no operation).
Entry Conditions:
AH
=
27H
CX
=
number of records to read
DS:DX
=
pointer to the opened
FCB
of the file to read
E
xi t Conditions
:
CX
=
actual number of records read
If AL
=
00H, all records were read successfully.
IfAL
=
01H, end of file was encountered before all records were
read; the last record is complete.
IfAL
=
02H, wrap-around above address FFFFH in the disk
transfer segment would occur if all records were read;
therefore, only as many records were read as was possi-
ble without wrap-around.
If AL
=
03H, end of file was encountered before all records were
read; the last record is partial.
Macro
Definition:
ran-block-read macro fcb,count,rec_5ize
mov
dx,offsetfcb
mov
cx, coun
t
mov
wordptr fcb[l41,rec_5ize
mov
ah,27H
int 21
H
endm
78