System information

Files in CP/M can be thought of as a sequence of up to 65536 records of 128 bytes each,
numbered from 0 through 65535, thus allowing a maximum of 8 megabytes per file. Note,
however, that although the records may be considered logically contiguous, they may not be
physically contiguous in the disk data area. Internally, all files are divided into 16K byte
segments called logical extents, so that counters are easily maintained as 8-bit values. The
division into extents is discussed in the paragraphs that follow: however, they are not particularly
significant for the programmer, because each extent is automatically accessed in both sequential
and random access modes.
In the file operations starting with Function 15, DE usually addresses a FCB. Transient programs
often use the default FCB area reserved by CP/M at location BOOT+005CH (normally 005CH)
for simple file operations. The basic unit of file information is a 128-byte record used for all file
operations. Thus, a default location for disk I/O is provided by CP/M at location BOOT+0080H
(normally 0080H) which is the initial default DMA address. See Function 26.
All directory operations take place in a reserved area that does not affect write buffers as was the
case in release 1, with the exception of Search First and Search Next, where compatibility is
required.
The FCB data area consists of a sequence of 33 bytes for sequential access and a series of 36
bytes in the case when the file is accessed randomly. The default FCB, normally located at
005CH, can be used for random access files, because the three bytes starting at BOOT+007DH
are available for this purpose. Figure 5-2 shows the FCB format with the following fields.
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|DR|F1|F2|//|F8|T1|T2|T3|EX|S1|S2|RC|DO|//|DN|CR|R0|R1|R2|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
00 01 02 ...08 09 10 11 12 13 14 15 16 ...31 32 33 34 35
Figure 5-2. File Control Block Format
5.2 Call Conventions CP/M Operating System Manual
5-8