"IBM personal computer assembly language tutorial" - читать интересную книгу автора (Auerbach J.)

15 -- sequential write to file
21 -- random read from file
22 -- random write to file
23 -- determine file size
24 -- set random record

In addition to the CP/M compatible services, DOS also offers some special-
ized services which have been available in all releases of DOS. These
include

27 -- multi-record random read.
28 -- multi-record random write.
29 -- parse filename
2A-2D -- get and set date and time

All of the calls mentioned above which have anything to do with files make
use of a data area called the "FILE CONTROL BLOCK" (FCB). The FCB is any-
where from 33 to 37 bytes long depending on how it is used. You are
responsible for creating an FCB and filling in the first 12 bytes, which
contain a drive code, a file name, and an extension.

When you open the FCB, the system fills in the next 20 bytes, which
includes a logical record length. The initial lrecl is always 128 bytes,
to achieve CP/M compatibility. The system also provides other useful
information such as the file size.




IBM PC Assembly Language Tutorial 13


After you have opened the FCB, you can change the logical record length.
If you do this, your program is no longer CP/M compatible, but that doesn't
make it a bad thing to do. DOS documentation suggests you use a logical
record length of one for maximum flexibility. This is usually a good
recommendation.

To perform actual I/O to a file, you eventually need to fill in byte 33 or
possibly bytes 34-37 of the FCB. Here you supply information about the
record you are interested in reading or writing. For the most part, this
part of the interface is compatible with CP/M.

In general, you do not need to (and should not) modify other parts of the
FCB.

The FCB is pretty well described in appendix E of the DOS manual.

Beginning with DOS 2.0, there is a whole new system of calls for managing
files which don't require that you build an FCB at all. These calls are