Commodore 1570, 1571 User Manual

COMMODORE
DISK
DRIVE
1570/71==
Users's
Guide
COMMODORE
1570171
Users's Guide
USERS
MANUAL
STATEMENT
WARNING:
This
equipment
has
been
certified
to
comply
with
the
limits
for
a
ClassBcomputing
device,
pursuant
to
subpart
J of
Part
15
of
the
Federal
Communications
Commission's
rules,
which
are
designedtopro
vide
reasonable
protection
against
radio
and
television
interference
in
a
residential
installation.
If
not
installed
properly,
in strict
accordance
with
the
manufacturer's
instructions,
it
may
cause
such
interference.
If
you
suspect
interference,
you
can
test
this
equipmentbyturningitoff
and
on.
If
this
equipment
does
cause
interference,
correctitby
doing
anyofthe
following:
Reorient
the
receiving
antennaorAC
plug.
Change
the
relative
positions
of
the
computer
and
the
receiver.
Plug
the
computer
intoadifferent
outletsothe
computer
and
receiver
areondifferent
circuits.
CAUTION:
Only
peripherals
with
shield-grounded
cables
(computer
input-
output
devices,
terminals,
printers,
etc.),
certified
to
comply
with
Class
B
limits,
canbeattachedtothis
computer.
Operation
with
non-certified
peripherals
is
likelytoresultincommunications
interference.
Your
house
AC
wall
receptacle
must be
a three-pronged
type
(AC
ground).
If
not,
contact
an
electrician
to
install
the
proper
receptacle.
If
a
multi-connector
boxisusedtoconnect
the
computer
and
peripherals
to
AC,
the
ground
must
be
common
to
all
units.
If
necessary,
consult
your
Commodore
dealer
or
an
experienced
radio-
teievision
technician
for
additional
suggestions.
You
may
find
the
following
FCC
booklet
helpful:
"How
to
Identify
and
Resolve
Radio-TV
Interference
Problems."
The
booklet
is
available
from
the
U.S.
Government
Printing
Office,
Washington,
D.C.
20402,
stock
no.
004-000-00345-4.
FOR
USERS
IN
UK
WARNING:
THIS
APPARATUS
MUSTBEEARTHED
!
IMPORTANT.
The
wiresinthis
mains
lead are
colouredinaccordance
with
the
fol
lowing
code:
Green
and
yellow
Blue
Brown
Earth
Neutral
Live
As
the
coloursofthe
wiresinthe
mains
leadofthis
apparatus
may
not
correspond
with
the
coloured
marking
identifying
the terminalsinyour
plug,
proceedasfollows:
The
wire
whichiscoloured
green
and
yellow
must be
connectedtothe
terminal
in
the
plug
whichismarkedbythe
letterEorbythe
safety
earth
symbol—or
coloured
greenorgreen
and
yellow.
The
wire
whichiscoloured
blue
mustbeconnectedtothe
terminal
which
is
marked
with
the
letterNor
coloured
black.
The
wire
whichiscoloured
brown
must be
connectedtothe
terminal
which
is
marked
with
the
letterLor
coloured
red.
USER 'S MANUAL STATEMENT
WARNING: This equipment has been certified to comply with the limits for a Class B computing device, pursuant
to
subpart J of Part
15
of the
Federal Communications Commission's rules, which are designed
to
pro-
vide reasonable protection against radio
and
television interference
in
a
residential installation.
If
not installed properly, in strict accordance with
the manufacturer's instructions, it may cause such interference.
If
you
suspect interference,
you
can
test this equipment
by
turning
it
off
and
on. If
this equipment does cause interference, correct
it
by doing any
of
the
following:
• Reorient the receiving antenna or
AC
plug.
• Change t
he
relative positions of
the computer and the receiver.
Pl
ug
the computer in
to
a differe
nt out
let
so
the computer and
receiver
are
on
different circu
its.
CAUTION: Only peripherals with shield-grounded cables (computer input­output devices,
te
rminals, printers, etc.), certified
to
comply with Class B
limits, can
be
attached
to
this computer. Operation with non-certified
pe
ripherals
is
likely
to
result
in
communications interference.
Your house
AC
wall receptacle must
be
a three-pronged type (AC
ground).
If
not, contact
an
electrician
to
install the proper receptacle.
If
a
multi-connector box
is
used to connect the computer and peripherals to
AC,
the ground must
be
common to
all
units.
If
necessary, consult your Commodore dealer or
an
experienced radio-
television technician for additional suggestions.
You
may find the following
FCC
booklet h
elp
ful: "How to Identify
and
Resolve Radio-TV Interference
Problems." T
he
booklet
is
available
from
the U.S. Government Printing
Offi
ce,
Washington, D.C. 20402, stock
no.
004-000-00345-4.
FOR USE
RS
IN
UK
WARNING: TH
IS
APPARATUS MUST BE EARTHED!
IMPORTANT
. The wires in this mains lead are coloured in accordance with the fol·
lowi
ng
code
:
Green
and
yellow Earth
Blue
Neutral
Brown
live
As
the colours of the wires
in
the mains lead of this apparatus may not correspond
wi
th
the coloured marking identifying the terminals
in
your plug. proceed
as
follows;
The wire which
is
coloured green and yellow must be connected
10
the terminal
in
the plug which
is
marked by the letter E or by the safety earth
symbol-or
coloured
green or green and yellow.
The wire
which
is coloured blue
must
be connected
to
the
terminal
which
is
marked
with
the letter N or coloured black.
The wire
which
is
coloured brown
must
be connected to
the
terminal which
is
marked
with
the
letter L
or coloured red.
Disk Drive
User's Guide
1570/1571
Copyright © 1985
by
Commodore Electronics Limited
Second Printing. August 1985 All rights reserved
This manual contains copyrighted and proprietary information.
No
part
of
this publication
may be reproduced, stored
in
a retrieval system, or transmitted
in
any form or
by
any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission
of
Commodore Electronics Limited.
CONTENTS
INTRODUCTION
......................................................
1
PART ONE: BASIC OPERATING INFORMATION
CHAPTER 1:
HOW
TO
UNPACK, SET UP
AND
BEGIN USING THE
1571
....
3
step-by-step instructions
.........................................
3
operating modes
.................................................
5
troubleshooting guide
............................................
6
simple maintenance tips
..........................................
7
inserting a diskette
..............................................
7
diskette care
...................................................
8
using pre-programmed (software) diskettes
.........................
9
how to
prepare
a new diskette
...................................
10
diskette directory
..............................................
11
selective directories
.............................................
12
printing a directory
............................................
13
pattern matching
..............................................
13
splat files
.....................................................
13
CHAPTER 2: BASIC 2.0 COMMANDS
...................................
14
error
checking
.................................................
14
BASIC hints
..................................................
15
save
..........................................................
16
save with replace
...............................................
16
verify
........................................................
17
scratch
.......................................................
18
more about scratch
.............................................
19
rename
.......................................................
20
renaming
and
scratching troublesome
files
(advanced users)
..........
21
copy
.........................................................
21
validate
.......................................................
23
initialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
CHAPTER 3: BASIC 7.0 COMMANDS
...................................
25
error
checking
.................................................
25
save
..........................................................
25
save with replace
...............................................
26
dverify
.......................................................
27
copy
.........................................................
27
concat.
.......................................................
28
scratch
.......................................................
28
more about scratch
.............................................
29
rename
.......................................................
30
renaming and scratching troublesome files (advanced users)
..........
30
collect
........................................................
31
initialize
......................................................
32
CHAPTER 4: DOS SHELL
......•...•......•....•..•..•................
33
language selection
...•...•...•.........•........................
33
primary
menu screen
•...•......................................
33
disk/printer setup
..•.......................................•..•
33
run a program
••...•...........................................
34
format a disk
.••...........................•.....•.............
34
cleanup a disk
.....•....•...•.............................
'
.....
34
copy a disk
•....................•.....•..........•.............
35
copy files
..............•...••..........•...................•..
35
delete files
..............••............................•.......
36
restore files
...........................................•.......
36
rename files
..............................................•....
37
reorder
directory
.......•......................................
37
PART TWO: ADVANCED OPERATION
AND
PROGRAMMING
CHAPTER 5: SEQUENTIAL DATA FILES
........•......................
39
the concept of files
............................................•
39
opening a
file
...............•......•...........................
39
adding to a sequential
file
•...•......•...........................
43
writing
file
data: using
print#
...................................
43
closing a
file
........•....•............•........................
45
reading
file
data: using
input#
...................................
46
more about
input#
(advanced users)
..............................
47
numeric
data
storage on diskette
.................................
48
reading
file
data: using
get#
.....................................
49
demonstration of sequential files
..................................
51
CHAPTER 6: RELATIVE DATA FILES
..................................
53
the value of relative access
.......................................
53
files, records,
and
fields
.........................................
53
file
limits
•....................................................
54
creating a relative
file
...........................................
54
using relative files:
record#
command
.............................
55
completing relative
file
creation
..................................
57
expanding a relative
file
.....................................•...
59
writing relative
file
data
..............................•..........
59
designing a relative record
......................................
59
writing the record
..............................................
60
reading a relative record
........................................
64
the value
of
index files (advanced users)
...........................
66
CHAPTER 7: DIRECT ACCESS COMMANDS
............•.............•.
67
a tool for advanced users
......................................•.
67
opening a
data
channel for direct access
...........................
67
block-read
....................................................
68
block-write
..........•....••..••..•...•............•.....•.....
69
the original block-read
and
block-write commands (expert users)
......
70
the buffer pointer
..............................................
71
allocating blocks
...................•..•..................•..•..
72
freeing blocks
.....•...•..........•.........•............•.....
73
using
random
files (advanced users)
...............................
73
CHAPTER 8: INTERNAL DISK COMMANDS
............................
74
memory-read
....•.......•...•.............•...................
75
memory-write
.................................................
76
memory-execute
..•...•••.........••..•..................••....
77
block-execute
..................................................
78
user commands
.•...•.............•...•...•...............•..•.
79
utility loader
..................................................
80
CHAPTER 9: MACHINE LANGUAGE PROGRAMS
.......................
81
disk-related kernal subroutines
..................................
81
CHAPTER
10:
BURST COMMANDS
.•......•..•........................
82
read
.........................................................
82
write
.•...•..................•...............•................
83
inquire disk
.....•............•...•............................
83
format
MFM
................................................•.
84
format
GCR
(no directory)
......................................
85
sector interleave
.................................•.............
85
query disk format
....................................•.........
86
inquire status
..................................•........•......
86
chgutl utility
..................................................
87
fastload utility
.................................................
87
status byte breakdown
..........................................
88
burst
transfer
protocol.
.........•..•..........................•.
89
explanation of procedures
...•...•..•..••......................•.
90
example
burst
routines
..............•.........................•.
91
APPENDICES:
A:
changing the device
number
..................................
98
B:
dos
error
messages
.............•...............•............
99
C: diskette formats: GCRfMFM
.....•..••....................
'
...
103
D:
disk command quick reference
chart
.................•.......•
112
E: specifications of the
1571
disk drive
...•...•...................
114
F: serial interface information
..•...............................
116
G: disk operating systems: Commodore and CP/M
............•....
118
USER'S MANUAL STATEMENT
...........................
inside back cover
INTRODUCTION
MAIN OPERATING FEATURES
The
1571
is
a versatile disk drive that handles multiple disk formats and data transfer
rates. Disk formats range from single-sided, single-density
to
double-sided, double-
density. The
1571
can be used with a variety
of
computers, including the Commodore
128, the Commodore 64, the Plus 4, C16, and
VIC
20.
When used with the Commodore
128
Personal Computer, the
1571
offers the
following features:
• Standard
andfast
serial data transfer
rates-
The
1571
automatically selects the
proper data transfer rate (fast or slow) to match the three operating modes
available on the Commodore
128
computer (C128 mode, C64 mode, and CP/M
mode).
• Ability to read and write
in
double-density MFM
format-
This allows access to
the CP/M software libraries
of
other personal computers.
• Double-sided, double-density data
recording-Provides
up
to
339K storage ca-
pacity per disk (l69K per side).
• Special high-speed burst
commands-
These commands, used for machine lan­guage programs, transfer data several times faster than the standard or fast serial rates.
When used with the Commodore 64 computer, the
1571
disk drive supports the
standard single-density GCR format disks used with the Commodore
1541,1551,4040,
and 2031 disk drives.
NOTE
CP/M disks are included
in
Commodore 128 carton; CP/M operating information is pre­sented
in
the Commodore 128 user manuals.
HOW THIS GUIDE IS ORGANIZED
This guide
is
divided into two main parts and seven appendices,
as
described below:
PART
ONE: BASIC OPERATING INFORMATION-includes all the information
needed by novices and advanced users
to
set
up
and begin using the Commodore
1571
disk drive.
PART
ONE
is
subdivided into four chapters:
• Chapter I tells you how
to
use disk software programs that you buy, like Perfect
Writer®
and
Jane®.
These pre-written programs help you perform a variety of
activities in fields such
as
business, education, finance, science, and recreation.
If
you're interested only
in
loading
ard
running pre-packaged disk programs,
you
need read no further than this chapter.
If
you
are
also interested in saving, loading,
and running your own programs, you will want
to
read the remainder
of
the guide.
• Chapter 2 describes
the
use
of
the BASIC 2.0 disk commands with
the
Commo-
dore 64 and Commodore
128
computers.
• Chapter 3 describes the use
of
the BASIC 7.0 disk commands with the Commo-
dore 128.
• Chapter 4 describes the use
of
the DOS Shell program, which provides you with a
convenient alternative way to execute disk drive commands. The DOS Shell
is
included on the
1571
test/demo diskette supplied with your disk drive.
PART TWO: ADVANCED OPERATION AND
PROGRAMMING-is
primarily
intended for users familiar with computer programming.
PART
TWO
is
subdivided
into six chapters:
• Chapter 5 discusses the concept
of
data files, defines sequential data files, and
describes how sequential data files are created and used on disk.
• Chapter 6 defines the differences between
sequential and relative data files, and
describes how relative data files
are
created and used on disk.
• Chapter 7 describes direct access disk commands
as
a tool for advanced users and
illustrates their use.
• Chapter 8 centers on internal disk commands. Before using these advanced commands, you should know how to program a 6502 chip
in
machine language
and have access to a good memory map of the 1571.
• Chapter 9 provides a list
of
disk-related kernal ROM subroutines and gives a
practical example
of
their use in a program.
• Chapter
10
gives information
on
high-speed burst commands.
APPENDICES A THROUGH
G-provide
various reference information; for example,
Appendix A tells you how to set the device number through use
of
two switches
on
the
back
of
the drive.
2
PART ONE:
BASIC OPERATING INFORMATION
CHAPTER 1
HOW TO UNPACK, SET UP AND BEGIN USING THE 1571
STEP-BY -STEP INSTRUCTIONS
I. Inspect the shipping carton for damage.
If you find any damage to the shipping carton and suspect that the disk drive may have
been affected, contact your dealer.
2. Check the contents
of
the shipping carton.
Packed with the
1571
and this book, you should find the following: 3-prong electrical power cord, interface cable, Test/Demo diskette, and a warranty card to be filled out and returned to Commodore.
3. Remove the cardboard shipping spacer from the disk drive. The spacer is there
to
protect the inside
of
the drive during shipping. To remove it,
rotate the lever on the front
of
the drive counter-clockwise (see Figure I) and pull out
the spacer.
Figure L Front
of
1571
Disk Drive
POWER DRIVE
LEVER FOR CLOSING DRIVE.
3
4. Connect the power cord. Check the ON/OFF switch on the back
of
the
drive (see Figure
2)
and make sure it's
OFF. Connect the cord where indicated in Figure
2.
Plug the other end into a grounded
(3-prong) outlet. Don't tum the power
on
yet.
Figure 2. Connection of Power Cord and Interface Cables to
1571
POWER CORD
SOCKET
GROUNDED
POWER
OUTLET
SERIAL PORT
CONNECTORS
FOR
INTERFACE
CABLES
4
ON/OFF SWITCH
DIP SWITCHES
FOR CHANGING
DEVICE
NUMBER
5. Connect the interface cable. Make sure your computer and any other peripherals are OFF. Plug either end
of
the interface cable into either serial port on the back of the drive (see Figure 2). Plug the other end
of
the cable into the back
of
the computer. If you have another peripheral (printer or extra drive), plug its interface cable into the remaining serial port on the drive.
6.
Turn ON the power.
With everything hooked up and the drive empty, you can turn on the power to the peripherals
in
any order, but turn on the power
to
the computer last. When everything
is
on, the drive goes through a self test. If all
is
well,
the
green light will flash once and
the red power-on light will glow continuously.
If
the green light continues
to
flash,
there may be a problem. Refer
to
the Troubleshooting Guide.
OPERATING MODES
To achieve maximum compatability between the
1571
and other disk drives, the
1571
has two modes
of
operation that allow
it
to
be used
in
a variety
of
situations.
1541 Mode
When you first turn on the 1571, it powers
up
in
1541
mode. That is,
it
works almost
exactly as a
1541
disk drive, which helps maintain compatability with certain special programs and copy-protected diskettes. Also, many loading routines are dependent upon the 1541-speed internal timing. However, when the drive
is
in
this mode, it can't take
advantage
of
the special
1571
features.
1571 Mode
In
1571
mode, the drive can take advantage
of
such features
as
double-sided
diskettes, MFM-format diskettes, fast data transfer rates, and burst transfer protocol. The
1571
can determine whether or not the host computer can receive fast data transfer and
transmits accordingly.
Mode Selection
As
mentioned above, the
1571
powers up in
1541
mode. However,
it
automatically
shifts to
1571
mode upon the first
of
a fast serial transfer initiated
by
the host (the
Commodore 128). The Commodore 64 and Plus 4 can't perform fast serial transfers on the
serial bus, but you can shift from
1541
to
1571
mode
by
sending the following BASIC
command: OPEN
1,8,15,"U0>Ml".
Although these computers can't directly take
advantage
of
the drive's faster transfer speeds, they can have twice the normal storage.
If
you are using a Commodore
128
and want the
1571
to remain
in
1541
mode,
you
can send the following BASIC command: OPEN 1 ,8,15,
"U0>M0".
The drive will
then remain in
1541
mode until the next power
up
or system reset.
The possible combinations
of
modes with the Commodore
128
and
1571
are shown
below:
C1281l571
modes-Turn
on the drive, then turn on or reset the computer.
5
C128/1541
modes-Tum
on or reset the computer, and when the cursor appears, tum on the drive. In this case, the first disk access will switch the drive
to
1571
mode, so send the BASIC command given on
the previous page
to
lock the drive into
1541
mode.
C64!1571 modes
-Tum
on the drive, then tum on or reset the computer and type:
GO 64
C64!1541 modes
-Tum
on the drive, then hold down the COMMODORE key
while you tum on or reset
the
computer.
TROUBLESHOOTING GUIDE
Problem Red power-on
indicator not lit
Green drive light flashing
Programs won't load and the
computer says
"DEVICE
NOT PRESENT
ERROR"
Programs won't load, but the computer and disk drive
gi ve no error message
Possible Cause
Power not
ON
Power cable not
plugged
in
Power off to wall outlet
Drive failing its self test
Interface cable not well
connected or drive not ON
Switches on back
of
drive
may not
be
set for correct
device number Another part
of
the system
may
be
interfering
6
Solution
Make sure ON/OFF switch is
ON
Check both ends
of
power cable to be sure they are full y inserted
Replace fuse or reset circuit
breaker
in
house
Turn the system off for a moment then try again. If the light still flashes. turn the drive off and on again with the interface cable
disconnected.
If
the problem persists. contact your dealer. If unplugging the interface cable made a difference. make sure the cable is properly connected. If that doesn't work, the problem
is
probably
in
the cable itself
or somewhere else
in
the
system Be sure the cable
is
properly connected and the drive is
ON
Check Appendix A for correct setting
to
match
LOAD command Unplug
all
other machines on the computer. If that cures it, plug them
in
one at a time. The one just added when the trouble repeats
is
most likely the problem Trying
to
load a machine language program into BASIC space will cause this problem
TROUBLESHOOTING GUIDE (continued)
Problem
Programs
won't
load and
green dri
ve
light flashes
Possible
Cause
Disk error
Solution
Check the error channel
to determine the error, then follow the advice
in Appendix B to correct it. The error channel
is
explained
in
Chapters 2 and 3
(Be sure to spell program names correctly and include the exact punctuation when loading the programs)
Your programs load OK, but commercial programs and those from other 1571s don't
Your programs that used
to
load,
won't
anymore, but programs saved on newly­formatted diskettes will
Either the diskette
is
faulty,
or your disk drive
is
misaligned
Older diskettes have been damaged
The disk drive has gone out of
alignment
SIMPLE MAINTENANCE TIPS
1.
Keep the drive well ventilated.
Try another copy
of
the
program.
[f
several programs from several sources
fail
to
load, have your dealer align your disk drive
See the safety tips for
diskettes in the next section.
Recopy from backups Have your dealer align
your disk dri
ve
A couple
of
inches
of
space to allow air circulation on all sides will prevent heat from
building up inside the drive.
2. Use Commodore diskettes. Badly-made diskettes can cause increased wear on the drive's read/write head. If you're
using a diskette that
is
unusually noisy,
it
could be causing added wear and
should be replaced.
3. The
1571
should be cleaned once a year
in
normal use.
Several items are likely
to
need attention: the two read/write heads may need cleaning
(with
91
% isopropyl alcohol on a cotton swab). The rails along which the head moves
may need lubrication (with a special molybdenum lubricant, not oil), and the write protect sensor may need
to
be dusted. Since these chores require special materials or
parts, it is best
to
leave the work to an authorized Commodore service center. If you want to do the work yourself, ask your dealer for the appropriate materials. IMPOR­T ANT: Home repair
of
the
1571
will void your warranty.
INSERTING A DISKETTE
To insert a diskette, first open the drive door by rotating the door lever counter-
clockwise one quarter
tum
until
it
stops, with the lever parallel
to
the horizontal slot
in
the
front
of
the drive.
Grasp the diskette by the side opposite the large oval access slot, and hold it with the
label up and the write-protect notch to the left (See Figure 3). Now insert the diskette
by
pushing it straight into the slot, the access slot going
in
first and the label last. Be sure the
diskette goes
in until it stops naturally. You shouldn't have
toforce
or bend it
to
get it in.
7
NOTE:
When the write/protect notch
is
covered by tape, the contents
of
the
diskette cannot be altered or added to. That prevents accidental erasing
of
informa-
tion you want to preserve.
If
a diskette comes without a write/protect notch, the
contents of that diskette were not meant
to
be altered.
Blank diskettes may not have a label on them when you purchase them.
With the diskette
in
position, seat
it
properly for use by twisting the door lever
clockwise one-quarter turn until it stops vertically over the slot.
Warning: If
it
doesn't
move easily, stop. You may have put the diskette
in
the wrong way, or incompletely. If
that happens, reposition the diskette until the door lever closes easily.
=
=
c:::::::::J
OVAL ACCESS
SLOT
WRITE PROTECT
NOTCH
SOMETIMES COVERED WITH TAPE
Figure 3. Inserting a Diskette
DISKETTE
CARE
I.
Don't
touch the exposed parts of a diskette.
That includes the access slot and the center hub (the hole
in
the middle).
2.
Don't
bend a diskette.
They're called floppy diskettes, but they're not supposed to
be
flopped.
3. Keep the diskettes (and disk drive) away from magnets. That includes the electromagnets
in
telephones, televisions, desk lamps, and calculator cords. Keep smoke, moisture, dust, and food off the diskettes. Store diskettes upright in
their paper jackets.
4. Buy diskettes with reinforced hubs. Although the drive usually centers a diskette correctly,
it
would
be
difficult to rescue
data from a diskette recorded with
its
hub off-center. Reinforced hubs make
it
easier
for the drive to center a diskette.
5. Remove a diskette before turning the drive off. If you don't, you might lose part or
all
the data on the diskette.
6. Don't remove a diskette from the drive while the green light
is
glowing.
That light glows when the drive
is
in
use. If you remove the diskette then, you might
lose the information currently being written to the diskette.
8
USING PRE-PROGRAMMED (SOFTWARE) DISKETTES
Your software user's guide should list the procedure for loading the program into
your computer. Nevertheless, we've included the following procedure
as
a general guide.
You'll also use this procedure to load programs or files from your own diskettes. For
purposes
of
demonstration, use the Test/Demo diskette included with the disk drive.
1.
Tum on system.
2. Insert diskette.
3.
If
you are using a VIC 20, Commodore 64, or a Commodore
128
computer in C64
mode, type: LOAD
"HOW
TO USE"
,8
If
you are using a Plus/4 or Commodore
128
in C128 mode, type: DLOAD
"HOW
TO
USE"
4. Press the RETURN key.
5. The following will then appear on the screen:
SEARCHING FOR 0:HOW TO USE LOADING
READY
6. Type: RUN
7. Press the RETURN key.
To load a different program or file, simply substitute its name
in
place
of
HOW TO USE inside the quotation marks. NOTE: The HOW TO USE program is the key to the Test/Demo diskette. When you LOAD and RUN it, it provides instructions for using the rest
of
the programs on the diskette. To find out what programs are on your Test/Demo
diskette, refer
to
the section entitled "DIRECTORIES" later in this chapter.
If a program doesn't load or run properly using the above method, it may
be
that it
is a machine language program. But unless you'll be doing advanced programming, you need not know anything about machine language. A program's user's guide should tell you if it
is
written in machine language.
If
it is, or if you are having trouble loading a
particular program, simply add a
,1
(comma and number
1)
at the end
of
the command.
9
IMPORT ANT
NOTE
Throughout this manual, when the format for a command
is
given,
it
will
follow a particular style. Anything that
is
capitalized must bc typcd
in
exactly
as
it
is
shown (these commands are listed
in
capital letters for style purposes,
DO
NOT
use the SHIFT key when entering these commands). Anything
in
lower case
is
more or less a definition
of
what belongs there. Anything
in
brackets
is
optional.
For instance,
in
the format for the HEADER command given on the following
page, the word HEADER, the capital I
in
lid, the capital 0
in
Ddrive#, and the
capital U
in
Udevice# must
all
be
typed
in
as
is
(Ddrive# and Udevice# are
optional).
On the other hand, diskette name tells you that you must enter a name for the
diskette, but it
is
up to you to decide what that name will be. Also, the
id
in
lid
is
left to your discretion,
as
is
the
device#
in
Udevice#. Thc
drive#
in
Ddrive#
is
always 0 on the 1571, but could be 0 or I on a dual disk drive.
Be
aware, however,
that there are certain limits placed on what you can use.
In
each casc, those limits are explained immediately following the format (for instance, the diskette name cannot be more than sixteen characters and the device#
is
usually 8).
Also be sure to type
in
all punctuation exactly where and how
it
is
shown
in
the format.
Finally, press the RETURN key at the
end
of
each command.
HOW TO PREPARE A
NEW
DISKETTE
A diskette needs a pattern of magnetic grooves
in
order for the drive's read/write
head to
find
things on
it.
This pattern
is
not on your diskettes when you buy them, but you
can use the HEADER command or the NEW command
to
add
it
to a diskette. That
is
known
as
formatting the disk. This
is
the command to use with the C
128
in
C I
28
mode or
Plus/4:
HEADER "diskette
name"
,lid, Ddri
ve#
[, U device# J
Where:
"diskette
name"
is
any desired name for the diskette,
up
to
16
characters long (including
spaces).
"id"
can be any two characters
as
long
as
they don't form a BASIC keyword
(such
as
IF or ON) either on their own or with the capital I bcfore them.
"drive#"
is
0 .
"device#"
is
8, unless you have changed
it
as
per instructions
in
Appendix A (the
1571
assumes 8 even if you don't type
it
in).
The command for the C64, VIC 20, or CI28
in
C64 mode
is
this:
OPEN 15,device#,
15,
"NEWdrive#:diskette name,id"
CLOSE
15
The device#,
drive#,
diskette name, and
id
are the same
as
described above.
The OPEN command
is
explained
in
the next chapter. For now, just copy
it
as
is.
10
NOTE TO ADVANCED USERS
If you want to use variables for the diskette name or id, the format
is
as
follows:
C128, Plus/4:
HEADER (A$),J(B$),DO
C64: OPEN
J5,8,15:PRINT#15,"NO:"+A$+B$:CLOSEI5
Where:
A$ contains the diskette name (16 character limit) B$ contains the
id
(2 characters long)
After you format a particular diskette, you can reformat
it
at any time. You can
change
its
name and erase
its
files faster by omitting the
id
number
in
the HEADER
command.
DISKETTE DIRECTORY
A directory
is
a list of the files on a diskette. To load the directory
on
the C
128
or Plus/4, type the word DIRECTORY on a blank line and press the RETURN key or simply press the
F3
key on the C128. That doesn't erase anything
in
memory,
so
you can call up a directory anytime--even from within a program. The C64 directory command, LOAD "$",8
(press RETURN) LIST (press RETURN), does erase what's
in
memory.
If
a directory doesn't all
fit
on the screen,
it
will scroll
up
until
it
reaches the last line. If you want to pause, stop, or slow down the scrolling, refer to your particular computer's user's manual for instructions
as
to
which keys
to
use.
To get an idea
of
what a directory looks like, load the directory from the Test/Demo
diskette.
The 0 on the left-hand side
of
the top line
is
the drive number of the
1571
(on a dual
disk drive it could be 0 or
1). The diskette name
is
next, followed by the diskette
id-both
of which are determined when the diskette
is
formatted.
The
2A
at the end
of
the top line means the
1571
uses Version 2A
of
Commodore's
disk operating system (DOS).
Each of the remaining lines provides three pieces
of
information about the files on the
diskette. At the left end
of
each line is the size
of
the
file
in
blocks
of
254 characters. Four
blocks are equivalent to almost I K of memory inside the computer. The middle
of
the line
contains the name
of
the
file
enclosed
in
quotation marks. All characters within the
quotation marks are part
of
the filename. The right side
of
each line contains a three-letter
abbreviation
of
the
file
type. The types
of
files are described
in
later chapters.
11
TYPES OF FILES
PRG-Program SEQ-Sequential REL-Relative
USR-User DEL-Deleted
(you won't see this type)
Note: Direct Access files, also called Random files,
do
not automatically appear in
the directory. They are covered in Chapter 7.
The bottom line
of
a directory shows how many blocks are available for use. This
number ranges from 664 (in
1541
mode) and 1328 (in
1571
mode) on a newly formatted
diskette
to
0 on one that
is
completely full.
SELECTIVE DIRECTORIES
By altering the directory LOAD command, you can create a kind
of
"sub-directory"
that lists a single selected type
of
file. For example, you could request a list
of
all
sequential data files (Chapter 5), or one
of
all the relative data files (Chapter 6). The
format for this command
is:
LOAD"$0:pattern = filetype",8 (for the C64)
where pattern specifies a particular group
of
files, and filetype
is
the one-letter abbrevia-
tion for the types
of
files listed below:
P
= Program
S
= Sequential
R
= Relative
U
= User
The command for the C128 and Plus/4
is
this: DIRECTORY " pattern = filetype"
Some examples:
LOAD"$0:*
=
R",8
and DIRECTORY"* =
R"
display all relative files.
LOAD"$0:Z*
=
R",8
and DIRECTORY"Z* =
R"
display a sub-directory consist-
ing
of
all relative
files
that start with the letter Z (the asterisk
(*)
is
explained in the
section entitled "Pattern Matching. "
12
PRINTING A DIRECTORY
To get a printout
of
a directory, use the following:
LOAD"$"
,8 OPEN4,4:CMD4:LIST PRINT#4:CLOSE4
PATTERN MATCHING
You can use special pattern-matching characters
to
load a program from a partial
name
or
to provide the selective directories described earlier.
The two characters used in pattern matching are the asterisk (*) and the question
mark (?). They act something like a wild card in a game
of
cards. The difference between the two is that the asterisk makes all characters in and beyond its position wild, while the question mark makes only its own position wild. Here are some examples and their results:
LOAD" A *"
,8
loads the first file on disk that begins with an A, regardless
of
what
follows
DLOAD"SM?TH"
loads the first file that starts with SM, ends with TH, and one
other character between
DIRECTORY"Q*"
loads a directory of files whose names begin with Q
LOAD"*",8
is
a special case. When
an
asterisk
is
used alone
as
a name, it matches
the last
file
used (on the C64 and
Cl28
in C64 mode).
LOAD
"0:*",8
loads the first file on the diskette (C64 and
Cl28
in C64 mode).
DLOAD
"*,,
loads the first
file
on the diskette (Plus/4 and C128
in
Cl28
mode).
SPLAT FILES
One indicator you may occasionally notice on a directory line, after you begin saving
programs and files, is an asterisk appearing just before the
file
type
of a file
that is 0 blocks long. This indicates the file was not properly closed after it was created, and that it should not be relied upon. These
"splat"
files normally need to be erased from the
diskette and rewritten. However,
do
not use the SCRATCH command
to
get rid
of
them.
They can only be safely erased by the VALIDATE or COLLECT commands. One
of
these should normally be used whenever a splat
file
is
noticed on a diskette.
All
of
these
commands are described in the following chapters.
There are two exceptions
to
the above warning: one
is
that VALIDATE and
COLLECT cannot be used on some diskettes that include direct access (random)
files
(Chapter 7). The other
is
that
if
the information
in
the splat
file
was crucial and can't be
replaced, there is a way to rescue whatever part
of
the
file
was properly written. This
option is described in the next chapter.
13
--
--
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
error or not, but if there was
an
error, the program clears it from disk memory and turns
off the error light on the disk drive.
Once the message
is
on the screen, you can look it
up
in
Appendix B
to
see what it
means, and what to
do
about it.
For those
of
you who are writing programs, the following
is
a small error-checking
subroutine you can include in your programs:
59980 REM READ ERROR CHANNEL 59990INPUT#15,EN,EM$,ET,ES 60000 IF
EN>1
THEN PRINT EN,EM$,ET,ES:STOP
60010 RETURN
This assumes
file
15
was opened earlier
in
the program, and that
it
will
be
closed at
the end
of
the program.
The subroutine reads the error channel and puts the results into the named varia-
bles-EN
(Error Number), EM$ (Error Message), ET (Error Track), and
ES
(Error
Sector).
Of
the four, only EM$ has
to
be a string. You could choose other variable names,
although these have become traditional for this use.
Two error numbers are harmless---O means everything
is
OK, and 1 tells how many
files were erased by a SCRATCH command (described later
in
this chapter). If
the
error
status
is
anything else, line 60000 prints the error message and halts the program.
Because this
is
a subroutine, you access
it
with the BASIC GOSUB command, either in immediate mode or from a program. The RETURN statement in line 60010 will jump back
to
immediate mode or the next statement
in
your program, whichever
is
appropriate.
BASIC
HINTS
Hint
#1:
It
is
best
to
open
file
15
once at the very start
of
a program, and only close it at
the end
ofthe
program, after
all
other files have already been closed. By opening it once at
the start, the file is open whenever needed for disk commands elsewhere
in
the
program.
Hint
#2:
If
BASIC halts with an error when you have files open, BASIC aborts them
without closing them properly on the disk. To close them properly
on
the disk, you must
type:
CLOSE 15:0PEN
15,8,15,"I":CLOSE
15
This opens the command channel and immediately closes it, along with
all
other disk
files. Failure to close a disk
file
properly both
in
BASIC and
on
the
disk may result
in
losing the entire file.
Hint
#3:
One disk error message
is
not always an error. Error 73,
"CBM
DOS 3.0
1571" will appear if you read the disk error channel before sending any disk commands
when you tum on your computer. This
is
a handy way
to
check which version
of
DOS
you
are using. However, if this message appears later, after other disk commands,
it
means
there
is
a mismatch between the DOS used
to
format your diskette and the
DOS
in
your
drive. DOS
is
Disk Operating System.
15
Hint
#4:
To reset drive, type: OPEN 15,S,15,"UJ":CLOSE 15. This also applies to
sending a VI
+
or
a VI.
SAVE
Vse the SAVE command
to
preserve a program or
file
on a diskette for later use.
Before you can SAVE
to
diskette, the diskette must be formatted,
as
described
earlier.
FORMAT FOR THE SAVE COMMAND
SAVE
"drive
#:file name" ,device #
where "file name" is any string expression
of
up to
16
characters, preceded by the drive
number and a colon, and followed by the device number
of
the disk, normally
S.
However, the SAVE command will not work
in
copying programs that are not in the
BASIC text area, such as
"DOS
5.1"
for the C64. To copy it and similar machine-
language programs, you will need a machine-language monitor program.
FORMAT FOR A MONITOR SAVE
.S "drive #:file name" ,device # ,starting address,ending address
+ 1
where "drive
#:"
is
the drive number, 0 on the 1571; "file name"
is
any valid
file
name
up to
14
characters long (leaving two for the drive number and colon); "device
#"
is a
two digit device number, normally
OS
(the leading 0
is
required); and the addresses
to
be
saved are given in Hexadecimal but without a leading dollar sign
($). Note the ending
address listed must be one location beyond the last location
to
be saved.
EXAMPLE:
Here
is
the required syntax
to
SAVE a copy of
"DOS
5.1"
.S "O:DOS
5.1"
,OS,CCOO,DOOO
SAVE WITH REPLACE OPTION
If a file already exists, it can't be saved again with the same name because the disk
drive only allows one copy
of
any given
file
name per diskette. It
is
possible to get around this problem using the RENAME and SCRATCH commands described later. However, if all you wish
to
do
is
replace a program or data
file
with a revised version, another
command is more convenient. Known
as
SAVE-WITH-REPLACE, or @SAVE, this
option tells the disk drive to replace any
file
it
finds
in
the diskette directory with the same
name, substituting the new
file
for the old version.
16
FORMAT FOR SAVE WITH REPLACE:
SAVE"@Drive #:file
name",
device #
where all the parameters are
as
usual except for adding a leading
"at"
sign (@.) The
"drive
#:"
is required here.
EXAMPLE:
SA VE"@O:REVISED PROGRAM"
,8
The actual procedure
is
that the new version
is
saved completely, then the old version
is
erased. Because it works this way, there is little danger a disaster such
as
having the power going off midway through the process would destroy both the old and new copies of
the file. Nothing happens
to
the old copy until after the new copy is saved properly.
Caution--do not use @SAVE on
an
almost-full diskette. Only use it when you have
enough room on the diskette to hold a second complete copy
of
the program being
replaced. Due
to
the way @SAVE works, both the old and new versions
of
the
file
are
on
disk simultaneously at one point,
as
a way
of
safeguarding against loss
of
the program.
If
there
is
not enough room left
on
diskette
to
hold that second copy, only
as
much
of
the
new version will be saved
as
there
is
still room for. After the command executes, a look at
the directory will show the new version
is
present, but doesn't occupy enough blocks
to match the copy in memory. Unfortunately, the VERIFY command (see below) will not detect this problem, because whatever was saved will have been saved properly.
VERIFY
Although not
as
necessary with a disk drive
as
with a cassette, BASIC's VERIFY
command can be used to make doubly certain that a program
file
was properly saved
to disk. It works much like the LOAD command, except that it only compares each character in the program against the equivalent character in the computer's memory, instead
of
actually being copied into memory.
If
the disk copy
of
the program differs even a tiny bit from the copy in memory, "VERIFY ERROR" will be displayed, to tell you that the copies differ. This doesn't mean either copy is bad, but if they were supposed to
be
identical, there
is
a problem.
Naturally, there's
no
point in trying to VERIFY a disk copy
of
a program after the
original is no longer in memory. With nothing
to
compare to,
an
apparent error will
always be announced, even though the disk copy is always and automatically verified
as
it
is
written to the diskette.
FORMAT FOR THE VERIFY COMMAND:
VERIFY "drive#:pattern" ,device#,relocate
flag
where
"drive#:"
is
an optional drive number, "pattern" is any string expression that
evaluates
to a file
name, with or without pattern-matching characters, and
"device#"
is
the disk device number, normally 8.
If
the relocate
flag
is
present and equals
1,
the
file
will be verified where originally saved, rather than relocated into the BASIC text area.
17
A useful alternate form
of
the command
is:
VERIFY"*"
,device #
It verifies the last files used without having
to
type its name or drive number. However, it
won't work properly after SAVE-WITH-REPLACE, because the last file used was the
one deleted, and the drive will try
to
compare the deleted
file
to
the program in memory. No harm will result, but "VERIFY ERROR" will always be announced. To use VERIFY after @SAVE, include at least part
of
the
file
name that
is
to be verified in the pattern.
One other note about
VERIFY-when
you VERIFY a relocated BASIC file,
an
error
will nearly always be announced, due
to
changes in the link pointers
of
BASIC programs
made during relocation.
It
is best
to
VERIFY files saved from the same type
of
machine, and identical memory size. For example, a BASIC program saved from a Plus/4 can't be verified easily with a C64, even when the program would work
fine
on both machines.
This shouldn't matter,
as
the only time you'll be verifying files on machines other than the
one which wrote them
is
when you are comparing two disk files to see if they are the same. This is done by loading one and verifying against the other, and can only be done on the same machine and memory size
as
the one on which the files were first created.
SCRATCH
The SCRATCH command allows you
to
erase unwanted files and free the space they
occupied for use
by
other files. It can be used
to
erase either a single
file
or several files at
once via pattern-matching.
FORMAT
FOR
THE
SCRATCH
COMMAND:
PRINT#15, "SCRATCH(I):pattern"
or abbreviate it
as:
PRINT # 15, "S(I):pattern"
"pattern"
can be any
file
name or combination
of
characters and wild-card characters.
As
usual, it
is
assumed the command channel has already been opened
as
file
15.
Although
not absolutely necessary, it
is
best
to
include the drive number
in
SCRATCH commands.
If
you check the error channel after a SCRATCH command, the value for ET (error track) will tell you how many files were scratched. For example, if your diskette contains program files named
"TEST,"
"TRAIN,"
"TRUCK,"
and
"TAIL,"
you may SCRATCH all four, along with any other files beginning with the letter' 'T," by using the command:
PRINT#15, 'SO:T*'
Then, to prove they are gone, you can type:
GOSUB 59990
18
to call the error checking subroutine given earlier
in
this chapter. If the four listed were the
only files beginning with
"T",
you will see:
01
,FILES SCRATCHED,04,00
READY.
The
"04"
tells you 4 files were scratched.
MORE ABOUT SCRATCH
SCRATCH is a powerful command and should be used with caution
to
be sure you
delete only the files you really want erased. When using
it
with a pattern,
we
suggest you
first use the same pattern
in
a DIRECTORY command, to be sure exactly which files will
be deleted. That way you'll have no unpleasant surprises when you use the same pattern
in
the SCRATCH command.
Recovering from a SCRATCH
If
you accidentally SCRATCH a
file
you shouldn't have, there
is
still a chance of
saving it. Like BASIC's NEW command, SCRATCH doesn't really wipe out a
file
itself;
it merely clears the pointers to
it
in
the diskette directory. There may be an "Unscratch"
program on your Test/Demo diskette.
NOTE:
If you accidentally SCRATCH a
file
within the DOS Shell (see Chapter 4),
you can unscratch it with the Shell's RESTORE FILES function.
More about Splats
Never scratch a splat file. These are files that show up
in
a directory listing with an
asterisk
(*) just before the
file
type for an entry. The asterisk (or splat) means that
file
was
never properly closed, and thus there
is
no valid chain
of
sector links for the Scratch
command to follow
in
erasing the file.
If you SCRATCH such a file, odds are you will improperly free up sectors that are
still needed by other programs or files and cause permanent damage to those later when
you add more files to the diskette.
If
you
find
a splat file, or if you discover too late that you have scratched such a file, immediately validate the diskette using the VALIDATE command described later
in
this chapter. If you have added any files to the diskette since
scratching the splat file, it
is
best to immediately copy the entire diskette onto another fresh diskette, but do this with a copy program rather than with a backup program. Otherwise, the same problem will be recreated on the new diskette. When the new copy is done, compare the number
of
blocks free
in
its directory to the number free on the original diskette. If the numbers match, no damage has been done. If not, very likely at least one file on the diskette has been corrupted, and all should be checked immediately.
19
Locked Files
Occasionally, a diskette will contain a locked
file;
one which cannot be erased with
the SCRATCH command. Such files may be recognized by the
"<"
character which
immediately follows the
file
type
in
their directory entry.
If
you wish
to
erase a locked
file, you will have
to
use a disk monitor
to
clear bit 6
of
the file-type byte
in
the directory
entry on the diskette. Conversely,
to
lock a file, you would set bit 6
of
the same byte.
RENAME
The RENAME command allows you
to
alter the name of a program or other
file
in the
diskette directory. Since only the directory
is
affected, RENAME works.very quickly.
FORMAT FOR RENAME COMMAND:
PRINT#15, "RENAME0:new name = old name"
or it may be abbreviated as:
PRINT#15,"R0:new
name=old
name"
where
"new
name"
is
the name you want the
file
to have, and
"old
name"
is
the name
it
has now.
"new
name" may be any valid
file
name,
up
to
16
characters in length.
It
is
assumed you have already opened
file
15
to
the command channel.
One
caution-be
sure the
file
you are renaming has been properly closed before you
rename it.
EXAMPLES:
Just before saving a new copy
of
a "calendar" program, you might type:
PRINT#
15,"R0:CALENDAR/BACKUP = CALENDAR"
Or
to
move a program called
"BOOT,"
currently the first program on a diskette
to
someplace else in the directory, you might type:
PRINT#15,
"R0:TEMP=
BOOT"
followed
by
a COPY command (described later),.which turns
"TEMP"
into a new copy
of
"BOOT,"
and finishing with a SCRATCH command
to
get rid
of
the original copy
of
"BOOT.
"
20
RENAMING AND SCRATCHING TROUBLESOME FILES (ADVANCED USERS)
Eventually, you may run across a file which has an odd filename, such as a comma
by itself
(" , ")
or one that includes a Shifted Space (a Shifted Space looks the same
as
a
regular space, but
if
a file with a space in its name won't load properly and all else
is correct, it's probably a Shifted Space). Or perhaps you will find one that includes nonprinting characters. Any
of
these can be troublesome. Comma files, for instance, are
an exception
to
the rule that no two files can have the same name. Since it shouldn't be
possible to make a file whose name
is
only a comma, the disk never expects you
to
do
it
again.
Files with a Shifted Space in their name can also be troublesome, because the disk
interprets the Shifted Space as signaling the end
of
the
file
name, and prints whatever
follows after the quotation mark that marks the end
of
a name in the directory. This
technique can be useful by allowing you
to
have a long file name, and making the disk
recognize a small part
of
it as being the same as the whole thing without using pattern-
matching characters.
In
any case,
if
you have a troublesome filename, you can use the CHR$O function to specify troublesome characters without typing them directly. This may allow you to build them into a RENAME command.
If
this fails, you may also use the pattern-matching
characters in a SCRATCH command. This gives you a way
to
specify the name without
using the troublesome characters at all, but also means loss
of
your file.
For example, if you have managed
to
create a file named
""MOVIES",
with an
extra quotation mark at the front
ofthe
file
name, you can rename it
to
"MOVIES"
using
the CHR$O equivalent
of
a quotation mark in the RENAME command:
PRINT#15, "R0:MOVIES
="
+CHR$(34) +
"MOVIES"
The CHR$(34) forces a quotation mark into the command string without upsetting BASIC. The procedure for a file name that includes a Shifted Space
is
similar, but uses
CHR$(160).
In
cases where even this doesn't work, for example,
if
your diskette contains a
comma file, (one
named"
,")
you can get rid
of
it
this
way:
PRINT#15,
"S0:?"
This example deletes all files with one character names. Depending on the exact problem, you may have
to
be very creative in choosing pattern-matching characters that will affect only the desired file, and may have to rename other files first
to
keep them from being scratched.
In
some cases, it may be easier
to
copy desired files
to
a different diskette and leave
the troublesome files behind.
COpy
The COPY command allows you to make a spare copy of any program or
file
on a
diskette. On a single drive like the 1571, the copy must be on the same diskette, which
means it must be given a different name from the file copied. It's also used
to
combine up
21
to
four sequential data files (linking the files one
to
another, end
to
end
in
a chain). Files
are linked in the order
in
which they appear
in
the command. The source files and other
files on the diskette are not changed. Files must be closed before they are copied or linked.
FORMAT FOR THE COPY COMMAND
PRINT#IS,"COPYdrive
#:new
file=old
file"
EXAMPLES:
PRINT#lS,'
'COPY0:BACKUP= ORIGINAL"
or abbreviated as
PRINT#1 S,"Cdrive
#:new
file=old
file"
PRINT#IS,
"C0:BACKUP = ORIGINAL"
where
"drive
#"
is the drive number
"new
file"
is
the copy and
"old
file"
is
the
original.
FORMAT FOR THE COMBINE OPTION
PRINT#lS,
"Cdrive
#:new
file = file
1 ,file 2,file 3,
file
4"
where
"drive
#"
is
always 0,
NOTE: The length
of
a command string (command and filenames)
is
limited to
41
characters.
EXAMPLES:
After renaming a
file
named
"BOOT"
to
"TEMP"
in the last section's example,
you can use the
COpy
command
to
make a spare copy of the program elsewhere
on
the
diskette, under the original name:
PRINT#IS,
"C0:BOOT =
TEMP"
After creating several small sequential files that
fit
easily
in
memory along with a
program we are using, you can use the concatenate option to combine them
in
a master
file, even if the result
is
too big
to
fit
in
memory. (Be sure it will
fit
in remaining space on
the
diskette-it
will be
as
big
as
the sum
of
the sizes of the files in it.)
PRINT#IS,
"C0:A-Z = A-G,H-M,N-Z"
22
Loading...
+ 102 hidden pages