Chapter 3: Operation; The Command Channel - Commodore 1551 User Manual

Table of Contents

Advertisement

CHAPTER 3
OPERATION
THE COMMAND CHANNEL
You can send most commands to the 1551 in two ways. One way is with direct, one-line
commands. The alternate way is by sending command data to the drive through something
called the command channel. We will list both methods for each command.
As you will see in the pages that follow, the first method is simpler and self-
explanatory, but the command channel needs some explanation because you must com-
bine BASIC and disk commands. The first step is to open the channel using the BASIC
open statement. The usual form of this statement is:
OPENI5,8,15
The first 15 is a file number, and although it could be any number from I to 255, for
our purposes now we'll use 15. That is 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, and is normally 8, unless you change it
according to instructions in Appendix A.
Once the command channel has been opened, use the PRINT# command to send
information to thc disk drive, and INPUT# command to receive information back from
the disk drive. Once you have finished using the command channel, you must close it like
this:
CLOSEI5
The following examples illustrate the use of the command channel to NEW an
unformatted disk (this is the equivalent of the HEADER command described in the last
chapter):
OPENI5,8,15
PRINT#15, "NEW:diskname,id"
CLOSE15
You can combine the first two statements and abbreviate the NEW command like this:
OPEN 15,8, 15, "N:diskname,id"
CLOSEI5
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,' 'N:diskname,id"
16

Advertisement

Table of Contents
loading

Table of Contents