EasyManua.ls Logo

Commodore Plus 4 - Page 377

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The
Datassette
Tape
Recorder
365
Example:
routines
are
ideal
for
saving
sections
of
memory
into
a
tape
file
for
later
retrieval.
They
automatically
perform
the
appropriate
operations
on
the
Datassette.
The
messages
printed
to
the
screen
during
these
operations
are
controlled
by
the
message
flag
set
with
SETMSG
($FF90).
Save
When
a
section
of
memory
is
saved
to
tape,
a
file
name
may
be
provided.
The
name
is
1
to
17
characters
long
and
must
be
stored
in
CHR$
codes
in
ascending
order
somewhere
in
memory.
The
following
outlines
the
operations
required:
1.
Store
the
low
and
high
bytes
of
the
address
at
which
the
save
is
to
begin
into
two
consecutive
bytes
on
zero
page.
2.
Load
.X
with
$01
(the
device
number
of
the
Datassette).
Load
.Y
with
the
desired
secondary
address
($00-$03).
If
it
is
$01,
the
file
cannot
be
relocated
on
subsequent
LOADs.
If
it
is
$02,
an
end-of-tape
(rather
than
an
end-of-file)
marker
is
written
on
the
tape
after
the
file.
If
it
is
$03,
both
of
the
features
are
enabled.
If
it
is
$00,
neither
of
them
are
in
force.
Call
SETLFS
($FFBA).
3.
Load
.A
with
the
length
of
the
file
name
($00
if
none),
.X
with
the
low
byte
of
the
address
at
which
the
name
is
stored,
and.
Y
with
the
high
byte
of
the
address
at
which
the
name
is
stored,
and
call
SETNAM
($FFBD).
4.
Load
.A
with
the
address
of
the
zero
page
location
in
which
the
begin
save
address
is
stored
(see
step
1
above).
Load
.X
with
the
low
byte
of
the
address
at
which
to
stop
saving
plus
1.
Load.
Y
with
the
high
byte
of
the
address
at
which
to
stop
saving
plus
1.
Call
SAVESP
($FFD8).
5.
Check
for
errors
by
checking
the
carry
status
and
the
status
variable.
The
status
variable
can
be
loaded
into
.A
with
READSS
($FFB7).
This
program
saves
itself
on
tape.
It
is
in
three
parts:
the
save
routine,
the error
message
routine,
and
data
for
the
error
message
and
file
name.
.
2000
A9
00
.
2002
85
D8
.
2004
A9
20
.
2006
85
D9
.
2008
A2
01
.
200A
A0
00
LDA
#$00
STA
$D8
LDA
#$20
STA
$D9
LDX
#$01
LDY
#$00
.
200C
20
BA
FF
JSR
$FFBA
.
200F
A9
06
LDA
#$06
.2011
A2
00
LDX
#$00
.
2013
AO
21
LDY
#$21
.
2015
20
BD
FF
JSR
$FFBD
Low
byte
of
address
to
save
from.
Store
on
zero
page.
High
byte of
address
to
save
from.
Store
on
zero
page.
Device
number
for
Datassette.
Secondary
address
for
standard
file.
SETLFS.
Length
of
file
name.
Low
byte
of
address
of
the
file
name.
High
byte of
address
of
the
file
name.
SETNAM.