Chapter
1
I
System Calls
RB
Wr
i
t
e
Random
Block
Write
Function
Call
28H
Writes
the
specified number
of
records (calculated from the re-
cord size field at offset 0EH of the FCB) from the Disk Transfer
Address. The records are written to the file starting at the re-
cord specified in the relative record field (offset 21H). The cur-
rent block (offset 0CH), current record (offset 20H), and relative
record (offset 21H) are then set to address the next record.
If the number
of
records is specified as zero,
no
records are writ-
ten, but the file size field
of
the directory entry (offset 1CH) is
set
to
the number
of
records specified by the relative record field
of
the FCB (offset 21H). Allocation units are allocated
or
re-
leased,
as
required.
Entry Conditions:
AH
=
28H
DS:
DX
=
pointer to the opened
FCB
of the file
to
write
CX
=
number
of
records
to
write
(non
zero)
CX
=
0 (sets the file size field; see above)
Exit Conditions:
CX
=
actual number of records written
If AL
=
00H, all records were written successfully.
If AL
=
01H, no records were written because there is insuffi-
Macro Definition:
or
cient space on the disk.
ran-block-write macro fcb,count,rec-size
mov dx,offset fcb
mov cx ,coun t
mov word ptr fcb[l4l,rec-51ze
mov
ah,28H
int
21
H
endm
80