The chain of catalogue sectors
The VTOC says where the catalogue starts (track 17 sector 15). Each catalogue sector holds the track and sector of the next at bytes 1 and 2; a next track of 0 ends the chain. A formatted disk chains sector 15 to 14 to 13 and so on down to sector 1, which is room for 105 files; the System Master uses three sectors for 19 files. The viewer stops at a sector it has read before (a loop) or outside the disk, and says so.
| Offset | Size | Meaning |
|---|---|---|
$00 | 1 | Not used |
$01 | 1 | Track of the next catalogue sector (0 at the end) |
$02 | 1 | Sector of the next catalogue sector |
$03–$0A | 8 | Not used |
$0B–$FF | 245 | Seven file entries of 35 bytes |
A file entry
| Offset | Size | Meaning |
|---|---|---|
$00 | 1 | Track of the file's first track/sector list. $00 in the first entry of a sector with nothing after it: never used. $FF: the file was deleted |
$01 | 1 | Sector of the first track/sector list |
$02 | 1 | File type; bit 7 is the lock |
$03–$20 | 30 | The name: characters with the high bit set, padded with $A0 (a space with the high bit) |
$21–$22 | 2 | The length in sectors, including the track/sector lists |
When DOS deletes a file it puts $FF in the first byte and keeps the old track in the last byte of the name (offset $20), so that UNDELETE programs can put it back. The explorer
shows such an entry as deleted and does not read its sectors, whose track/sector list may by then belong to another file.
File types
| Byte (without the lock) | Letter | Kind |
|---|---|---|
$00 | T | Text |
$01 | I | Integer BASIC program |
$02 | A | Applesoft BASIC program |
$04 | B | Binary: machine code or data |
$08 | S | "S" type: a special file; used by some utilities |
$10 | R | Relocatable object module |
$20 | a | A second Applesoft type |
$40 | b | A second binary type |
Bit 7 set ($80 added) is a locked file, which CATALOG shows with a star. Every file on the System Master is locked. The types are bit flags in the file's own definition but a file has exactly one; a byte with two set bits is shown as an unknown type.