Track/sector lists
A file is found through its track/sector list, a sector the catalogue entry points at. DOS allocates the sectors of a file wherever there is room; the list is the only record of the order.
| Offset | Size | Meaning |
|---|---|---|
$00 | 1 | Not used |
$01–$02 | 2 | Track and sector of the next list of this file (0 at the end) |
$03–$04 | 2 | Not used |
$05–$06 | 2 | The sector offset in the file of the first sector this list describes: 0 for the first list, 122 for the second |
$07–$0B | 5 | Not used |
$0C–$FF | 244 | 122 pairs of (track, sector), one for each data sector in file order |
A pair of 0 0 is no sector: after the last data sector it is the unused end of the list; inside a text file it is a hole, a record never written. The explorer reads holes as zero bytes and keeps the file's length. A file of more than 122 sectors has a second list, and so on; the viewer follows the chain and stops at a loop or a list outside the disk. A list outside the disk, a loop in the chain, and a data sector outside the disk are reported against the file. The catalogue's length counts the lists as well as the data sectors: a file of 123 data sectors is 125 sectors long (checked on a built disk, and on all 19 files of the System Master).
What is in the sectors
| Type | First bytes | Then |
|---|---|---|
A, I | 2 bytes: the length of the program | The program: Applesoft or Integer BASIC lines. The rest of the last sector is not part of it |
B | 2 bytes: the load address; 2 bytes: the length | The bytes to load at the address (machine code or data) |
T | none | Characters with the high bit set; a carriage return ($8D) ends a line; $00 after the text fills the rest of the sector (a sequential file); a random-access file has fixed-length records, some of them holes |
S, R, a, b | not read | The sectors are shown as they are |
The explorer gives a program or binary file without its 2- or 4-byte DOS header, with the address in the name it opens it under (Apple II file); a text file opens as converted text, and its raw bytes are one click away. A length in the header that is larger than the sectors hold is reported.