EasyManua.ls Logo

Commodore Plus 4 - Page 362

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...
380
Using
Peripheral
Devices
290
Inform
user
that
the
file
was
not
found
and
quit.
300
Inform
user
that
the
file
was
found.
310
Now,
B
points
to
the
file
type
byte
for
the
current
file
entry.
320
If
the
file
is
not
scratched,
inform
the
user
and
quit.
330-340
Determine
the
desired
file
type.
350
If
not
a
valid
input,
repeat
the
question.
360
Final
chance
to
bail
out
without
affecting
the
disk.
370
If
it
is
not
a
definite
yes,
quit.
380
Move
the
disk
buffer
pointer
to
the
file
type
byte
for
the
current
file
entry.
390
Put
the
new
file
type
byte
into
the
disk
buffer.
400
Write
the
disk
buffer
out
to
the
disk.
410
Check
for
disk
errors.
420
Print
message
to
user.
430
Perform
a
validate
function
on
the
disk
to
update
the
BAM.
440
Check
for
disk
errors.
450
Close
the
files
and
stop
processing.
460
If
no
disk
error,
return.
470
Print
out
the
error
message,
close
the
files,
and
quit.
Using
a
Disk
Drive
with
Machine
Language
All
of
the
direct-access
programming
techniques
described
in
the
preceding
BASIC
section
are available
in
machine
language.
The
function
of
the
BASIC
commands
described
to
open
and
use
the
command
and
direct-access
channels
can
be
accomplished
in
machine
code
with
the
appropriate
operating
system
subroutines.
In
general
terms,
you
can
choose
from
three
levels
of
communication
with
the
disk
drive.
At
the
highest
level
are
the
save
and
load
routines
that
perform
all
the
necessary
functions
to
save or
load
a
section
of
RAM
from
disk.
The
middle
level
allows
the
maintenance
of
multiple
open
files,
similar
to
OPEN
commands
in
BASIC.
At
the
most
fundamental
level,
it
is
possible
to
listen
and
talk
to
the
disk
drive
directly
through
the
serial
bus
subroutines.
Each
of
these
levels
is
explored
and
example
programs
are
given
in
this
section.
The
complete
descriptions
of
the
operating
system
subroutines
used
can
be
found
in
Chapter
5.