1.
First sector:
Description
of the first sector of an Atari DOS standard executable file:
BYT#>00
01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |
CHAR>
|
0123456789ABCDEF |
00
: FF FF 00 3C FF 3F 00 00 00 00 00
00 00 00 00 00
10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 04
93 7D
|
|
ÿÿ.<ÿ?..........
................
................
................
................
................
................
...............}
|
Checksum
= $90, Next sector = $093, Bytes per sector = $7D |
The
first 6 bytes of the sector give us the following information (for
an Atari binary DOS executable file only):
FF FF : 2 bytes that indicate that this is the first sector
of an Atari binary DOS file. This is the standard Header of
the Atari DOS binary files.
00 3C FF 3F
: 4 bytes that indicate the beginning and that define a data
block to be stored in memory
00 3C : Storage address of the first byte of the data
block, here it is the address $3C00
FF 3F : Address of the last byte of the data block,
here it is the address $3FFF (included).
Once that
all the bytes of the data block are read and loaded into memory, we
may encounter 4 new bytes announcing a new block, except if
the end of file is reached (see hereafter).
The other
types of files which are not Atari DOS binary file (executable file)
may have a different header, and may not use the system of loading
per blocks, this is according to the software utility or according to
the Atari program which has created and will use the file. See hereafter.
NOTA:
the 'blocs' are also called 'segment'.
2.
Following sector(s):
Here is
a 128 byte sector extracts from a standard Atari DOS file (this is valid
for any Atari DOS file, executable file or data file):
BYT#>00
01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |
CHAR>
|
0123456789ABCDEF |
00
: B6 2C B4 51 B4 7F B4 00 00 00 00 00 00 00 00 00
10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70 : 00 00 00 00 00 00 00 00 00 00 20 41 42 04
94 7D
|
|
¶,´Q´.´.........
................
................
................
................
................
................
........... AB”}
|
Checksum
= $E7, Next sector = $094, Bytes
per sector = $7D |
The
last 3 bytes of the sectors are ' 04
94 7D ':
they correspond to:
04 94
: give the $0494 value into 16 bits hexadecimal. When applying the
AND $3FF mask to this value, the value of the following sector
( Next sector ) to be read
in the file is obtained. This is the sector $094 in our example.
When the value of the following sector is null, then it means
that this current sector is the last sector of Atari DOS
file.
7D
: this byte corresponds to the number of valid byte of data in
the Atari DOS file current sector (
Bytes per sector ). In our example it is 125 into decimal.
There are thus 125 bytes of data in this sector, from the bytes $B6,
$2C... to the bytes $20, $41, $42.
Nota:
the 4 bytes (addresses of beginning and end of the data block) at
the beginning of a data block are included in this number of valid
bytes. But these 4 bytes are not loaded in memory.
3. Last
sector:
Description
of the end of a file, the last sector of an Atari DOS standard binary
file (executable file):
BYT#>00
01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |
CHAR>
|
0123456789ABCDEF |
00
: 00 00 E0 02 E1 02 00 3C 00 00 00
00 00 00 00 00
10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 04
00 08
|
|
..à.á...........
................
................
................
................
................
................
................
|
Checksum
= $0F, Next sector = $000, Bytes per sector = $08 |
We assume
that the 4 bytes 'E0 02 E1 02' indicate
a new data block to be read and to be loaded in memory, the size of
this block is 2 bytes. The 2 bytes that must be loaded at $02E0
and $02E1 are $00 and $3C.
Well, the
last byte of the sector clearly indicates that there are only 8 valid
byte to be loaded in this sector, sector which is the last one in the
Atari DOS file because the next sector value is null.
We note
that the $3C byte which has just been loaded is the 8th byte
of the sector, thus we have reached the end of the Atari DOS file.
The reading (and the loading) of the Atari DOS file is over.
For
the execution (running) of this executable file see ''Execution
(running) of an Atari DOS binary file''
|