[Coco] Copying a data/binary file from disk to cassette
devries.bob at gmail.com
Thu Jan 3 22:01:18 EST 2008
The reason for the ! exclamation mark is that the basic programme when
(C)SAVEd to tape or disk is tokenised. This means that each BASIC keyword is
converted to one or sometimes two bytes. When your coco1 comes across these
tokens, it searches a look-up table for them to convert back to text. If it
can't find them in the lookup table, BASIC prints the ! to show that it
doesn't know that token.
Your data files should be able to be copied from disk to take with something
like the following psuedo-code:
open the disk file for reading
open the tape file for writing
find length of disk file (use LOF)
for x = 1 to length do
read a character from disk file
write that character to tape file
close tape file
close disk file.
Hope that helps.
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.
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 12:40 PM
Subject: [Coco] Copying a data/binary file from disk to cassette
> Hi, all --
> What's the best way of copying a non-BASIC file, like a .bin, from disk to
> cassette? I tried COPY but setting a value of -1 returns a function error
> (COPY "FILE.BIN:0" TO "FILE.BIN:-1")...and I was never very good at GET,
> PUT, DSKI$, and all that.
> I've got some data files on floppy, associated with various programs, that
> I'd like to transfer to my laptop (via cassette adapter). And going in
> the other direction, I'd like to turn some .bins I have on disk images
> into WAVs so that, again going via the cassette adapter, I can try out
> some games and such on real hardware.
> Obviously one way would be to use CSAVEM, though I don't know how to
> determine the correct memory addresses from which to start and end, and I
> don't think that would work for non-executable data files (would it?).
> So, what's the best route? I feel like I'm missing something obvious, so
> forgive me if I'm being slow here...
> Thanks --
> P.S. I got some unexpected results when I CLOADed BASIC files written for
> Coco 3 (and turned into WAV files to export/import via cassette adapter)
> into an emulated Coco 1. Specifically, all the Coco 3 commands in the
> programs, like HSCREEN, became exclamation marks! Fortunately, I just
> reimported the WAV into an emulated Coco 3 and made my disk images that
> way, but I'm surprised that the Coco would edit the programs on the fly,
> though I guess I can imagine why that would be.
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco