Commodore 2040, 3040, 4040, 8050 User Manual

User's
for
Manual
CBM
5Y4-inch
Dual
Floppy Disk
Drives
commodore
User's
for
Manual
CBM
Dual
Floppys
Model Model
Appropriate
Commodore
Series Series
Series
Series
Part Number 320899
2040-Model 4040 3040-Model 8050
2001 3000 CBM) 4000 8000 CBM)
Drive
for
use
Computers
(CBM-PET)
PET)
with:
October 1980
(I[
commodore
© 1980 Commodore Business Machines, Inc.
Chapter 1
Table of Contents
Introduction.
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Care Of The 2040, 3040, 4040 and 8050 . . . . . . . . . . . . . . . . . . . . 9
Care Unpacking The Disk Drive 9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Front Panel 3 Back Panel 3 Interior Configuration 4
The Diskette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Of
The Diskettes 9
Page
Chapter 2
Chapter 3
Preparing To
Connecting The Disk Drive To The Computer 11 Performing The Power-On Test 12 Inserting The Diskette Into The 8050 13
Learning How To
The Block Availability The Disk Operating System (DOS) , 22
Disk Maintenance Commands. . . . . . . . . . . . . . . . . . . . . . . . . . .
Use
Your Disk Drive 11
Inserting The Diskette Into The 2040, 3040 and 4040 The 4040 and 8050 Performance Test 14 The 2040 and 3040 Performance Test 17
Use
Your Floppy Disk Drive
Map
(BAM)
NEW
HEADER (BASIC 4.0 Direct Command) . .
Initialization (2040 and 3040) . . . . . . . . . . . . . . . . . .
Initialization (4040) . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialization (8050) . . . . . . . . . . . . . . . . . . . . . . . . . .
The Directory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LOAD$ 26
DIRECTORY (BASIC 4.0 Direct
Printing The
Directory.
. . . . . . . . . . . . . . .
Command).
..
13
21 22
..
23
24
..
25
..
25
..
26
..
26
..
26 27
..
27
iii
VALIDATE..................................
COLLECT (BASIC 4.0 Direct Command). .
28
..
28
DUPLICATE 28
..
29 29
..
31
..
31
COpy
BACKUP (BASIC 4.0 Direct Command). . . COpy
(BASIC 4.0 Direct Command) . . . . .
CONCAT (BASIC 4.0 Direct Command). . .
RENAME 31
..
RENAME (BASIC 4.0 Direct Command) . .
32
SCRATCH 32
..
SCRATCH (BASIC 4.0 Direct Command). .
33
Chapter 4
Chapter 5
BASIC Commands For Data Handling 35
..
BASIC Commands Associated with Floppy Disk Drives . . . . . . .
to
SAVE and DSAVE (Writing a Program
a Diskette) .
35
..
36
LOAD and DLOAD (Reading a Program from a
Diskette) 36
VERIFy.....................................
37 OPEN 38 DOPEN 39
CLOSE......................................
39 DCLOSE 40 Closing The Command Channel 40 Closing The Data Channel 41
PRINT# . . . .
.. ..... .... . . . . .
.. ..
..
.
..
41 INPUT# 42 GET#
43 RECORD# 43
Quickload Feature (BASIC 4.0)
to
Moving a Tape Program
Disk 45
. . . . . . . . . . . . . . . . . . . . . . .
..
44
..
Advanced Disk Programming 47
Commodore Disk Operating System (DOS) 47
..
Disk Utility Command Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BLOCK-READ................................
BLOCK-WRITE. . . . . . . .
......
. .... ..... ..
. . .
48
49
..
50 BLOCK-EXECUTE 50
..
BUFFER-POINTER . . . . . . . . . . . . . . . . . . . . . . . . . .
..
BLOCK-ALLOCATE "
. . . . . . . . . . . ....
50
..
51
MEMORy 51
MEMORY-WRITE
MEMORY-READ. . . . . . . . . . . . . . . . . . . .
51
..
52
MEMORY-EXECUTE 52
USER.......................................
8050
Disk Zones 59
52
Chapter 6
IV
Advanced File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Special Open and Close Statements For Direct Access . . . . . . . .
Random Access Example . . . . . . . . . . . . . . . . . . . . . .
To Create A File . . . . . . . . . . . . . . . . . . . . .
To Add A
Record.
. . . . . . . . . . . . . . . . . . .
To See A Record 68 To Change A Record 68
Getting The Directory of Listings . . . . . . . .
..
65
..
65
..
66
..
66
..
67
..
69
Ending The Program . . . . . . . . . . . . . . . . . .
Relative Files 4040, 8050 . . . . . . . . . . . . . . . . . . . . . .
Creating A Relative File Expanding A Relative File 72
Accessing A Relative File . . . . . . . . . . . . . . . . . . . . . .
..
. . . . . . . . . . . . . . . . . . . . .
..
69
..
69
..
72
..
73
Chapter 7
Chapter 8
Chapter 9 Chapter 10
Simplifying The
Loading The Using The Loading A Program With The Loading And Running A Program With Special
Error Messages - Pattern Matching File Names - Disk Commands. . .
Requesting Error Messages: Commodore Disk Drives. . . . . . . . .
Summary Of Description of Pattern Matching 85
User's Quick Reference: Disk Commands. . . . . . . . . . . . . . . . . .
Random 1.00 Program Listing 89
Index , . . . . . . . . . . . . . . .
Use
of Commodore Disk-Related
DOS
Support Program . . . . . . . . . . . . . . . . . . . . . .
DOS
Support Symbols: >and @ . . • • . • • . • . • . • • . •
Commands.
. . . . .
1. ... . . . . . . . . . . . .. . . . . . . . . .
Up
Arrow... . . . . . . . .
DOS
Support Information 79
CBM
Floppy Error Messages 82
DOS
Error Messages 82
List of Illustrations
Figure Title
1 Models 2040, 3040, 4040, 8050: Rear View 5 2 Floppy Disk Hookup 12 3 Position For Diskette Insertion 13 4 5 8050 Format: Expanded View of A Single Sector 63
2040,3040,4040
Format: Expanded View of A Single Sector 62
..
77
..
77
.•
78
..
78
..
79
..
81
..
81
..
86
..
95
Page
List of Tables
Table Title
1 Suggested Reading List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Specifications: Model 8050 Dual Drive Floppy Disk 6 3 Specifications: Models 4 Specifications: Model 4040 Dual Drive Floppy Disk 8
5 Standard Jump Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 Block Distribution 7 8
9 4040 10 11 8050 Directory Header 12
2040,3040 2040,3040
BAM
4040 Directory Header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8050
BAM
BAM Directory
Format.
Format.
2040/3040 Dual Drive Floppy
By
Track 54
Format.
. . . . . . . . . . . . . . . . . . . . . . . . .... . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Header.
Block.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Disk.
. . . . . . . . . 7
Page
..
53
..
55
..
55
..
56
..
56
..
57
..
58
v
13
14
15
16
17
Directory Sequential Format Program File Format Relative File Format 70 User's Quick Reference - Disk Commands 87
Format.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
60
61 61
vi
Chapter
1
INTRODUCTION
The disk-oriented Commodore Computer System of providing you, the user, with large file-handling capabilities supported by gramming commands and further simplified by
Read the Table of Contents and become acquainted with the broad scope of material
in
covered
gram by utilizing the computer drive ment of the system tionship
That's why it Grasping and understanding the concept that each individual component acts and reacts to signals and commands from other devices in the system will greatly accelerate your funda­mental grasp of how the basis of this manual: teaching you how to gain mastery of the system so that it will
perform as desired. That fashion: it permits you
The first chapters discuss basic hardware features and permit you, right from the start,
become familiar with the disk drive by doing the performance tests which comprise the first
essential "hands learning
more comprehensive subjects.
this manual.Ithas been designed to assist you in pursuing an educational pro-
as
an adjunct to the learning process. That is, once the disk
is
properly interfaced to a Commodore Computer,
as
the hardware. Your importance, however,ismeasured in direct rela-
to
how well you understand howtoeffectively utilize the hardware and software.
is
besttothink of your computer and disk driveasonly part of a system.
to
operate, control, and master the system. This basic concept forms
is
the primary reason this manualislaid
to
advanceasfast as you desire.
on"
experience. Then, by actually using your particular disk drive and
to
carefully follow instructions, you can gain confidence in order to proceed
was
designed around the central concept
DOS
Support command abbreviations.
YOU
become as important an ele-
outina building block
BASIC
pro-
to
to
By
the time you begin Chapter 3-Learning How To have already used some portions of the until Chapter 7. The reason for this procedure lies within the purpose of simplifying commands. command structure of archy at an early stage. This concept of providing you with enough essential information complete a task, a step-by-step description of the task, and meaningful examplesisa feature of this manual which will provide you with sufficient incentive to actually complete the task.
It
is
actually easier to instruct a new user by using the simplified
DOS
Support than attempting to explain the entire command hier-
DOS
Support system whichisnot fully described
Use
Your Floppy Disk Drive-you will
DOS
Support:
to
1
The manner in which this manual Difficult concepts and procedures have been broken down through examples which provide ample each command description. When possible, command description and,asan Chapter 8 for easy access if problems persist.
is
laid
out
encourages
opportunitytoexperiment laterbyreturning
the
command
additional aid, a User's Quick Reference has been placed in
the
conceptoflearningbydoing.
into
steps
that
walk
the
user
format
has been included with
to
the
Error messages are also presented in Chapter 8 where needed. The Error Message discussions have been expanded
• How
• Error message summary.
• Detailed error message descriptions.
For
those users who have been reluctanttoattempt sumed degree manual from least difficult
• Commands for file manipulation and maintenance
• Commands for
• Advanced programming
• Advanced file handling
• Simplified commands
Users who have advanced subjects such as random access or relative files while others may be just following the
user with essential information in a logical sequence. Follow
step-by-step procedures, and learnbydoing.
With
the
the
computing powerofyour
should study
1. You will benefit most if
Table
those features CBM
Floppys.
to
request error messages.
of
difficulty,
data
attained
the
manual's format. In either case, this manual has been laid
purchaseofyour
your
computer's
that
relatetoyour
note
that
the
entire disk command hierarchyisstructured in this
to
more complex:
handling
some degreeofprogramming skills may desiretobegin with
Commodore Dual Drive
Commodore system.
user guide, and if necessary
you
first read through this entire manual, taking
particular floppy as well as those which are
they
can be quickly referenced, if
to
include:
disk programming becauseofthe
the
examples,
GENERAL
Floppy
To
get
Disk the the
you most BASIC manuals listed in
INFORMATION
have greatly enhanced
outofyour
pre-
the
content
outtoprovide
attempt
commontoall
system
note
with
the
you
of
The information presented in this manual is extensive and may, in some cases, present in-
formation and thoughtfully studying its
sively upgrade
This manual presents discussions, descriptions, practices and procedures relating and operation
Four
2
thatiscurrently
your
programming skills and expertise.
of
all Commodore 5-1I4-inch Dual
models are discussed: Model Model Model Model
2040 3040 4040 8050
(DOS (DOS (DOS2) (DOS 2.5)
1)
1)
beyond
contents
your particular levelofexpertise. However, by carefully
you
will gain
the
Floppy
confidence necessarytoprogres-
to
Disk Drives.
the
use
The floppys are operationally compatible with the following Commodore Computers.
1. Series 2001
2. Series 2001 - PET 8K - Upgraded to BASIC Version 3.0
3. Series 3000 - 16K and 32K - Operating
4. Series 4000 - PET 8K, 16K, and 32K - Operating
5. Series 8000 - 32K - Operating For ease of reference, the Models 2040,
Disks will and noted otherwise.
-16K
be
referred to in this manualas"the
"the
8050", respectively.
and 32K - Operating With BASIC Version 3.0
With
BASIC Version 3.0
With
BASIC Version 4.0
With
BASIC
All
descriptions and discussions are common unless
Version 4.0
3040,4040,
2040",
and 8050 Dual Drive Floppy
"the
3040",
"the
4040",
DESCRIPTION
All
CBM
Floppys describedinthis manual are dual-drive diskette storage devices. Their individual primary components consist of read/write controls, drive motor electronics, two drive mechanisms, two read/write heads, and track positioning mechanisms. discussed is
an "intelligent" peripheral, their operation requiresnospace in the computer's memory. This means you have just have the disks attached.
in
this manual conform to IEEE-488 interface requirements. Because each device
as
much computer memory availabletoyouaswhen you do not
All
disk drives
Front Panel
The front panel of the respective disk drive consists of an identification panel across the top;
in
slots
the doorisclosed, the disketteisclamped onto the diskette spindle hub. Also on the front
panel are three LED indicator lights. The one on the right cator, and lights when drive 0 the 8050, the LED in the middleisa two-color power/error indicator. Itisnormally green, indicating power 4040 the middle LED occurs.
whichtoinsert two diskettes; and doors to close after inserting the diskettes.
is
called the Drive 0 Active Indi-
is
active. The LED on the left does the same for drive 1.
ON
but flashes red whenever a disk error occurs. On the 2040, 3040, and
is
activated if powerisapplied or removed, and whenever an error
When
On
Back Panel
The back of each disk drive contains an IEEE-488 interface connector. Near the panel's
is
lower edge
power cord.
the power ON/OFF switch. Thereisalso a "slow blow" fuse, and the
AC
3
Table 1. Suggested Reading List
ICBM Personal
Pet
Computer
Guide. C.S.Donahue andJ.K. Enger, Osborne/McGraw-Hill, Berkeley,
CA
94710
Hands-On Basic with a Pet.
H. D. Peckham,
McGraw-Hill,
1979
Entering BASIC.
J.
J. Sack and
BASIC: A
C.
Pegels, Holden-Day, Inc.,
Computer
Meadows, Science Research Associates,
Programming Language.
1973
BASIC Programming.
J. Kemeny and T. Kurtz,
3100), Menlo Park, CA
BASIC
FOR
HOME COMPUTERS.
Albrecht, Finkle
3100), Menlo Park,
A Guided
TourofComputer
T. Dwyer,
Houghton Mifflin Co.,
Peoples
94025,
and
Brown, Peoples
CA
94025,
Programming in BASIC.
Computer
1967
Computer
1973
1973
Programing Time Shared Computer in BASIC.
Eugene H. Barnett,
Programming Language
Digital
101 BASIC
Equipment
Computer
Software Distribution Center,
Wiley-Interscience, LIC 72-175789
#2.
Corp., Maynard,
MA
01754
Games.
Digital
Equipment
WhatdoTo After You Hit Return.
Peoples
Computer
Co.,
1010
Doyle (P.O. Box
Basic BASIC.
S.
James
WORKBOOKS
T.I.S., P.O. Box 921, Los Alamos,
Programming
R. Zaks,
Coan, Hayden
1-5.
the
6502.
Sybex,
1978
Book
Co., Rochelle Park, NJ
NM
87544
24 Tested, Ready-to-Run Game Programs in Basic.
K.
Tracton, Tab Books,
1978
Some Basic Programs.
M.
Borchers and R. Poole, Osborne & Assoc. Inc.,
Basic Programming for Business.
I.
H. Forkner, Prentice-Hall,
1977
The Channel Data Book.
B. Lewis,
PET and
Osborne/McGraw-Hill,
the
5960
IEEE
Mandarin Ave., Goleta, CA
488
Bus (GPIP).
630
Bancroft Way, Berkeley,
93017,1978
Co.,
1010
Co.,
1010
Corp., Maynard,
3100),
1978
CA
630
Bancroft Way,
1973
Doyle (P.O. Box
Doyle (P.O. Box
MA
Menlo Park,
CA
94710
01754
94025
The interiorofyour
tained within
disk spindles.
4
floppy contains two disk drives. All
the
unit. The mechanical devices are, for
Interior Configuration
the
logic for
the
most part, located beneath
the
disk drive is con-
the
The Diskette
The diskette (also knownasa minifloppy, floppy diskette, minidiskette, etc.)issimilar the standard flexible disk. There are several reputable manufacturers of the 5 1/4-inch diskettes. You should make sure that you buy diskettes for SOFT SECTORED FORMAT. Your Commodore dealer can supply your needs.
to
Specifications
Table 2 presents the specifications for the 8050, Table 3 the specifications for the 2040 and 3040, and Table 4 the 4040.
Figure 1 - Models
2040,
3040,
4040,
8050:
Rear View
5
STORAGE:
Total
capacity Sequential Relative
Directory Sectors Bytes
per Tracks Blocks
IC's:
Controller
6502 6530 6522
Interface
6502 6532 6564
entries
per
sector
(2) (2)
Table
2. Specifications: Model
track
8050
Dual Drive
533248 521208
bytes bytes
per per
464312to517398
depending
182880 65535 224
per
records
upon
bytes diskette
per
per
23to29
256
77 2083
microprocessor I/O,
RAM, ROM
I/O,
interval
microprocessor I/O,
RAM, interval
RO~v1
timers
Floppy
diskette diskette
bytes
file size.
file
file
timers
Disk
per
diskette
Shared
6114
(8)
PHYSICAL:
Material Dimensions
Height Width Depth
ELECTRICAL:
Power
MEDIA:
Diskettes
requirements Voltage Frequency
Power
4x1K
RAM
18
gao
steel
6.5/1
15.0/1
14.35/1
100,117,220, 50or60 50
Standard
single
Hertz
watts
mini 5
density
or
1/4",
240
VAC
single sided,
6
Table 3. Specifications: Models
STORAGE:
2040/3040
Dual Drive Floppy Disk
Total capacity Sequential
Random Directory entries Sectors Bytes
per
per
sector
Tracks
Blocks
IC's:
Controller
6504 6530 6522
Interface
6502 6532
(2)
6332
(2)
Shared
6114
(8)
PHYSICAL:
track
176640 170180 170850
152
17to21
bytes per diskette bytes per diskette bytes per diskette
per diskette
256
35 690
microprocessor
I/O, RAM, ROM
I/O, interval timers
microprocessor
I/O, RAM, interval timers
ROM
4xlK
RAM
Material
Dimensions
Height Width Depth
ELECTRICAL:
Power requirements
Voltage Frequency
Power
Power requirements
Voltage
Frequency
Power
MEDIA:
Diskettes
(2040)
(3040)
18
gao
steel
6.5"
15.0"
14.35"
120
VAC
60
Hertz
50 Watts
100,
220,or240 VAC
60
Hertz
50
Watts
Standard mini 5
single density
1/4",
single sided,
7
STORAGE:
Table4.Specifications: Model
4040
Dual Drive
Floppy
Disk
Total capacity Sequential Relative
Directory entries
6504 6530 6522
6502 6532 6332
6114
per
per
sector
(2) (2)
(8)
Sectors Bytes Tracks Blocks
IC's:
Controller
Interface
Shared
PHYSICAL:
track
174848
168656
167132 144
17to21
65535
per
bytes
per
bytes
per
bytes
per diskette
records
diskette
diskette diskette
per
file
256
35 683
microprocessor I/O,
RAM, ROM
I/O, interval timers
microprocessor I/O, RAM, interval timers ROM
4x1K RAM
18
gao
Material Dimensions
Height
Width
Depth
ELECTRICAL:
Power requirements (4040) USA (domestic)
Voltage Frequency
Power 50 Watts
Power requirements (4040) (international)
Voltage Frequency Power 50 Watts
MEDIA:
Diskettes Standard mini 5
15.0"
14.35"
120 60
100,220,or240 VAC 60
steel
6.5"
VAC
Hertz
Hertz
single density
1/4",
single sided,
8
CARE OF THE 2040, 3040, 4040 AND 8050
The disk drive should be placed on a flat surface free of vibration. Itisimportant that dust particles be kept at a minimum since a particle buildup will interfere with optimum opera-
If
tion. attempt
you should experience a hardware failure contact your Commodore dealer. Any
to
correct the problem yourself could result in voiding the warranty.
CARE OF THE DISKETTES
Handle diskettes with care. Follow these instructions to maintain the quality of the diskette and
to
protect the integrity of the data:
1. Return the diskette to its storage envelope whenever it
2.
Keep the diskettes away from magnetic fields. Exposuretoa magnetic field can distort the data.
3. Never leave a diskette on top of your computer or disk drive.
4. Do
5.
6. Do not touch or attempt to clean the diskette surface. Abrasions will cause loss of stored
7. Before applying power
not
write on the plastic jacket with a lead pencil or ball-point pen.
or fill out the label before attaching it Do
not expose diskettestoheat or sunlight.
data.
to
the 2040, 3040, or 4040 open the drive doors and remove
diskettes.
to
the jacket.
is
removed from the drive.
Use
a felt tip pen
UNPACKING THE DISK DRIVE
Before unpacking the disk drive, inspect the shipping carton for signs of external damage.
the cartonisdamaged, be especially careful when inspecting its contents. Carefully remove
all
packing material and the contents of the carton. until you have made sure you have located all the contents of the carton! The carton should contain:
DO
NOT discard any packing material
If
1. Commodore Dual Floppy Disk Drive
2. User Manual, Number 320899
3. One of the following TEST/DEMO diskettes: a. 2040/3040/4040 TEST/DEMO diskette, PIN 4040037 b. 8050 TEST/DEMO diskette, PIN 8050050
If
any items are missing, please contact your Commodore dealer immediately.
9
Chapter
2
PREPARING
YOUR
Before starting to use your disk drive, make sure itisin good working condition. This in-
to
cludes properly connecting it test, and finally the performance test using the appropriate TEST/DEMO diskette.
CONNECTING THE DISK DRIVE TO THE COMPUTER
One of two connector cables are requiredtointerface the floppytothe computer. These cables can be supplied by your Commodore dealer.
1.
PET-to-IEEE cable, PIN 320101 Use
this cable if the disk driveisto
computer.
2. IEEE-to-IEEE cable, Use
this cable if your disk driveisto pheral device such printer.
PIN
as
the Commodore Model 2022, or any other suitable interfaced
your computer,
be the only (or first) IEEE device connectedtoyour
905080
be connected ("daisy-chained") to another peri-
DISK
giving
it a power-on and initial checkout
TO
USE
DRIVE
NOTE: The disk drive should be the first peripheral attached vices are
Follow these steps STEP 1: Turn power OFF STEP 2: Place the disk drive in a convenient location
STEP
STEP 4: Connect the disk drive power cable to an
to
be "daisy-chained".
to
connect the disk drivetoyour computer:
to
the computer.
as
closeaspossibletothe computer.
DO
NOT connect the disk drivetoa power outlet at this time.
3:
Connect the PET-to-IEEE cable between the IEEE-488 interface connector on the
AC
If
outlet.
computer and the connector on the disk drive.
be
connected, the IEEE-to-IEEE cable(s) must be used.
this time.
to
the computer if other de-
additional IEEE devices are
DO
NOT turn on power at
to
11
Floppy
Disk
IEEE-la-IEEE
(PIN 905080)
Prinler
Figure 2 - Floppy Disk Hookup
PERFORMING THE POWER-ON TEST
You are now readytoproceed with the power-on part of the checkout:
Cable
STEP 1: Open both disk drive doors. Ensure that no diskettes are present in either drive. STEP 2: Turn power STEP 3: Apply power to the disk drive.
panel will flash twice. On the 8050, the two drive LEDs will two-color power/error LED will stay green indicating power ON. lights remain on, more than five seconds, turn the power OFF. any light remains lit, or
ONtothe COMPUTER and verify that itisworking properly.
All
three indicator lights (LEDS) on the front
go
out
and the center
If
the drive
all
lights flash continuously, or if the power/error LEDisred for
Wait
one minute and
all
lights flash continuously, contact your Commodore
try
dealer immediately.
If
NOTE:
the problem persists,
bus. This should assure that a problem related
try
disconnecting the other devices attachedtothe IEEE
to
another device does not affect the disk
drive.
12
again.
If
INSERTING THE DISKETTE INTO THE 8050
STEP 1: Insert the diskette into the slot designated "Drive0"and with the write protect
tab oriented
STEP 2: Once the diskette
tinct "clock". The diskette
3:
Press
STEP
STEP
4:
DOWN into the correct position. It motion
To remove the diskette, press release the spring and raise the diskette. ing, press
of
front
to
the left.
is
in the slot, push gently on the diskette until you hear a dis-
is
now properly positioned in the drive.
firmly on
to
avoid damaging the diskette.
UP
on the door. This will release the diskette and push it
the drive. The diskette is now free to be removed from the drive.
the
spring-loaded door of the drivetolower the diskette
is
importanttopress firmly on the door in a smooth
DOWN
firmly on the spring-loaded door. This will
When
the disketteislevel with the open-
out
toward the
STEP 5:
DO
NOT ATTEMPT TO CLOSE THE DOOR WITHOUT A DISKETTE IN PLACE. The doorislocked open by a mechanical interlock mechanism associated with the diskette ejector that prevents the door from closing if no diskette has been loaded.
I
I-
eI:
W
WRITE
PROTECT
NOTCH
WHEN COVERED, DISKETTE
CONTENTS
CANNOT
BE ALTERED
••
en
z
Figure 3 - Position for Diskette Insertion
INSERTING THE DISKETTE INTO THE 2040, 3040 AND 4040
CAUTION: NEVER APPLY POWER TO THE DISK DRIVE IF DISKETTES ARE PRESENT (LOCKED AND SEATED) IN EITHER DRIVE 0 OR DRIVE
STEP 1: Ensure that the powertothe disk driveisOFF and
STEP 2:
you complete this step. Open diskettes are present in either drive.
If
the preceding conditions have been met, you may apply powertothe disk
drive.
both
disk drive doors and make sure
DO
NOT apply power until
1.
that
no
13
STEP 3: Insert the diskette into the slot marked "Drive0"and with the write protect tab
oriented
to
the left. STEP 4: Once the diskette STEP 5: Press
STEP 6: To remove the diskette, insert your index finger under the lip of the spring-loaded
DOWN tinct "click". The diskette ing by the computer.
door and gently PULL. This will release the door and permit access ette. The diskette
isinthe slot, gently push on it until itisfully seated.
firmly on the spring-loaded door of the drive until you hear a dis-
is
now locked and seated in drive 0, ready for process-
to
the disk-
is
now freetobe removed from the drive.
THE 4040 AND 8050 PERFORMANCE TEST
When
you have successfully completed the Power-On test, proceed with the Performance
Test. Don't worry if you don't fully understand exactly what
to
this point, enter the commands just EXPECTED results are obtained during any step of the test, stop and start over again. The most likely cause of a problem until you become familiar with your disk unit.
All
commands are entered
press the RETURN key on your keyboard.
is
via
the keyboard and must be followed by a carriage return:
get a feel for what you can do with your disk.IfUN-
an improperly entered command. Thisisto
is
happening in this test. At
be expected
NOTE: Commands must be entered exactly shown in the example. example anyway. Re-enter your last command. If the light goes out, your correction was successful and you may continue.
NOTE FOR BUSINESS KEYBOARD USERS ONLY: You can set your computer for upper case character entry.
POKE 59468,12 and pressing the RETURN key.
Although itisnot absolutely necessarytogive In addition, the examples in this manual can be duplicated exactly when you use only
If
upper case. shift key when entering commands. (POKE 59468,14 will return the user
STEP 1: Insert the STEP 2: Type: LOAD
this stepisomitted the display will be in lower case letters.
from the diskette in drive 0 and display the following:
If
the error indicator lights, you may be abletocontinue the
Do
this by typing:
DEMO
diskette into drive 0aspreviously instructed.
"*",8
and press RETURN. The computer will load the first file
as
shown.
this command, it does permit easy entry.
DO
NOT insert any spaces unless
DO
to
lower case letters.)
NOT use the
14
STEP
3: Type: RUN and press RETURN. This
is
executed. (This program simplifies the direct mode commands.) A brief introductory descrption of Supportispresented in Chapter 3asit applies to Chapter 3 operations. A de­tailed description of
STEP
4: Insert a blank diskette into drive 1 and type:
>N1:DEMO,99 >C1=0
not necessary for the disk unittooperate; it just
DOS
Supportispresented in Chapter
will
cause the
DOS
Support Programtobe
7.
DOS
This procedure formats the diskette and copys all files from drive 0 thus creating a backup of the drive 0 and return it to its protective envelope. Remove the diskette from drive 1 and place it in drive
STEP
5: Type:
The screen will display:
<:,EAF'CHmCT LORD PERD'T'
I
~JCT
LOAD
FOF'
"PERFORMANCE TEST",8
F'EF'FOFr'1AtJCE
STEP
6: Type: RUN and press RETURN.
The program instructs you to place a blank diskette into each drive. The Per­formance Test Program executes a shortened version of the test used by Commo­dore in final inspection of the 4040 or 8050. The purpose of this test
is
that the unit to complete.
NOTE: Do not use diskettes containing any valuable information since the Per­formance Test Program program will label these diskettes "Test Disk ettes are ready for further use when the test program formance test has been satisfied.
functioning correctly and
DEMO
O.
Close the door to drive
E':,T
will
re-format them and any data
diskette. Remove the
to
DEMO
diskette from
O.
will
take approximately seven minutes
will
be lost. The test
1"
and "Test Disk 2". These disk-
is
completed and the per-
drive 1,
is
to ensure
STEP
7: Press RETURN, the following will display:
STEP
8: Enter the appropriate responsetothe question and press RETURN.
The computer disk drive and begin the performance test. The screen displays:
will
calculate the maximum number of tracks for the particular
15
The computer This procedure takes up to three minutes per disk. At the end of the operation
the screen displays:
The computer conducts the remainder of the Performance Test and displays:
~.JF.:
I
OPEt·~
OF'Et·~
~.J
F.:
ITI CLO::;E L·JP
ITI
CLO~:;E
OPEN
OF'Et·~
PEADItKi
~:;CRATCH
FILES
SCRATCH
FILE::; L·JF.:ITE L·JPITE
~.JF.:
I
TE
L·JPITE PEAD PEAD F.:EAD READ
TE
~.JP
I
TE
~4Ci
DATA
~'JF.:
I
~~Ci
DATA
L·JPITE PEAD READ
DATA FILE
~:;CF.:ATCHED
FILE
:::;CPATCHED
Tf;;:ACK
TPACK TF:ACK TF.:ACK
TF.:ACI< TF.:ACK TF.:ACI< TF.:ACK
TE
FILE FILE
will
FILE
FILE
TO
DATA
TO
DATA
FF:Ot'1
Ot·~
Ot·~
>::::<
::<::<
1
1
::<>::
ot·~
::<>::
Ot·~
1
Ot~
1
O~~
first format the diskette in drive 0 then the diskette in drive 1.
ot·~
Ot·~
0
TO
1
TO
ot·~
0
Ot·~
1 0
(1
1
1
1
Ot~
0
Ot·~
1
m~
0
O~~
1
0
1
(1
1
0 1
0
1
O!:::
0
OK
1
OK.
0
OK
0
OK
1
OK
1
OK
0
OK
1
OK
0
01.00
01.~X1
OK
0
OK
1
OK
0
OK
1
~:1
OK OK
1
(1
01<
OK
1
00.00
00.
(10
00.00 OCI.OO
00.00
00.00
O~].
00
0(1.00
~X1
0(1.
{:m.O(1
0(1.00
(H].
(H)
O~:1.
00
00.
~)O
O~).
~]O
00.
(10
00.00
16
UNIT
PULL TURNING
F.:ERD'T'
HAS
PASSED
DISKETTES
POWEP
FROM
OFF.
PEPFORMANCE
DF.:IVES
TEST!
BEFOF.:E
STEP
9: Remove the diskettes and return them to their protective jackets. The floppy has
passed the Performance Test.
STEP
10:
If
any problems have been encountered during this phase of the test, return to
If
Step 1 and repeat the entire procedure. a satisfactory conclusion to the Performance Test, contact your Commodore dealer.
problems persist and you do not reach
THE 2040 AND 3040 PERFORMANCE TEST
When
you have successfully completed the Power-On test, proceed with the Performance
don't
Test. Don't worry if you this point, enter the commands just EXPECTED results are obtained during any step of the test, stop and start over again. The
most likely cause of a problem until you become familiar with the procedure.
All
commands entered
RETURN key. NOTE: Enter the commands exactly
th&
example.Ifthe error indicator lights, you may be abletocontinue the example anyway. Re-enter your last command. may continue.
via
fully understand exactly whatishappening in this test. At
to
get a feel for what you can do with your disk.IfUN·
is
an improperly entered command. Thisisto
the keyboard mustbefollowed b a carriage return: press the
as
shown.
If
the light goes out, your c.orrection
DO
NOT insert any spaces unless shown in
was
be expected
successful and you
STEP 1: Insert the
diskette into drive 1. Close both drive doors.
STEP 2: Type: OPEN 1,8,15
This command opens logical file 1 on device 8. The secondary address of 15 opens the command channel READY.
NOTE FOR BUSINESS KEYBOARD USERS ONLY: To set the computer for upper case character entry type:
Although it cating with the disk drive, it does permit easy entry. In addition, the examples in this manual can be duplicated exactly. (POKE 59468,14 will return the user lower case letters.)
STEP 3: Type: PRINT#1,"IO"
This command initializes drive head of the drive sary each time the diskette displays your entry, then the word READY.
DEMO
POKE 59468,12 and press RETURN
diskette into drive 0aspreviously instructed. Insert a blank
is
not absolutely necessarytogive
in
to
the device. The screen displays your entry followed by
this command priortocommuni-
to
O.
The initialization procedure places the magnetic
the proper position above the diskette. This processisneces-
is
removed and inserted into the drive. The computer
STEP 4: Type: LOAD"*",8 and press RETURN.
The screen displays:
17
STEP 5: Type: RUN.
This causes the sary for the disk unit
brief introductory discussion
to
Chapter 3 operations. A detailed description of
STEP
6: Type: >D1=O
applies sented in Chapter 7.
This commands the disk drive
DOS
support programtobe executed. (This programisnot
to
operate, it just simplifies the direct mode commands.) A
of
DOS
Supportispresented in Chapter 3asit
DOS
to
make a backup copyofthe
DEMO
neces-
Supportispre-
diskette.
Remove the original envelope. Insert the backup disk into drive
STEP 7: Type: >10
This command initializes the backup diskette.
STEP 8: Type: LOAD"O:DIAGNOSTIC BOOT",8
This command loads the Diagnostic Boot program from the diskette in drive 0
into memory. The screen displays your entry and:
':,ERPCHItJC, LORIIItlCi PERII'T'
FOP
[1
DEMO
IiIRC,tJO':,TIC
disk from drive 0 and return ittoits protective
BOOT
Concurrent with the display, the drive 0 indicator lights and the drive 0 motor runs.
9: REMOVE THE
STEP
STEP.
STEP 10: Type: RUN and press RETURN
BACKUP
DISKE'ITE BEFORE PROCEEDING
O.
TO
THE NEXT
Follow the directions on the screen.
the test on the screen can be used tion, reset the disk drive by turning the computer's power switch OFF, then
STEP 11: Simultaneously press SHIFT and CLR/HOMEtoclear the screen.
command described earlier
STEP 12: RETURN THE BACKUP DISKE'ITE TO DRIVE 0 STEP 13: Type: >10
This command initializes the diskette in drive
18
is
passed.Ifall indicators remain lit in a steady pattern, the directions
to
find the problem area.
to
set the computer for upper case character entry.
If
all
three indicators flicker continuously,
Mter
O.
30 secondsofopera-
ON.
Use
the POKE
STEP 14: Type: /O:PET DISK
This loads the PET DISK program from the diskette in drive 0 into memory.
The screen displays your entry and:
':,EAF'CHUK,
LOAD
IHC,
F'EAD'T'
FOP(1F'ET
D
1':,[
STEP 15: Type: RUN
The PET DISK program
the drive 0 motor running intermittently
STEP 16: Press the RUN/STOP key.
Simultaneously press SHIFT and CLR/HOME. This completes the 2040 and
3040 performance test.
is
displayed until terminated. Note that you can hear
as
each program loads the next.
NOTES
19
Chapter
3
LEARNING
YOUR
Your
CBM
Floppy
and file handling capability and is controlled directly with:
• BASIC commands entered via
• BASIC statements within programs, and
• special disk commands.
In this chapter
organized in such a way
manner which permits BASIC commands which correspond
Before using
1.
operate
you
your
your
FLOPPY
Disk Drive adds and enhances
the
will learn howtoapply those commands and statements. This chapter
that
the
functions and format of disk commands are described in a
the
usertoperform disk-related tasks.
to
each disk maintenance command are also discussed.
floppy disk make sure you know how
Commodore Computer,
HOW
DISK
your
keyboard,
computing power with added storage
to:
TO
DRIVE
For
BASIC 4.0 users, those
USE
is
do
elementary programming in BASIC, and
2.
3. open and close files.
to
the
they
2040,
are used
the
that
per-
exact
the
NOTE: The BASIC statements described in this chapter apply specifically
3040,4040,
ferent format
the
with
of
usage
This chapter will first acquaint form disk maintenance and file manipulation and will understanding
the
ner, proceedtoadvanced disk programming techniques. Practice examples, and follow
more advanced disk programming techniques will dependtoa large degree upon how well the
fundamentals have been mastered.
and 8050. Certainofthe
or
produce different results from those described herein when computer or with these commands and statements in
of
those BASIC commands used for data handling. Approached in this man-
user will then have developed
other
the
the
step-by-step illustrationsoftheir usage. The understandingofthe
commands and statements may follow a slightly dif-
peripherals. Consult the appropriate manual for
user with those fundamental disk commands
the
other
applications.
then
progressively advance toward an
necessary confidence and programming skills
the
disk commands, read
to
21
To facilitate your understanding and mastery of Commodore BASIC, two computer terms are stressed in this Chapter: Block Availability Map (BAM) and Disk Operating System
as
(DOS). Although these are conventional terms, they will be briefly discussed to Commodore Floppy Disk Usage.
they relate
THE BLOCK AVAILABILITY MAP
The
BAMisa disk memory representation of available and allocated space on a disk. When
BAM
the system stores information on a disk, the DOS to determine what space cient spaceisavailabletostore a updatedtoaccount for the space allocated. However, if the DOS detects occupy more space than available, an error message will be generated.
Formatting a disk creates the tion. The
As
changes occur to the
these changes. Updates
is
performed on a new RELative or SEQuential data file. Since the 8050 has two blocks available for the updated, this block is written
interchange of information between the two disk, enables the system
BAMisstored on diskette in varying locations depending upon the drive used:
Model
2040,3040,4040
8050
to
BAM,
only one block of the
is
available and how many blocks can be allocated.Ifsuffi-
given
file, it will be stored on the disk and the
BAM
whichisthen loaded into DOS memory upon initializa-
BAM
BAMinDOS
the
BAM
to
to
maintain a record of free and allocated space on the disk.
memory, the
occur when a programissaved or a CLOSE or DCLOSE
the disk and the other block loaded into memory. This
will be automatically referenced by the
that
a file will
Location and Memory Required
Track 18, Sector 0
128
bytes
Track 38, Sector 0 and 1
2 Blocks
BAMondisk will be updatedtoreflect
BAM
is loaded into memory at a time. When
BAMs,
one in DOS memory and the other on
BAM
(BAM)
BAM
This description of the either the 2040 or 3040. Strict attention from the advantages of developing good programming techniques as well as better understanding of the relationship of one element of the system
The DOSisresponsible for managing information exchange between the disk controller and
the computer.
The DOS performs many functions which are transparent
the operation of the system. For example, the DOS monitors the input/output (I/O) of the
disk so that channels are properly assigned and
to
occur. In addition search the directory andtodelete and copy files.
is
There checkout in Chapter 2. Review the Performance Test procedure and observe the special sym­bols of cedures were fully explained
22
another function of DOS called
DOS
Support which were used to duplicate and initialize the disks before these pro-
monitoring of disk
can only stress the importance of initialization when using
to
this basic rule will enable the usertobenefit
to
develop a
to
another.
to
THE DISK OPERATING SYSTEM
to
the user but which are vital
that
no lengthy waits for an open channel
110,
the DOS also uses the channel structure
DOS
Support which was used during hardware
the
user. Because of its ease of use, DOS Support symbols
(DOS)
to
to
were easiertoimplement at cedures they replace. and simplify your knowledge
It
is now appropriatetobriefly discuss how DOS Support can enhance
that
point than attemptingtoexplain
of
operating your Commodore computer.
the
programming pro-
The first file on
Wedge
puter memory, permits
For example, disk commands which would normally be transmitted PRINT#1fn "commandstring" format may be transmitted via DOS SUPPORT by preceding
the command
cause DOS SUPPORT
with DOS Support special symbols can simplify learning about your Commodore computer
by providing a faster method instructions concerning
program, often referredtoas DOS SUPPORT. This program, when loaded into com-
the
TEST/DEMO diskette
the
usertoenter abbreviations for many disk commands.
with>
or@.Typing slash (I) followed by a program name and RETURN will
to
load
the
useofthese special symbols and their limitations.
that
comes with your disk driveisthe
to
the disk using the
that
program into memory. Replacing certain disk commands
to
communicate with the disk. Chapter 7 contains detailed
Universal
DISK MAINTENANCE COMMANDS
The following disk commands permit the user to perform file manipulation and disk maintenance.
4.0
COMMAND
Diskette Level
BASIC
COMMAND NEW INITIALIZE Prepare diskette for use LOAD"$O" VALIDATE Reconstruct Block Availability
Formats a disk
Read disk directory
Map
FUNCTION
(BAM)
BASIC
DIRECT
HEADER
DIRECTORY
COLLECT
DUPLICATE
COPY Copies files (optional
File Level RENAME Renames a file
SCRATCH Erases a file
NOTE: Diskette commands can be transmitted through that a file has been opened with OPEN ERROR appears upon typing the OPEN command, it means opened but had file.
the
abbreviated commands of
not
been properly closed. This error condition will automatically close the
To
recover, retype the OPEN command.
Duplicates a diskette
concatenation)
to
the
disk by PRINT# commands
DOS
support. The examples in this chapter assume
the
OPEN 15,8,15 command.Ifthe
BACKUP
COpy
CONCAT RENAME
SCRATCH
or
error message ?FILE
that
the
logical file was
23
NEW
Each time a disketteisplaced in oneofthe drives, both the diskette and the drive must be prepared for use. A previously unused diskette must first be formatted in the soft-sector format recognized by your particular disk drive. This may be accomplished by use NEW
disk command.
of
the
To use the command:
where 15 channel (primary address 8, secondary address 15).
The format of
Where dr=the drive number, 0 or 1
The
NEW user wishes ID, and track and sector numbers at the beginning of each block. The directory header and the
BAM
used on an already formatted diskette (with no ID specified)
reinitialize the ting without an ID
NEW
command, to format the diskette and initialize the disk drive, enter the
PRINT#15,"commandstring"
is
the logical file number of a file which has been openedtothe disk command
NEW
is:
"NEWdr:fn,xx"
or
"Ndr:fn,xx"
fn=the file name you wish to assign
characters long.
xx=a unique two-character, alphanumeric identifier supplied by the user.
command (with ID specified)isused on an unformatted diskette or one which the
to
reformat.
are created and the disketteismade readytoaccept data. The command may be
BAM,
NEW
creates the block headers, writing the sync characters, disk
deallocating all blocks on the diskette. The time involved in reformat-
is
much less than formatting with an ID.
to
the disk.Itmay be upto16
to
clear the disk directory and
Example 1: OPEN15,8,15
PRINT#15,"NO:TESTDISK,88"
These commands will open the command and error channeltothe disk drive and format a disk in drive 0, giving it a disk identifer of 88.
Here's an example of reformatting a diskette using the Example 2:
The diskette will be assigned the name "NEWNAME" and the directory and cleared. This procedure will work only if the diskette has been formatted.
NEW
The The latter will delete the program currently in memory and clear all variables before enter­ing a new program.
24
OPEN1,8,15 PRINT#l,
disk command SHOULD NOT be confused with the
"NO:
NEWN
AME"
NEW
command and no disk ID.
NEW
command in BASIC.
BAM
will be
HEADER (BASIC 4.0 Direct Command)
The HEADER command has the same effectasNEW computers using BASIC 4.0. Since formatting destroys all data previously stored, the
HEADER command has a built-in safety feature that queries the user: ARE positive response to this question permits formatting to take place while a negative response aborts the operation.
The format of HEADER command
HEADER
Where: fn=file name supplied by user but limited to 16 characters.
"fn"
,Ddr,Ixx
dr=drive number, 0 or 1 xx=a unique two character alphanumeric identifier (ID) supplied by user.
(same parameters
as
used by
is:
NEW
command)
command butisreserved for those
YOU
SURE? A
Initialization (2040 and 3040)
Whenever a disketteisinserted into either drive, for any reason, it ensure that the information on the the diskette currently in the drive. Failure inserted or reinserted into the drive will resultina DISKIDMISMATCH loss of data.
BAM
(in the disk memory)isthe proper information for
to
properly initialize a diskette each timeitis
MUST
be initialized to
ERROR and/or
Insert the diskette into drive 1 and initialize
OPEN 1,8,15 PRINT#l,"Il"
NOTE: FILE OPEN ERROR could occur if a previously opened file
is
second OPEN command. If the file
is
file. If this error
The diskette in drive 1 Remember destroy previously stored data.
The INITIALIZE command on the 2040 and 3040 aligns the read/write head with track 1 on the specified diskette. It then moves this information into the Disk Operating System (DOS) memory.
Since the 2040 and 3040 initialization function depends upon a change of change of diskette, inserting a diskette with an ID identical to a loss of data. This happens because the computer will reference the the previous diskette. Since the IDs are identical the of diskette. A SAVE or DSAVE command may now cause new data data already present on the disk because the area, instead of the current one. The results are unpredictable, and the diskette may become totally useless. For this reason, unique disk IDs must be used whenever possible for each
diskette.
that
displayed, retype the OPEN command and proceed.
is
now initialized.
formattingisusually a one-time operation and that re-formatting a disk will
still open, the second OPEN command would close the
as
follows:
was
addressed with a
Do
not confuse formatting and initialization.
to
track 18, reads the disk label and ID, and loads
ID
to detect a
to
one previously used may lead
BAM
left over from
DOS
assumes there has been no change
to
be written over good
DOS
will use the old map of available storage
25
Loading...
+ 67 hidden pages