Chapter
2
I
MS-DOS Control
Blocks
and
Work
Areas
21H-24H Relative record number. This is the number of
currently selected record relative
to
the begin-
ning of the file (starting with
0).
This field is not
initialized by the Open
File
function call. You
must set it before doing a random read or write
to
the file.
If the record size is less than 64 bytes, both
words of this field are used. If the record size is
64
bytes
or
more, only the first three bytes are
used. Note that if you use the FCB at offset 5CH
of the Program Segment Prefix, the last bytes of
the relative record field
is
also the first byte of
the unformatted parameter area that starts at
offset
80H
(the default Disk Transfer Address).
Extended File Control Block
The Extended File Control Block is used
to
create or search for
files in the disk directory that have special attributes. It adds
the following 7-byte prefix
to
the FCB:
Byte
Function
-7
-6 to -2 Reserved.
Flag byte. Contains FFH to indicate this is an
extended FCB.
-1
Attribute byte. See the section on the disk direc-
tory under “MS-DOS Disk Allocation’’ for the
meaning of this byte.
If an extended FCB
is
referenced by
a
function call, the register
containing the reference should point to the first byte of the
prefix.
Program
Segment
When you enter an external command or execute a program
through the EXEC function call, MS-DOS determines the lowest
available free memory address to use as the start of the pro-
gram. This area
is
called the Program Segment.
153