[Coco] New! Cassette to floppies
Robert Gault
robert.gault at worldnet.att.net
Wed Nov 2 21:15:48 EST 2005
OK, I found the CSAVEM routine which is in Extended Basic at $8322, not
in Basic (above $A000) as I originally thought. The routine still uses
cassette blocks of 255 bytes in length. The write loop is at $834D where
blocks of 255 bytes are written until all data is sent. This means that
normally save ml programs will be in multi-block cassette format.
The CLOADM routine is at $A4FE. There is a loop at $A52E in which blocks
of 255 bytes are read. Each new block overwrites the CBUFAD at $7E until
the full file is read. Each block read calls GETBLK at $A70B. This
routine does not store the final address read, but does store the block
length at $7D. The total number of blocks read is not stored.
The above means that only if the ml program is less than 255 bytes in
length can one find where it has been loaded into memory. The load
address will be at $7E, the end address will be the start address plus
the value at $7D, and the exec address will be at $9D.
My argument is that most ml programs of substance will be longer than
255 bytes. Therefore the only way to know where they should load and
where the last byte will be is to read the tape, block at a time, and
keep track of the addresses. The exec address will always be known as
that is saved for the EXEC command.
I eagerly await pointers to sections of Basic code that show something
other than the above. That includes proving that cassette block lengths
can be longer than 255 bytes.
More information about the Coco
mailing list