[Coco] Coco Digest, Vol 45, Issue 32
L. Curtis Boyle
curtisboyle at sasktel.net
Wed Apr 11 11:00:35 EDT 2007
On Wed, 11 Apr 2007 06:59:55 -0600, Bob Devries <devries.bob at gmail.com>
wrote:
> Byte 0 (the first byte of the file) is the preamble flag, which is $00
> for a binary file and $FF for a Basic file.
Actually, it is $00 for any legitimate chunk of data - the directory entry
dictates whether it is binary or BASIC.
>
> Bytes 1 and 2 are the length of the data block.
> Bytes 3 and 4 are the load address.
>
> At the end of the file there are another 5 bytes:
> $FF, $00, $00, $xx, $yy where xx and yy are the EXEC address. These can
> be accessed by using disk basic's random access file commands, as Carl
> England pointed out.
A program that goes through (starting with the 1st 5 bytes) can
amalgamate all addresses by getting the start/length, jumping ahead by
length bytes, getting the next pre-amble, etc. until the post-amble is
reached.
>
> Please note that the file can *sometimes* be split into a number of
> blocks which do not necessarily lie adjacent to each other in memory. If
> that is the case, a programme would need to step through the file and
> collate all the lengths and load addresses.
True. Programs that had a "loader" screen (on the 32 column text screen)
would have a chunk from $400-$5ff, and then the program itself might start
at $e00.
--
L. Curtis Boyle
More information about the Coco
mailing list