[Coco] Copying a data/binary file from disk to cassette

Bob Devries devries.bob at gmail.com
Fri Jan 4 00:58:20 EST 2008


Phil,

The START and EXEC and addresses of a binary file on disk are actually part 
of the disk file. Its length is also encoded there.

The first byte of a BIN file on disk is always $00. After that are two bytes 
which together form the length, and the next two bytes form the START 
address. This comprises the 5-byte pre-amble. At the end of the file, there 
is a 5-byte post-amble which comprises 1 byte $FF, two bytes $00 and two 
bytes with the EXEC address.

The END address can be computer from the START address plus length minus 1.

If you search through the maltedmedia coco list archives, you may even find 
a program to print this info. It has been discussed before.

--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "Phil" <phil.salathe at gmail.com>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, January 04, 2008 3:41 PM
Subject: Re: [Coco] Copying a data/binary file from disk to cassette


> Robert Gault wrote:
>
>>About your only option using Basic would be CSAVEM which will dump data to 
>>cassette without making any changes. So, the disk data file will need to 
>>be opened and stored into known memory. Let's say for example, you POKE 
>>the data into memory starting at $3000 and continue to the end of the 
>>file. Then you CSAVEM"name",&H3000,&H3000+length,0. To use the data, you 
>>would CLOADM"name" and process the data stored at $3000.
>
> This was actually my original plan, but when I'm dealing with a .bin that 
> I've just LOADMed into memory without qualifiers, I don't know how to 
> ascertain the right start and execution points (which is why I was hoping 
> to avoid the whole thing by doing a straight copy).  For instance, I have 
> a .bin of Downland* that runs fine in emulation with a straight LOADM 
> "DOWNLAND.BIN", but I don't know what I'd need to dump, post-LOADM, into 
> my CSAVEM.  Is there a reliable way of finding that out?  Surely there 
> must be something in the headers that tells LOADM where to put things, no?
>
> Best,
> Phil
>
> *a program I actually do own on cart, though I have no idea where it went 
> to!
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list