EasyManua.ls Logo

Commodore Plus 4 - Page 376

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...
364
Using
Peripheral
Devices
100
INPUT#1,B$
110
IFA$OB$THElirPRINTCHR$(
13)"VERIFY
ERROR"
120
CL0SEl:PRINTCHR$(13):G0SUB130:END
130
IP(PEEK(64784)A1TD4)=OTHENPRINT//HIT
STOP
ON
DATASSETTE":
WAIT64784,4
140
RETURN
Line-by-Line
Explanation
10
Make
sure
no
buttons
are
pressed
on
Datassette.
20
Open
a
data
file
for
writing.
30
Get
some
input
to
record.
40
Output
the
string
to
the
Datassette.
50
Close
the
file.
60
Make
sure
no
buttons
are
pressed
on
Datassette.
70
Tell
the
user
to
rewind
the
tape,
and
wait
for
the
button
to
be
down.
80
Make
sure
no
buttons
are
pressed
on
Datassette.
90
Open
the
file
for
reading.
100
Get
the
string
from
the
Datassette.
110
Compare
it
with
the
string
typed
in
by
the
user,
and
report
error.
120
Close
the
file
and
make
sure
no
buttons
are
pressed.
130
If
a
button
is
down,
print
a
message,
and
wait
until
none
are
down.
140
Return
to
main
program.
Using
a
Datassette
from
Machine
Language
In
general
terms,
you
can
choose
one
of
two
levels
of
communication
when
you
use
the
Datassette.
At
the
higher
level
are
the
save
and
load
routines
that
perform
all
the
necessary
functions
to
save
or
load
a
section
of
RAM
from
disk.
The
lower
level
allows
the
maintenance
of
an
open
file
on
the
Datassette
in
addition
to
other
open
files,
similar
to
using
OPEN
commands
in
BASIC.
These
levels
are
explored
and
example
programs
are
given
in
this
section.
The
complete
descriptions
of
the
operating
system
subroutines
used
can
be
found
in
Chapter
5.
Saving,
Loading,
and
Verifying
Files
The
key
subroutines
for
saving
and
loading
sections
of
RAM
are
S
AVESP
($FFD8)
and
LOADSP
($FFD5).
These