Operating instructions

Tape Execute File
Create and Use
Once upon a time, a computerist wanted to convert his
integer BASIC programs to Applesoft BASIC. He read
about a great technique . but it required a disk. He did
not have a disk, but did have cassettes. Could the
technique
be
modified for tape? And, what other
changes would
be
required for the complete conver·
sion? Some interesting things were discovered, and are
reported here.
Allen J. Lacy
1921 Oglethorpe Avenue
Albany, GA
31707
.
J
.,
For a long time, I had been trying
to
find a way
to
convert Integer programs
to
Applesoft.
So it was
with
great in·
terest
that
I read the How
to
Section ti·
tied
"Disk
Magic;;
in
Contact
5.
A short
summary
follows
for
those who
didn't
get
Contact
5.
It was a way
to
list
the In-
teger programs on
to
disk
and then load
it
into Applesoft. This was done by pla-
cing
the
following
line in the program:
o
PRINT"@
OPEN X":POKE 33,33:
PRINT"@WRITE
X":L1ST:PRINT"@CLOSE X":END
(Where @means
Control
D)
When
this
line is entered type
"RUN"
and press "RETURN". When the opera-
tion
is complete, enter
Applesoft
and
EX·
ECute the file.
The only problem
with
this
method
January, 1980
is
that
I do
not
have a
disk
yet.
I started to
think
about how
this
could be done with
just
a tape. During a
normal
"SAVE"
both Integer and Ap-
plesoft
write
the program to tape
the
way
it
is stored
in
memory, not the way it
is listed. The program is stored as
tokens; and since the tokens do
not
match,
Applesoft
cannot load Integer
programs.
So
I
wrote
two
routines which
link
into
the
input
and
output
hooks
CSW
and KSW at $36-$39. (This
article
uses
"$"
to
indicate
a hexadecimal number.)
The
output
routine gets each byte
as the
Apple
outputs
it
and stores
it
in
a
buffer
before the actual
output.
When
the Apple
outputs
a carriage return,
the
routine
writes
the buffer
to
tape. This
continues
until
the Apple
outputs
a car·
MICRO
--
The 6502 Journal
riage return as the first character, the
routine then resets the
output
hook.
The
buffer
is 256 bytes long. This
number
was
chosen because
that
is the
length
of
the Apple's input buffer. Note
the
buffer
is from
$3FOO
to
$3FFF
(decimal 16128
to
16383). This is
because my Apple has 16K. For
different
memory sizes
this
can be changed. If
you have
an
assembler, change the
SAVE address
to
the values in table
1.
If
you
do
not
have an assembler, change
the locations shown in table
2.
The
input
routine reads the tape
records back
into
memory and passes
the bytes through the
input
hooks. This
continues
until
a record comes in which
contains
a carriage return as the
first
byte, the routine then gives control back
to
the
keyboard.
20:5