EasyManua.ls Logo

Commodore Plus 4 - Page 350

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...
338
Using
Peripheral
Devices
70
Check
for
ah
error.
If
one
is
found,
exit.
80
I
will
count
the
bytes.
90
Get
a
byte
from
the
buffer.
100
Print the
value
of
the
byte.
110
Go
on
to
the
next
byte.
120
Close
files.
Block
Write
(U2)
The
data
currently
in
the
buffer
of
the
1541
can
be
written
to
any
sector
of
the
diskette
using
this
command.
To
fill
the buffer
with
data,
the
PRINT#
command
is
used
to
the
direct-access
channel.
The
syntax
of
block
write
is
PRINTS
filenumber/'TJZ:"
channel;drive;track;sector
where
filenumber
is
the
logical
file
number
of
the
command
channel,
channels
the
channel
number
of
the
direct-access
channel,
and
drive
is
the
drive
number.
The
track
can
be
any
track
on
the
diskette
(1
to
35)
and
the sector
any
sector
of
that
track.
The
command
B-W
is
also
a
block
write
command,
but
it
occasionally
mal
functions,
so
use
U2.
Example:
This
example
should
be
run
only
on
a
formatted
disk
containing
no
information
you
want
to
preserve.
It
writes
data
to
the
specified
sector,
and
may
overwrite
information
which
is
already
there.
10
0PEN15,8,15,"I"
20
IPDSO0THENPRI]SrTDS$:G0T0160
30
0PEm,8,2,"#"
40
IPDSO0THENPRINTDS$:G0T0160
50
PRINT"WHA^
60
PRIKTT#1,W$
70
PRIFT'WHICH
TRACK,
SECTOR";:INPUTT,S
80
PRINT#15/'TJ2:''2;0;T;S
90
IFDSO0THE]SrPRI]SrTDS$:G0T0160
100
PRIMT#15/'TJ1:"2;O;T;S
120
1=0
130
GET#1A$
140
PRIITTAf;
150
IFA$OCHR$(
13)THENI=I+1
:IFK256THEN130
i60
CLOSE1:CLOSE15