EasyManua.ls Logo

Commodore 1570 - Page 22

Commodore 1570
132 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 2
BASIC
2.0
COMMANDS
This chapter describes the disk commands used with the VIC 20, Commodore 64 or
the Commodore
128
computer in C64 mode. These are Basic 2.0 commands.
You send command data to the drive through something called the command
channel. The first step is to open the channel with the following command:
OPENI5,8,15
The first
15
is
a
file
number or channel number. Although
it
could be any number
from 1 to 255, we'll use
15
because it is used
to
match
the
secondary address
of
15, which
is
the address
of
the command channel. The middle number is the primary address, better
known as the device number. It
is
usually 8, unless you change
it
(see Appendix A).
Once the channel has been opened, use the
PRINT#
command
to
send information
to
the disk drive and the
INPUT#
command
to
receive information from the drive. You
must close the channel with the CLOSE15 command.
The following examples show the use
of
the command channel
to
NEW an unformat-
ted disk:
OPENI5,8,15
PRINT#15,"NEWdrive#:diskname,id"
CLOSE15
You can combine the first two statements and abbreviate the NEW command like
this:
OPENI5,8, 15,
"Ndrive#
:diskname,id"
If
the command channel
is
already open, you must use the following format (trying
to
open a channel that is already open results in a
"FILE
OPEN" error):
PRINT#15 , "Ndrive#:diskname,id',
ERROR CHECKING
In Basic 2.0, when the green drive light flashes, you must write a small program
to
find out what the error is. This causes you to lose any program variables already in
memory. The following
is
the error check program:
10
OPENI5,8,15
20INPUT#15,EN,EM$,ET,ES
30 PRINT EN, EM$,ET,ES
40 CLOSE15
This little program reads the error channel into four BASIC variables (described
below), and prints the results on the screen. A message
is
displayed whether there
is
an
14

Related product manuals