Chuwter
1
I
System Calls
SetRelRec
Set Relative Record
Function Call
24H
Sets the relative record field (offset 21H) in
a
specified FCB
to
the same file address that is indicated by the current block
(off-
set 0CH) and current record (offset 20H) fields.
Entry Conditions:
AH
=
24H
DS:DX
=
pointer to an opened
FCB
Macro Definition:
5et-relative-record macro fcb
mov dx,offsetfcb
mov
ah,24H
int
21
H
endm
Example:
The following program copies a file using the Random Block
Read and Random Block Write function calls. It speeds the copy
by setting the record length equal
to
the file size and the record
count to
1,
and using
a
buffer
of
32K
bytes. It positions the file
pointer by setting the current record field (offset 20H)
to
1
and
using the Set Relative Record function call
to
make the relative
record field (offset 21H) point to the same record as the combina-
tion
of
the current block (offset 0CH) and current record (offset
20H) fields.
75