[net.micro.cbm] tape program format

cuda@ihuxf.UUCP (Mike Nelson) (07/31/86)

I am presently trying to modify a program for the C64 to copy files
from the disk to tape instead of disk to disk.  I am to the point
of getting the files off the disk and kind of on the tape.  It can
find the name of the first program on tape and appears to begin to 
load it.  However, it just keeps loading past the end of that 
program and on into any others that were supposedly saved.  It
can't seem to be able to determine the end of a program.  I use
OPEN 2,1,2,"FILE NAME" and then call the CHROUT kernal routine to
write the characters to the tape.  I think I'm missing a special
set of characters that indicates the end of a program.  Do any of
you out there have a description of the tape program file format
or any kind of information on special characters or sequences of 
characters that are used as tape controllers?  Also, how might I go
about finding these things from programs already stored on tape?

Thanks in advance.

Mike Nelson
AT&T Bell Labs
ihuxf!cuda

grwalter@watmath.UUCP (Fred Walter) (08/01/86)

In article <2946@ihuxf.UUCP> cuda@ihuxf.UUCP (Mike Nelson) writes:
>I am presently trying to modify a program for the C64 to copy files
>from the disk to tape instead of disk to disk.  I am to the point
>of getting the files off the disk and kind of on the tape.  It can
>find the name of the first program on tape and appears to begin to 
>load it.  However, it just keeps loading past the end of that 
>program and on into any others that were supposedly saved.  It
>can't seem to be able to determine the end of a program.  I use
>OPEN 2,1,2,"FILE NAME" and then call the CHROUT kernal routine to
>write the characters to the tape.  I think I'm missing a special
>set of characters that indicates the end of a program.  Do any of
>you out there have a description of the tape program file format
>or any kind of information on special characters or sequences of 
>characters that are used as tape controllers?  Also, how might I go
>about finding these things from programs already stored on tape?

Programs are stored on tape in a special format ... you can't (to my
knowledge) write programs AS PROGRAMS to tape using your method - as
far as your C64 is concerned you are just writing a data file.

On tape, a program file and a data file are not the same thing, unlike
on a disk - where all files (except REL and sometimes USR) are treated
alike. (They really are : if you save a program as follows SAVE "name,s",8 the
",s" tells the disk drive to store the program as a sequential file, and
that is how it will appear if you then look at the directory of your disk.
You can then load the program with LOAD "name,s",8. This also can be done
with USR (",u") files also.)

What is happening when you are trying to load is that your C64 finds the
data file (that you wrote out), sees it is not a program and so keeps on
searching for a program to load.

The only easy way to get a program onto tape is to save it using the SAVE
command - either from a BASIC program (using a dynamic keyboard), or from
machine language. The easiest way to get a program onto tape is to use a
program that already exists, such as Jim Butterfield's UNI-COPY (public
domain). If you can down-load programs it can be made available, other-wise
I have a BASIC program that will transfer an entire diskette to tape, that
you could use.

						fred

UUCP  : {allegra|clyde|linus|decvax|utzoo|ihnp4}!watmath!grwalter
CSNET : grwalter%watmath@waterloo.csnet
ARPA  : grwalter%watmath%waterloo.csnet@csnet-relay.arpa