EasyManua.ls Logo

Commodore 1541-II - Advanced Operation and Programming; Chapter 4: 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...
PART
TWO:
GUIDE
TO ADVANCED
OPERATION
AND
PROGRAMMING
CHAPTER
4
COMMANDS
COMMAND
CHANNEL
Commodore
disk
drives
expect
to
receive
many
of
their
instructions
over
what
is
known
as
a
command
channel.
Although
we
will
not
explain
the
concepts
behind
it
until
Chapter
6,
we
will
learn
it
to
use
it
now,
so
you
can
give
your
1541
disk
the
commands
it
needs
to
do
some
essential
chores.
To
instruct
the
command
channel,
we
use
a
Basic
Open
statement
to
the
disk,
with
a
secondary
address
of
15.
The
usual
form
of
this
statement
is:
OPEN
15,8,15
The
first
15
is
a
file
number,
and
could
be
any
number
from
1
to
255.
It
is
used
to
match
the
secondary
address
(the
last
number
on
the
line),
which
is
also
15.
The
middle
number
is
the
primary
address,
better
known
as
the
device
number,
and
is
normally
8
when
talking
with
the
1541.
A
second
disk
drive
would
usually
be
9,
a
third,
10
and
so
on.
Once
the
command
channel
has
been
opened,
use
the
Basic
Print#
command
to
send
information
to
the
disk
drive,
and
Basic's
Input#
command
to
receive
information
back
from
the
disk
drive.
These
two
commands
are
like
Basic's
Print
and
Input
statements,
except
that
they
use
the
device
number
specified
in
the
preceding
Open
statement
instead
of
defaulting
to
the
screen
and
keyboard
respectively.
In
Basic
2,
you'll
use
both
Print#15
and
Input#15
extensively,
to
send
housekeep
ing
commands
to
the
disk
and
to
check
its
error
status.
Basic
3.5
has
built-in
commands
for
most
of
these
chores.
Even
so,
it
will
be
good
for
those
of
ydu
with
Basic
3.5
to
see
how
such
commands
are
sent.
Sending
a
Command
via
the
Command
Channel
Here
is
the
way
we
send
the
Initialize
command
to
the
disk
via
the
command
channel.
PRINT#15,"I0"
This
command
assumes
we
have
already
opened
the
file
15
to the
command
channel.
"IO"
can
be
replaced
with
any
string
expression
that
is
a
valid
disk
com
mand.
If
file
15
isn't
already
open,
we
can
combine
the
Open
and
the
Print#
in
a
single
statement:
OPEN
15,8,15,<4I0"
However,
this
only
works
for
the
first
disk
command
given.
After
that,
file
15
is
already
open,
and
Opening
it
again
would
cause
a
"FILE
OPEN"
error.
Added
com
mands
are
sent
via
Print#
instead.
25

Table of Contents

Related product manuals