. II
n.
: VIC-154'1 I
[ill [)]
U
11II
II
!I'" n
i"
i.,
g
III III 11II
II a
II
"
II 11II III
II
..
II
I
II n
:d
:j
~ commodore
COMPUTER
VIC-1541
SINGLE DRIVE FLOPPY DISK
USER'S MANUAL
P/N 1540031-02
~ commodore
COMPUTER
WARNING: This equipment has been certified to comply with the limits for I!,
Class B computing device, pursuant to Subpart J of Part 15 of FCC Rules. Only
computers certified to comply with the Class B limits may be attached to this
printer. Operation with noncertified computers is likely to result in interference
to radio and TV reception,"
This warning is valid for the equipment which has the following FCC label
on its rear.
CERTIFIED TO COMPLY WITH CLASS B LIMITS.
PART 15 OF FCC RULES SEE INSTRUCTIONS IF
INTERFERENCE TO RADIO RECEPTION IS SUS-
PECTED.
The information in this manual has been reviewed and isbelievedto be entirely
reliable. No responsibility, however, is assumed for inaccuracies. The material in
this manual is for information purposes only, and is subject to change without
lIotice.
@Commodore BusinessMachines, Inc., September 1981
"All rights reserved."
Table of Contents
Page
1.
General Description
2.
Unpacking and Connecting .
Contents of Box . . ..
Connection of Cables
PoweringOn ........
Insertion of I)jskette . .. . .
Usingwith VlC 20 or Commodore 64 .
3.
UsingPrograms..............
Loading Pre-packaged Software
LOAD .
Directoryof Disk .. .. .. .. .
Pattern Matching & Wild Cards
SAVE .
SAVE and replace. . .
VERIFY.. .. . .. ..
DOS Support Program
4. Disk Commands . . . . . . . .
OPEN ANDPRINT #
NEW ...
COpy.. ..
RENAME.
SCRATCH
INITIALIZE
VAUDATE.
DUPUCATE
Reading the Error Channel
CLOSE
.. .. . .. . .. .. .
..............
3
6
6
7
7
8
.
8
9
9
9
9
11
12
13
13
14
14
14
IS
16
16
17
17
17
18
18
18
S.
SequentialFiles . . . . . . . . .
OPEN .
PRINT # and INPUT #
GET# ..
Reading the Directory
RandomFiles ..........
6.
Opening a channel for random accessdata
BLOCK-READ. . . . .
BLOCK-WRITE . . . .
BLOCK-ALLOCATE.
BLOCK-FREE . . . .
BUFFER-POINTER
USER 1 and USER2
19
19
20
22
23
.
26
27
27
28
29
29
31
32
7. RelativeFiles. .. ... .. .. . ... . . .. ., . 33
Creating arelative fde .. .. .. . .. .. . 34
Usingrelativefdes.. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3S
8. Programming the Disk Controller. 37
BLOCK-EXECUTE 37
MEMORY-READ.. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 37
MEMORY-WRITE 38
MEMORY-EXECUTE . . . . . . . . . . . . . . . . . . . . . . . . . . ..
38
USERCommands 39
9. Changingthe Disk Device Number .. . . .. . . . .. . . .. . . .. . . ... 39
Software Method .. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 39
HardwareMethod 40
Appendices
A. DiskCommandSummary. 41
B. ErrorMessages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 42
C. Demonstration Disk Programs
D. DiskFormatsTables .. . . . . . . . . . . . .. . . . . . . . . . . . . .. S4
. . .. . . . . . . .. . . .. . . .. . .. 47
2
1. GENERAL DESCRIPTION
Introduction
Welcome to .the fastest, easiest, and most efficient filing system available
for your Commodore 64 or VIC 20 computer, your 1541 DISK DRIVE. This
manual has been designed to show you how to get the most from your drive,
whether you're a beginner or an advanced professional.
If you are a beginner, the first few chapters will help you through the
basics of disk drive installation and operation. As your skill and programming
knowledge improves. you will find more uses for your disk drive and the more
advanced chapters of this manual willbecome much more valuable.
If you're a professional, this reference guide will showyou how to put the
1541 through its paces to perform just about all the disk drive jobs you can
think of.
No matter what level of expertise you have, your 1541 disk drive will
dramatically improve the overall capabilities of your computer system.
Before you get to the details of 1541 operation, you should be aware of a
few important points. This manual is a REFERENCE GUIDE, which means that
unless the information you seek directly pertains to the disk or disk drive you
will have to useyour Commander 64 or VIC 20 User's Guides and Programmer's
Reference Guides to find programming information. In addition, even though we
give you step-by-step instructions for each operation, you should become
familiar with BASIC and the instructions (called commands) that help you
operate your disks and drives. However. if you just want to use your disk drive
unit to load and save prepackaged software, we've included an easy and brief
section on doingjust that.
Now. . . let's get on with the general information.
The commands for the disk drive come in several levels of sophisication.
Starting in chapter three. you can learn how the commands that allow you to
save and load programs with the disk work. Chapter four teaches you how
commands are sent to the disk, and introduces the disk maintenance commands.
Chapter five tells you how to work with sequential data files. These arl
very similar to their counterparts on tape (but much faster). Chapter sif
introduces the commands that allow you to work with random files, accessany
piece of data on the' disk, and how you organize the diskette into tracks and
blocks. Chapter seven describes the special relative files. Relative files are the
best method of storing data bases, especially when they are used along with
sequential files.
Chapter eight describes methods for programming the disk controller
circuits at the machine language level. And the final chapter shows you how to
3
change the disk device number. by "cutting" a line inside the drive unit or
through software.
Remember, you don't really need to learn everything in this book all at
once. The first four chapters are enough to get you going, and the next couple
are enough for most operations. Getting to know your disk drivewill reward you
in many ways-speed of operation, reliability, and much more flexibility in your
data processing capabilities.
Specifications
This disk drive allows you to store up to 144 different programs and/or
data files on a singlemini-floppy diskette, for a maximum of over 174,000 bytes
worth of information storage.
Included in the drive is circuitry for both the disk controller and a
complete disk operating system, a total of 16K of ROM and 2K of RAM
memory. This circuitry makes your Commodore 1541 disk drive an "intelligent"
device. This means it does its own processing without taking any memory away
from your Commodore 64 or VIC 20 computer. The disk uses a "pipeline"
software system. The "pipeline" makes the disk abot to process commands while
the computer is performing other jobs. This dramatically improves the overall
throughput (input and output) of the system.
Diskettes that you create in this disk drive are read and write compatible
with Commodore 4040 and 2031 disk drives. Therefore, diskettes can be used
interchangeably on any of these systems. In addition, this drive can read
programs created on the older Commodore 2040 drives.
The 1541 disk drive contains a dual "serial bus" interface. This bus was
specially created by Commodore. The signals of this bus resemble the parallel
IEEE-488 interface used on Commodore PET computers, except that only one
wire is used to communicate data instead of eight. The two ports at the rear of
the drive allows more than one device to share the serial bus at the same time.
This is accomplished by "daisy-chaining" the devices together, each plugged into
the next. Up to fivedisk drivesand one printer can share the bus simultaneously.
4
Figure 1.1 Specifications VIC 1540/1541 Single Drive Floppy Disk
STORAGE
Total capacity
Sequential
Relative
Directory entries
Sectors per track
Bytes per sector
Tracks
Blocks
lC's:
6502
6522 (2)
Buffer
2114 (4)
PHYSCIAL:
Dimensions
Height
Width
Depth
Electrical:
Power requirements
Voltage
Frequency
Power
174848 bytes per diskette
168656 bytes per diskette
167132 bytes per diskette
65535 records per file
144 per diskette
17 to 21
256
35
683 (664 blocks free)
microprocessor
I/O. internal timers
2K RAM
97mm
200 mm
374 mm
I
O, 120,220, or 240 VAC
5 or 60 Herts
~
2 Watts
MEDIA:
Diskettes
Standard mini 5\4", singlesided,
singledensity
5
2. UNPACKING AND CONNECTING
Contents of Box
power cable, black serial bus cable, this manual, and a demonstration diskette.
The power cable has a connection for the back of the disk drive on one end, and
for a grounded (three-prong) electrical outlet on the other. The serial bus cable is
exactly the same on both ends. It has a 6-pin DIN plug which attaches to the
VIC 20, Commodore 64 or another disk drive.
section!
Fig 1. Front Panel LIGHT:POWERON
Fig2. BackPanel
Included with the 1541 disk drive unit, you should find a gray
Please, don't hook up anything until you've completed the following
(: commodare_ floppy disk ~ VIC. 541
_single drive
DRIVE INDICATER (RED LED)
POWER INDICATER
(GREEN LED)
POWER SWITCH
LIGHT: ACTIVE
FLASH: ERROR
,
SERIAL BUS
6
Connection of Cables
Your first step is to take the power cable and insert it into the back of the
disk drive (see figure 2.2). It won't go in if you try to put in in upside down.
Once it's in the drive, plug the other end into the electrical outlet. if the disk
drive makes any sound at this time, please turn it off using the switch on the
back! Don't plug any other cables into the disk drive if the power is on.
Next. take the serial bus cable and attach it to either one of the serial bus
sockets in the rear of the drive. Turn off the computer, and plug the other end
of the cable into the back of the computer. That's all there is to it!
If you have a printer, or any additional disk drives, attach the cables into
the second serial bus port (see figure 2.3). For directions on using multiple drives
at one time, read chapter 8. If you are a first-time user with more than one drive,
start working with only one drive until you're comfortable with the unit.
---_.--_.-.---._-_..
r u --- ..---.--.
I
Powering On
When you have all the devices hooked together, it's time to start turning
on the power. It is important that you turn on the devices in the correct order.
The computer should always be turned on last. As long as the computer is the
last one to be turned on, everything will be OK.
Commodore 64 or VIC20
Personal Computer
VIC Graphic Printer
Fig 3. Floppy Disk Hookup
VIC 1541
Single Drive
Floppy Disk
l
I
i
7.
First, make sure that you've removed all diskettes from the disk drives
before powering on.
After all the other deviceshave been turned on, only then is it safe to turn
on the computer. All the other devices will go through their starting sequences.
The printer's motor goes on, with the print head movinghalfway across the line
and back again. The 1541 disk drive will have its red error light on, and then the
green drivelight will blink, whileyour TV screen forms the starting picture.
Once all the lights have stopped flashing on the drive, it is safe to begin
working with it.
Z
In
m
:c
'-I
z
WRITE
PROTECT
NOTCH
WHEN COVERED. DISKETTE
CONTENTS CANNOT BE
AL TERED
~ <:
~ m
=
-I
o
o
:c
Fig.4. Position for Diskette Insertion
Insertion of Diskette
To open the door on the drive, simply press the door catch lightly, and the
door will pop open. If there is a diskette in the drive, it is ejected by a small
spring. Take the diskette to be inserted, and place it in the drive face-up with the
large opening going in first and the write-protect notch to the left (covered with
tape in the demonstration disk) (see figure 2.4).
Press it in gently, and when the diskette is in all the way, you will feel a
click and the diskette will not spring out. Close the drive door by pulling
downward until the latch clicks into place. Now you are ready to begin working
with the diskette.
Remember to always remove the diskette before the drive is turned off or
on. Never remove the diskette when the green drive light is on! Data can be
destroyed by the drive at this time!
UsingWith a VIC 20 or Commodore 64
The 1541 Disk Drive can work with either the VIC 20 or Commodore 64
8
computers. However, each computer has different requirements for speed of
incoming data. Therefore, there is a software seitch for selecting which
computer's speed to use. The drive starts out ready for a Commodore 64. To
switch to VIC 20 speed, the foIlowing command must be sent after the drive is
started (power-on or through software):
OPEN 15,8,15, "UI-": CLOSE 15
To return the disk drive to Commodore 64 speed, use this command:
OPEN 15,8, 15, "UI+": CLOSE 15
More about using this type of command is in chapter 4, with a detailed
explanation of the U (user) commands in chapter 7.
3. USING PROGRAMS
LOADINGPREPACKAGED PROGRAMS
For those of you interested in using only prepackaged programs available
on cartridges, cassette, or disk, here's all you have to do:
Usingyour disk drive, carefully insert the preprogrammed disk so that the
label on the disk is facingup and isclosest to you. Look for a little notch on the
disk (it might be covered with a little piece of tape). If you're inserting the disk
properly, the notch will be on the left side. Once the disk is inside, close the
protective gate by pushing in on the lever. Now type LOAD "PROGRAM
NAME", 8 and hit the .~U"IU~~. key. The disk will make noise and your
screen willsay:
When the READY comes on and the:~:is on, just type RUN, and your
prepackaged software is ready to use.
LOAD
The BASICcommands used with programs on the disk drive are the same
as the commands used on the Commodore DatassetteTM recorder. There are a
few extra commands available for use with disks, however. First of all, the
program name must be given with each command. On a Datassette, you could
omit the program name in order to just LOAD the firs program there. On disk,
since there are many different programs that are equally accessible, theprogram
9
name must be used to tell the disk drive what to do. In addition, the disk drive's
device number must be specified. If no device number is listed, the computer
assumes the program is on tape.
FORMAT FOR THE LOAD COMMAND:
LOAD name$ , device# , command#
The program name is a string, that is, either a name in quotes or the
contents of a given string variable. Some valid names are: "HELLO",
"PROGRAM #1", A$, NAME$.
The device# is preset on the circuit board to be #8. If you have more than
one drive, seechapter 8 on how to change the devicenumber. This book assumes
that you're using devicenumber 8 for the disk drive.
The command# is optional. If not given, or zero, the program is LOADed
normally, that is, beginning at the start of your available memory for BASIC
programs. If the number is I, the program will be LOADed at exactly the same
memory locations from which it came. In the case of computers with different
memory configurations, like VICs with 5K, 8K, or more memory, the start of
BASIC memory is in different places. The command# 0 permits BASIC
programs to LOAD normally. Command# I is used mainly for machine
language, character sets, and other memory dependent functions.
EXAMPLES
LOAD "TEST", 8
LOAD"Mach Lang", 8, I
NOTE: You can use variables to represent devicenumbers, commands, and
strings, as long as you've previously defined them in your program.
Directory of Diskette
Your Datassetteâ„¢ tape deck is a sequential device. It can only read from
the beginning of the tape to the end, without skipping around the tape and
without the capability of goingbackward or recording over old data.
Your disk drive is a random access device. The read/write head of the disk
can go to any spot on the disk and access a single block of data which holds up
to 256 bytes of information. There are a total of 683 blocks on a single diskette.
.Fortunately, you don't really have to worry about individual blocks of
data. There is a program in the disk drive called the Disk Operating System, or
the DOS. This program keeps track of the blocks for you. It organizes them into
a Block Availability Map,or BAM,and a directory.
10
The Block Availability Map is simply a checklist of all 683 blocks on the
disk. It is stored in the middle of the diskette, halfway between the center hub
and the outer rim. Every time a program is SAVEd or a data file isCLOSEd, the
BAMis updated with the list of blocks used up.
The directory is a list of all programs and other files stored on the disk. It
is physically located right next to the BAM.There are 144 entries available in
the directory, consisting of information like file name and type, a list of blocks
used, and the starting block. The directory is automatically updated every time a
program is SAVEd or a file is OPENed for writing. Beware: the BAM isn't
updated until the file is CLOSEd, even though the directory changes right away.
If a file isn't CLOSEdproperly, all data in that me will probably be lost.
The directory can be LOADed into your memory just like a BASIC
program. Place the diskette in the drive, and type the following command:
LOAD"$",8
The computer responds with:
Now the directory is in your computer's memory. Type LIST, and you'll
see the directory displayed on the screen. To print the directory on your printer,
type the following command line (in this example your printer is plugged in as
device# 4):
OPEN4, 8,4: CMD4: LIST
NOTE: When using CMD, the file must be closed using the command
PRINT# 4: CLOSE 4. See the VIC 1525/1515 printer manual for detailed
explanation.
To read the directory without LOADing it into your memory, see the
section later in this chapter on the DOS Support Program. In addition, to
examine the directory from inside a BASICprogram. see the section in chapter 5
that deals with the GET# statement.
Pattern Matching and Wild Cards
When using the tape deck, you can LOAD any program starting with
certain letters just by leaving off any following letters. Thus, the command
11
LOAD "T" will find the first program on the tape beginning with the letter T.
And LOAD "HELLO" will find the first program beginning with the letters
HELLO, like "HELLO THERE."
When using the disk, this option is called pattern matching, and there is a
special character in the file name used to designate this. The asterisk (*)
character following any program name tells the drive you want to find any
program starting with that name.
FORMAT FOR PATTERN MATCHING:
Can BeA String
Variable Or The
LOADname$ + "*", 8
Name Inside Quotes
In other words, if you want to LOAD the first program on the disk
starting with the letter T, use the command LOAD "T*", 8.
If only the "* is used for the name, the last program accessedon the disk
is the one LOADed. If no program has yet been LOADed, the first one listed in
the directory is the one used.
You are probably familiar with the concept of wild cards in poker where
one card can replace any other card needed. ,On your 1541, the question mark
(?) can be. used as a wild .card on the disk. The program name on the disk is
compared to the name in the LOAD command, but any characters where there is
aquestionmarkinthe namearen't checked. '
For instance, when the command LOAD "T?NT", 8 is given, programs
that match include TINT, TENT, etc.
When LOADingthe directory of the disk, pattern matching and wild cards
can be used to check for a list of specific programs. If you gave the command
LOAD "$O:TEST", only the program TEST would appear in the directory (if
present on the disk). The command LOAD "$O:t*" would giveyou a directory
of aUprograms beginning with the letter T. And LOAD "$O:T?ST" would give
you all the programs with 4-letter names having the first letter of T and the third
and fourth letters ST. LOAD "$O:T?ST*" would give names of any length with
the correct first, third, and fourth letters.
SAVE
To SAVE a program to the diskette, all that is needed is to add the device
number after the program name. Just like the SAVE command for the tape
deck, the device number can be folJowedby a command number, to prevent the
automatic re-Iocation on LOADing (see the section on the LOAD 'command,
above).
FORMAT FOR THE SAVE COMMAND:
SAVE name$, device#, command#
12
&
See the LOAD ~ommal1d (pages
parameters device# and command#.
When you tell the disk drive to SAVE a program, the DOS must take
several steps. First, it looks at the directory to see if a program with that name
already exists. Next it ~he~ks to see that there is a directory entry availablefor
the name. Then it che~ks the BAMto see if there are enough blocks in which to
store the program. If everything is OKup to this point, the program is stored. If
not, the error light willflash.
SAVE and Replace
If a program already exists on the disk, it is often necessary to make a
~hange and re-SAVE it onto the disk. In this case, it would be inconvenient to
have to erase the old version of the program and then SAVE it.
If the first characters of the program name are the "(aP'signfollowed by a
o and a colon (:), the DOS knows to replace any old program that has that name
with the program that is now in the computer's memory. The drive checks the
directory to find the old program, then it marks that entry as deleted, and it
next creates a new entry with' the same name. Finally, the program is stored
normally.
FORMAT FOR SAVE WITHREPLACE:
SAVE "=0:" + nameS, device#, command#
For example, if a file was called TEST, the SAVE and replace command
would be SAVE"(u,O:TESr,8.
) for an explanation of the
____
The reason for the 0: is to keep compatibility with other Commodore disk
drive units which have more than one drive built in. In that case, the number 0
or 1is used to specify which drive isbeing used.
VERIFY
The VERIFY command works to check the program currently in memory
against the program on disk. You must include a device# with the VERIFY
command. The computer does a byte-by-byte comparison of the program,
including line links-which may be different for different memory configura-
tions. For instance, if a program was SAVEd to disk from a 5K VIC 20, and
re-LOADed on an 8K machine, it wouldn"t VERIFY properly because the links
point to different memory locations.
FORMAT FOR VERIFY COMMAND:
VERIFY name$, device#
I3
DOS Support Program
On your demonstration
disk, there may be a program called DOS
SUPPORT.This program, also called a wedge,allowsyou to use many disk
commands more easily (different wedges are used for the VIC 20 and the
Commodore 64). Just LOAD the program and RUN it. It automatically sets
itself up and erases itself when it's finished. You'll have a few hundred less bytes
to work with when this program is running, but you'll also have a handy way to
send the disk commands.
As a result of the DOS Support, the "/" key now takes the place of the
LOAD command. Just hit the slash followed by the program name, and the
program is LOADed. When you use this method, you don't need to use the
LOADcommand or the comma 8.
Thc"(Q)"and ">" keys are used to send commands to the disk drive. If you
type (a$ (or >$), the directory of the disk is displayed on the screen, without
LOADinginto your memory! Thesekeysalsotaketheplaceof thePRINT#(see
chapter 4) to send commands listed in the next chapter.
To read the error channel of the disk (when the red error light is blinking),
just hit either the (a'or the> and hit RETURN. The complete error message is
displayed to you: messagenumber, text, and track and block numbers.
4: DISK COMMANDS
OPEN and PRlNT#
Up 'til now, you have explored the simple ways of dealing with the disk
drive. In order to communicate with the disk drive more fully, you have to
touch on the OPEN and PRINT# statements in BASIC(more details of these
commands are available in your VIC 20 or Commodore 64 User's Guide or
Programmer's Reference Guide). You may be familiar with their use with data
files on cassette tape, where the OPEN statement creates the file and the
PRINT# statement fills the file with data. They can be used the same way with
the disk, as you will see in the next chapter. But they can also be used to set up
a command channel. The command channel lets you exchange information
between the computer and the disk drive.
FORMAT FOR THE OPEN STATEMENT:
OPENfile#, device#, (command) channel#, text $
The file# can be any number from I to 255. This number is used
throughout the program to identify which file is being accessed. But numbers
greater than 127 should be avoided, because they cause the PRINT# statement
to generate a linefeed after the return character. These numbers are really meant
to be used withnon-standard printers.
14
The device# of the disk is usually 8.
The channel # can be any number from 2 to 15. These refer to a channel
used to communicate with the disk, and channels numbered a and I are reserved
for the operating system to use for LOADingand SAVEing.Channels::: through
14can be used for data to files, and 15is the command channel.
The text$ is a string that is PRINTed to the file, as if with a PRINT#
statement. This ishandy for sending a single command to the channel.
EXAMPLES OF OPEN STATEMENTS:
~
OPEN 15,8, IS DEViCE-#~\
~
OPEN2,8. 2 C-- ~~
OPENA;B,C,ZL ~
The PRINT# command works exactly like a PRINT statement, except
that the data goes to a deviceother than the screen, in this case to the disk drive.
When used with a data channel, the PRINT# sends information into a buffer in
the disk drive, which LOADs it onto the diskette. When PRINT# is used with
the command channel, it sends commands to the disk drive.
FORMAT FOR SENDING DISK COMMANDS:
OPEN 15, 8, IS. command$
or
PRINT# IS, command$
NEW
This command is necessary when using a diskette for the first time. The
NEW command erases the entire diskette, it puts timing and block markers on
the diskette and creates the directory and BAM.The NEWcommand can also be
used to clear out the directory of an already.formatted diskette. This is faster
than re-formatting the whole disk.
FORMAT FOR THE NEWCOMMANDTO FORMATDISK:
PRINT#15, "NEW~~'
or abbreviated as
PRINT#15, "N~:name,id"
FORMAT FOR THE NEW COMMAND TO CLEAR DIRECTORY:
PRINT# 15, "N~:name"
The name goes in the directory as the name of the entire disk. This only
appears when the directory is listed. The ID code is any 2 characters, and they
are placed not only on the directory but on every block throughout the diskette.
15
That way, if you carelessly replace diskettes while writing data, the drive will
know by checking the ID that something is wrong.
COpy
This command allows you to make a copy of any program or file on the
disk drive. It won't copy from one drive to a different one (except in the case of
dual driveslike the 4040), but it can duplicate a program under another name on
the drive.
FORMAT FOR THE COPYCOMMAND:
PRINT# 15, "COPY~:newfile=~:oldfile"
or abbreviated as
PRINT# 15, "c~:newfile=~:oldfile"
The COpy command can also be used to combine two through four flles
on the disk.
FORMAT FOR COpy TO COMBINE FILES:
PRINT#15, "CO: newfile=O: old file I,0:0Idfile2,0:0Idfile3 ,0:0Idfile4"
EXAMPLES OF COPY COMMAND:
PRINT# 15, "CO:BACKUP=O:ORIGINAL"
PRINT#15, "CO:MASTERFILE=O:NAME,O:ADDRESS,O:PHONES"
RENAME
~ "'"
This command allows you to change the name of a file once it is in the
disk directory. This is a fast operation, since only the name in the directory must
be changed.
FORMAT FOR RENAME COMMAND:
~-~
PRINT# IS, "RENAME~:newname=oldname" ~
or abbreviated as
PRINT# IS, "R~:newname=oldname"
EXAMPLE
OPEN.
16
OF RENAME COMMAND:
PRINT# 15, "RO:MYRA=MYRON"
The RENAME command willnot work on any files that are currently
SCRATCH
This command allows you to erase unwanted files and programs from the
disk, which then makes the blocks available for new information. You can erase
programs one at a time or in groups by using pattern matching and/or wild cards.
FORMAT FOR SCRATCHCOMMAND
PRINT# 15,"SCRATCH~:~
or abbreviated as
PRINT# 15, "S~:name"
If you check the error channel after a scratch operation (see below), the
number usually reserved for the track number now tells you how many files
were scratched. For example, if your directory contains the programs KNOW
and GNAW, and you use the command PRINT# 15, "SO:?N?W", you will
scratch both programs. If the directory contains TEST, TRAIN, TRUCK, and
TAIL, and you command the disk to PRINT# 15, "SO:T*", you will erase all
four of these programs.
INITIALIZE
At times, an error condition on the disk willprevent you from performing
some operation yo~ want to do. The INITIALIZE command returns the disk
drive to the same state as when powered up. You must be careful to re-match
the drive to the computer (see chapter 2).
FORMAT FOR INITIALIZE COMMAND:
PRINT# 15,"INITIALIZE"
or abbreviated as
PRINT# 15, ''!''
VALIDATE
After a diskette has been in use for some time, the directory can become
disorganized. When programs have been repeatedly SAVEd and SCRATCHed,
they may leave numerous small gaps on the disk, a block here and a few blocks
there. These blocks never get used because they are too small to be useful. The
VALIDATE command will go in and re-organize your diskette so that you can
get the most from the availablespace.
Also, there may be data files that were OPENed but never properly
CLOSEd. This command will collect all blocks taken by such files and make
them available to the drive, sincethe files are unusable at that point.
There is a danger in using this command. When using random files (see
chapter 6), blocks allocated will be de-allocated by this command. Therefore,
this command should never be used with a diskette that usesrandom files.
17