EasyManua.ls Logo

Commodore 1581 - Chapter 6: Direct Access Commands; Opening Data Channel for Direct Access

Commodore 1581
138 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...
BLOCK-READ
The
purpose
of
a
BLOCK-READ
is
to
load
the
contents
of
a
speci
fied
sector
into
a
file
buffer.
Although
the
BLOCK-READ
command
(B-
R)
is
still
part
of
the
DOS
command
set,
it
is
nearly
always
replaced
by
the
Ul
command
(See
Chapter
6).
FORMAT
FOR THE
BLOCK-READ
COMMAND:
PRINT#15,
"Ul";
channel
#;
drive
#;
track
#;
sector
#
where
"channel
#"
is
the
channel
number
specified
when
the
file
into
which
the
block
will
be
read
was
opened,
"drive
#"
is
the
drive
num
ber,
and
"track
#"
and
"sector
#"
are
respectively
the
track
and
sector
numbers
containing
the
desired
block
of
data
to
be
read
into
the
file
buffer.
ALTERNATE
FORMATS:
PRINT#15,"Ul:"channel
#;drive
#;track
#;sector
#
PRINT#15,"UA:"channel
#;drive
#;track
#;sector
#
PRINT#15,"Ul:channel
#,drive
#,track
#,sector
#"
EXAMPLE:
Here
is
a
complete
program
to
read
a
sector
into
disk
memory
us
ing
Ul,
and
from
there
into
computer
memory
via
GET#.
(If
a
carriage
return
will
appear
at
least
once
in
every
88
characters
of
data,
INPUT#
may
be
used
in
place
of
GET#).
110
MB
=
7936:REM
$1FOO
Define
a
memory
buffer.
120
INPUT"TRACK
TO
READ";T
Select
a
track
130
INPUrSECTOR
TO
READ";S
and
sector.
140
OPEN
15,8,15
Open
command
channel.
150
OPEN
5,8,5,"#"
Open
direct
access
channel.
160
PRINT#15,"Ul";5;0;T;S
Read
sector
into
disk
buffer.
170
FOR
I
=
MB
TO
MB
+
255
Use
a
loop
to
180
GET#5AWF
A$
=
"
"
copy
disk
buffer.
THEN
A$
=
CHR$(0)
into
computer
memory.
190
POKE
IASC(A$)
Tidy
up
after.
200
NEXT
210
CLOSE
5:CLOSE
15
220
END
70

Table of Contents

Other manuals for Commodore 1581

Related product manuals