EasyManua.ls Logo

Commodore Plus 4 - Page 380

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...
368
Using
Peripheral
Devices
overridden
if
the
file
was
SAVEd
as
a
nonrelocatable
file,
as
described
pre
viously.
Call
SETLFS
(SFFBA).
2.
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).
3.
Load
.A
with
$80
to
indicate
a
verify.
If
it
is
to
be
a
relocated
verify,
load
.X
with
the
low
address
to
begin
verifying
and
.
Y
with
the
high
address
to
begin
verifying.
Call
LOADSP
($FFD5).
4.
Check
for
errors
by
checking
the
carry
status
and
the
status
variable.
The
status
variable
can
be
loaded
into
.A
with
READSS
($FFB7).
A
verify
error
sets
bit
4
of
the
status
variable to
1.
Using
Data
Files
This
section
outlines
the
machine-language
equivalents
for
the
BASIC
statements
OPEN,
CLOSE,
GET#,
and
PRINT#.
They
can
be
used
for
data
file
handling.
The
key
subroutines
are
OPEN
($FFC0),
CLOSE
($FFC3),
CHKIN
($FFC6),
CHOUT
($FFC9),
CLRCH
($FFCC),
BASIN
($FFCF),
and
BSOUT
($FFD2).
Any
messages
printed
to
the
screen
during
these
operations
are
controlled
by
the
message
flag
set
with
SETMSG
($FF90).
Open
When
a
file
is
to
be
opened,
and
a
file
name
is
to
be
provided,
the
name
(1
to
17
characters)
must
be
stored
in
CHR$
codes
in
ascending
order
somewhere
in
memory.
The
following
outlines
the
operations
required:
1.
Load
.A
with
the
logical
file
number
to
use
for
the
file,
.X
with
$01
(the
device
number
of
the
Datassette),
and
.Y with
the
secondary
address
(0=read,
l=write
with
end-of-file,
2=write
with
end-of-tape).
Call
SETLFS
($FFBA).
2.
Load
.A
with
the
length
of
the
file
name
(0
if
no
name),
.X
with
the
low
byte of
the
address
where
the
file
name
is
stored,
and
.Y
with
the
high
byte
of
the
address
where
the
file
name
is
stored.
Call
SETNAM
($FFBD).
3.
Call
OPEN
(FFC0).
4.
Check
for
errors
by
examining
the
carry
bit.
Close
Files
can
be
closed
individually
with
the
CLOSE
($FFC3)
routine:
1.
Load
.A
with
the
logical
file
number
of
the
file
to
be
closed.
Call
CLOSE
($FFC3).