User`s manual

Table 5.4: SEQUENTIAL FORMAT
Table 5.5: PROGRAM FILE FORMAT
6. RANDOMFILES
Sequential files are fine when you're just working with a continuous
stream of data, but some jobs require more than that. For example, with a large
mailing list, you would not want to have to scan through the entire list to find a
person's record. For this you need some kind of random access method, some
way to get to any record inside a file without having to read through the entire
fIle first.
There are actually two different types of random access files on the
Commodore disk drive. The relative files discussed in the next chapter are more
convenient for data handling operations, although the random files in this
chapter have uses of their own, especially when working with machine language.
Random files on the Commodore disk drive reach the individual 256.byte
blocks of data stored on the disk. As was mentioned in the first chapter, there
are a total of 683 blocks on the diskette, of which 664 are free on a blank
diskette. Each block of data really means I Track and sector of the same name.
The diskette is divided into tracks, which are laid out as concentric circles
on the surface of the diskette. There are 35 different tracks, starting with track I
at the outside of the diskette to track 35 at the center. Track 18 is used for the
directory, and the DOS fills up the diskette from the center outward.
Each track is subdivided into sectors. Because there is more room on the
outer tracks, there are more sectors there. The outer tracks contain 21 sectors
each, while the inner ones only have 17 blocks each. The table below shows the
number of sectors per track.
26
BYTE DEFINITION
0,1
Track and sector of next sequential data block.
2-256
254 bytes of data with carriage returns as record terminators.
BYTE
DEFINITION
0,1
Track and sector of next block in program me.
2-256
254 bytes of program info stored in CBMmemory format (with
key words tokenized). End of file is marked by three zero bytes.