EasyManua.ls Logo

Commodore 1581 - Block-Write Command

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...
EXAMPLES:
To
restore
track
40,
sector
3 of
the
directory
from
the
disk
buffer
filled
by
a
BLOCK-READ,
use:
PRINT#15,"U2";5;0;40;3
You'll
return
to
this
example
on
the
next
page,
after
you
learn
to
alter
the
directory
in
a
useful
way.
You
can
also
use
a
BLOCK-WRITE
to
write a
name
in
Track
1,
Sector
1,
a
rarely-used
sector.
This
can
be
used
as
a
way
of
marking
a
diskette
as
belonging
to
you.
Here
is
a
program
to
do
it,
using
the
alternate
form
of
the
BLOCK-WRITE
command:
110
INPUT"YOUR
NAME";NA$
Enter
a
name.
120
OPEN
15,8,15
Open
command
channel.
130
OPEN
4,8,4,"#"
Open
direct
access
channel
140
PRINT#4,NA$
Write
name
to
buffer.
150
PRINT#15,"U2";4;0;l;l
Write
buffer
to
Track
1,
160
CLOSE
4
Sector
1
of
diskette.
170
CLOSE
15
Tidy
up
after.
180
END
As
with
the
BLOCK-READ
command,
there
is
a
BLOCK-WRITE
com
mand
identical
in
function
to
"U2"
that
does
not
check
the
track
and
sector
parameters
for
valid
bounds
before
attempting
to
write
the
sector.
Its
format
is:
PRINT#15,"B-on;channel
#;drive
#;track
#;sector
#
(The
character
after
the
B-
is
a
shifted
W.)
or
PRINT#15,uB-";CHR$(215);channel
#;track
#;sector
#
THE
ORIGINAL
BLOCK-READ
AND
BLOCK-WRITE
COMMANDS
Although
the
BLOCK-READ
and
BLOCK-WRITE
commands
are
nearly
always
replaced
by
the
Ul
and
U2
commands
respectively,
the
original
commands
can
still
be
used,
as
long
as
you
fully
understand
their
effects.
Unlike
Ul
and
U2,
B-R
and
B-W
allow
you
to
read
or
write
less
than
a
full
sector.
In
the
case
of
B-R,
the
first
byte
of
the
selected
sector
is
used
to
set
the
buffer
pointer
(see
next
section),
and
deter-
72

Table of Contents

Other manuals for Commodore 1581

Related product manuals