EasyManua.ls Logo

Commodore 1541-II - The Buffer Pointer

Commodore 1541-II
104 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...
abbreviated
as:
PRINT#15,"B-W";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
number
(always
0
on
the
1541),
and
44track
#"
and
"sector
#"
are
respectively
the
track
and
sector
numbers
containing
the
desired
block
of
data
to
be
partially
read
into
or
written
from
the
file
buffer.
IMPORTANT
NOTES:
1.
In
a
true
Block-Read,
the
first
byte
of
the
selected
sector
is
used
to
determine
how
many
bytes
of
that
sector
to
read
into
the
disk
memory
buffer.
It
thus
cannot
be
used
to
read
an
entire
sector
into
the
buffer,
as
the
first
data
byte
is
always
interpreted as
being
the
number
of
characters
to
read,
rather
than
part
of
the
data.
2.
Similarly,
in
a
true
Block-Write,
when
the
buffer
is
written
back
to
diskette,
the
first
byte
written
is
the
current
value
of
the
buffer
pointer,
and
only
that
many
bytes
are
written
into
the
specified
sector.
It
cannot
be used
to
rewrite
an
entire
sector
onto
diskette
unchanged,
because
the
first
data
byte
is
overwritten
by
the
buffer
pointer.
THE
BUFFER
POINTER
The
buffer
pointer points
to
where
the
next
Read
or
Write
will
begin
within
a
disk
memory
buffer.
By
moving
the
buffer
pointer,
you
can
access
individual
bytes
within
a
block
in
any
order.
This
allows
you
to
edit
any
portion
of
a
sector,
or organize
it
into
fields,
like
a
relative
record.
FORMAT
FOR
THE
BUFFER-POINTER
COMMAND:
PRINT#15,<4BUFFER-POINTER";channel#;byte
usually
abbreviated
as:
PRINT#15,"B-P";channel
#;byte
where
"channel
#"
is
the
channel
number
specified
when
the
file
reserving
the
buffer
was
opened,
and
"byte"
is
the
character
number
within
the
buffer
at
which
to
point.
ALTERNATE
FORMATS:
PRINT#15,"B-P:"channel
#;byte
PRINT#15,"B-P:channel
#;byte"
EXAMPLE:
Here
is
a
program
that
locks
the
first
program
or
file
on
a
1541
diskette.
It
works
by
reading
the
start
of
the
directory
(Track
18,
Sector
1)
into
disk
memory,
setting
the
buffer
69

Table of Contents

Related product manuals