EasyManua.ls Logo

Commodore 1541-II - Chapter 7: Direct Access Commands

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...
CHAPTER
7
DIRECT
ACCESS
COMMANDS
A
TOOL
FOR
ADVANCED
USERS
Direct
access
commands
specify
individual
sectors
on
the
diskette,
reading
and
writing
information
entirely
under
your
direction.
This
gives
them
almost
complete
flexibility
in
data-handling
programs,
but
also
imposes tremendous
responsibilities
on
the
programmer,
to
be
sure
nothing
goes
awry.
As
a
result,
they
are
normally
used
only
in
complex
commercial
programs
able
to
properly
organize
data
without
help
from
the
disk
drive
itself.
A
far
more
common
use of
direct
access
commands
is
in
utility
programs
used
to
view
and
alter
parts
of
the
diskette
that
are
not
normally
seen
directly.
For
instance,
such
commands
can
be
used
to
change
the
name
of
a
diskette
without
erasing
all
of
its
programs,
to
lock
a
program
so
it
can't
be
erased,
or
hide
your
name
in
a
location
where
it
won't
be
expected.
DISKETTE
ORGANIZATION
There
are
a
total
of
683
blocks
on
a
1541
diskette,
of
which
664
are
available
for
use,
with
the
rest
reserved
for
the
BAM
(Block
Availability
Map)
and
the
Directory.
The
diskette's
surface
is
divided
into
tracks,
which
are
laid
out
as
concentric
circles
on
the
surface
of
the
diskette.
There
are
35
different
tracks,
starting
with
track
1
at
the
outside
of
the
diskette
to
track
35
at
the
center.
Track
18
is
used
for
the
directory,
and
the
DOS
fills
up
the
diskette
from
the
center
outward,
alternately
in
both
directions.
Each
track
is
subdivided
into
sectors
(also
called
blocks).
Because
there
is
more
room
on
the
outer
tracks,
there
are
more
sectors
per
track
there.
The
outermost
tracks
contain
21
sectors
each,
while
the
innermost
ones
only
have
17
sectors
each.
The
table
below
shows
the
number
of
sectors
per
track.
Table
6.1:
Track
and
Sector
Format
TRACK
NUMBER
1
to
17
18
to
24
25
to
30
31
to
35
SECTOR
NUMBERS
0
through
20
0
through
18
0
through
17
0
through
16
TOTAL
SECTORS
21
19
18
17
In
this
chapter
we
will
describe
the
DOS
commands
for
directly
reading
and
writing
any
track
and
block
on
the
diskette,
as
well
as
the
commands
used
to
mark
blocks
as
used
or
unused.
Unless
otherwise
notes,
all
direct
access
commands
are
the
same
in
both
Basic
2
and
Basic
3.5.
OPENING
A
DATA
CHANNEL
FOR
DIRECT
ACCESS
When
working
with
direct
access
data,
you-need
two
channels
open
to
the
disk:
the
command
channel
we've
used
throughout
the
book,
and
another
for
data.
The
command
channel
is
opened
with
the
usual
OPEN
15,8,15
or
equivalent.
A
direct
access
data
65

Table of Contents

Related product manuals