EasyManua.ls Logo

Commodore Plus 4 - Page 371

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
Disk
Drive
359
3.
Call
CIOUT
($FFA8)
to
send
bytes
from
.A.
4.
Call
UNLSN
($FFAE).
Example:
Closing
a
File
1.
Load
.A
with
the
device
number
of
the
disk
drive.
Call
LISTN
($FFB1).
2.
Load
.A
with
the
disk
drive
channel
number
you
want
to
close
ORed
with
$E0
(to
indicate
close
this
channel).
Call
SECND
($FF93).
3.
Call
UNLSN
($FFAE).
This
example
reads
the
first
sector
of
the
directory
of
a
diskette
and
places
it
in
memory.
Errors
are
detected
and
acted
on,
but
no
user
interface
is
in
place
to
deliver
error
messages
to
the
user.
2000
2002
2004
2006
2008
200B
200E
2010
2012
2015
2017
201A
201D
201F
2022
2024
2027
2029
202C
202F
2030
2032
2034
2037
2039
203C
203E
2041
2043
2046
2049
204A
204D
204F
2052
2055
A9
85
A9
85
20
20
D0
A9
20
A9
20
20
A9
20
A9
20
A2
BD
20
E8
E0
90
20
A9
20
A9
20
A2
20
9D
E8
20
F0
20
AD
0D
00
90
08
AE
Bl
B7
7B
F2
93
23
A8
AE
08
Bl
FF
93
00
00
A8
0B
F5
AE
08
B4
6F
96
00
A5
00
B7
F4
AB
00
01
FF
FF
FF
FF
FF
FF
FF
21
FF
FF
FF
FF
FF
23
FF
FF
23
23
LDA
STA
LDA
STA
JSR
JSR
BNE
LDA
JSR
LDA
JSR
JSR
LDA
JSR
LDA
JSR
LDX
LDA
JSR
INX
CPX
BCC
JSR
LDA
JSR
LDA
JSR
LDX
JSR
STA
INX
JSR
BEQ
JSR
LDA
ORA
#$00
$90
#$08
$AE
$FFB1
$FFB7
$208B
#$F2
$FF93
#$23
$FFA8
$FFAE
#$08
$FFB1
#$FF
$FF93
#$00
$2100,X
$FFA8
#$0B
$2029
$FFAE
#$08
$FFB4
#$6F
$FF96
#$00
$FFA5
$2300,X
$FFB7
$2043
$FFAB
$2300
$2301
Clear
the
status
variable.
Disk
drive
device
number.
Store
in
the
current
device
number.
Tell
drive
to
listen.
Read
status
variable.
If
not
zero,
then
error.
Open
command
for
channel
2.
Send
as
secondary
address
to
drive.
This
is
the
code
for a
pound
sign
(#)
Open
a
direct-access
channel.
Tell
drive
to
stop
listening.
Disk
drive
device
number.
Tell
drive
to
listen.
Open
command
for
channel
15.
Send
as
secondary
address
to
drive.
.X
counts
bytes
to
send.
Get
a
byte
of
the
Ul
command.
Send
to
the
drive.
Increment
count.
Compare
to
length
of Ul
command.
Not
done,
continue
sending.
Tell
drive
to
stop
listening.
Disk
drive
device
number.
Tell
drive
to
talk.
Access
conmand
channel
(for
errors).
Send
as
secondary
address
to
drive.
.X
counts
the
bytes
received.
Receive
a
byte
from
the
drive.
Store
in
error
buffer.
Increment
byte
count.
Read
status
variable.
If
zero,
more
to
receive
so
go
back.
Tell
drive
to
stop
talking.
Get
first
byte
of
error
buffer.
OR
with
the
second
byte.