User`s guide

position which is a multiple of the random-access record length. (Note that
sequential and random-access text files share the same file type. It is up to
individual programs to know whether their data files are sequential or random-
access.)
Applesoft and Integer BASIC files have the following format:
Byte Meaning
---- -------
$00-01 Length of tokenized BASIC program
$02-end Tokenized BASIC program
Binary files have the following format:
Byte Meaning
---- -------
$00-01 Load address
$02-03 Length of binary image (i.e. file contents)
$04-end binary image
A Relocatable file contains the image of a program, followed by a relocation
dictionary containing the information necessary to relocate the program to an
arbitrary memory location. The file format is as follows:
Byte Meaning
---- -------
$00-01 Original program load address
$02-03 File length (program image + relocation dictionary)
$04-05 Length of program image alone (not including relocation
dictionary)
$06-xx Program image
$xx-yy Relocation dictionary
(The format of the relocation dictionary is a bit too complex to describe
here. I can provide details if anybody's interested.)
The other three file types (S, A, and B) have never been consistantly
defined by anybody. Several programs use these file types (especially type S)
to store their private data files, but there doesn't seem to be any agreement on
their internal format.
For further information I recommend the book "Beneath Apple DOS" by Don
Worth and Pieter Lechner.
P.S. By the way, all two-byte fields in the above are stored in normal Apple II
byte order, low byte first.