Commodore CBM 2040, CBM 4040, CBM 3040, CBM 8050 User Manual

fRopei^Ty
OF
TEST
£(vu(^lv^fc^/-r
User's
Manual
for
5y4-lnGh
Dual
Floppy
Disk
Drives
CBlVr
ftopp*
modw*
—*•
•'"•"'dSk
QglVI
floPPV
^eonmodere
veonwnodoPB
CBIWI
•.:•.'•
•••..•:•.•.•:•
••••••.^.
,..
•.'
; ; ; ;
User's
Manua
for
CBM
Dual
Drive
Floppys
Model
2040-Model
4040
Model
3040-Model
8050
Appropriate
for
use
with:
Commodore
Computers
Series
2001 (CBM-PET)
Series
3000
(CBM)
Series
4000
(PET)
• Series
8000
(CBIVI)
Part
Number
320899
October
1980
commodore
©
1980
Commodore
Business
Machines,
Inc.
^ Table of Contents
Page
Chapter
1
Introduction
1
General
Information
2
Description
3
Front
Panel
3
Back
Panel
3
Interior
Configuration
4
The
Diskette
5
Specifications
5
Care Of
The
2040,3040,4040
and
8050
9
CareOfThe
Diskettes
9
Unpacking
The
Disk Drive 9
Chapter
2
PreparingToUse
Your
Disk Drive 11
Connecting
The
Disk DriveToThe
Computer
11
Performing
The
Power-On
Test
12
Inserting
The
Diskette
Into
The
8050
13
liisi!fliii|j
Till!
IJiiiktiUe
liilu
Tlie
HO-IO,
ijO-lO
uml
<10'1()..Iit
The
4040
and
8050
Performance
Test
14
The
2040
and
3040
Performance
Test
17
Chapter
3
Learning
HowToUse
Your
Floppy
Disk
Drive
21
The
Block Availability Map (BAM)
22
The
Disk Operating
System
(DOS) 22
Disk
Maintenance
Commands
23
NEW
24
HEADER (BASIC
4.0
Direct Command) 25
Initialization
(2040
and
3040)
25
Initialization
(4040)
26
Initialization
(8050)
26
The
Directory
26
LOAD$
26
DIRECTORY (BASIC
4.0
Dkect
Command) . 27
Printing
The
Dhrectory
27
in
IV
VALIDATE
28
'
COLLECT
(BASIC
4.0
Direct
Command)....
28
DUPLICATE
28
BACKUP (BASIC
4.0
Direct Command) 29
COPY
29
COPY (BASIC
4.0
Direct
Command)
31
CONCAT (BASIC
4.0
Direct Command) 31
RENAME
31
RENAME (BASIC
4.0
Direct
Command)
32
SCRATCH
32
SCRATCH (BASIC
4.0
Direct
Command)....
33
Chapter
4 BASIC
Commands
For
Data
Handling 35
BASIC
Commands
Associated
with
Floppy
Disk Drives
35
SAVE and DSAVE (Writing a Program to a
Diskette)...
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) 44
Moving a Tape ProgramtoDisk 45
Chapter5
Advanced
Disk
Programming
47
Commodore DiskOperating System (DOS) 47
Disk Utility Command Set 48
BLOCK-READ
[ *
49
BLOCK-WRITE
50
BLOCK-EXECUTE 50
BUFFER-POINTER 50 ^
BLOCK-ALLOCATE
51
~
MEMORY 51
MEMORY-WRITE 51
MEMORY-READ
52
MEMORY-EXECUTE
52
USER 52
8050
Disk Zones 59
Chapter
6
Advanced
File
Handling
65
Special Open and Close Statements For Direct Access' 65
Random
Access
Example
66
To
Create
A File
66
To
AddARecord
67
To
See A
Record
68
To
Change A
Record
68
Getting The Directory of Listings 69
VI
13
14 15
16
17
Directory
Format
0q
Sequential
Format
* ]]
Program
File
Format
61
Relative
File
Format
.!!!!!!...!!!!!!.
70
User's
Quick
Reference—Disk
Commands
87
Ending The Program 69
Relative Files
4040,8050
69
CreatingA RelativeFile 72
ExpandingA RelativeFile 72 Accessing
A RelativeFile 73
Chapter
7
Simplifying
The
UseofCommodore
Disk-Related
Commands
77
Loading
The
DOS
Support
Program
77
Using
The
DOS
Support Symbols:> and @ 78
Loading A
Program
With
The / 78
LoadingAnd Running A ProgramWithUp Arrow 79 SpecialDOSSupport Information 79
Chapter8 Error
Messages
—Pattern
Matching
File
Names
—DiskCommands 81
Requesting Error
Messages:
Commodore Disk Drives 81
Summary Of CBMFloppy Error Messages 82
Description of DOS Error Messages 82
Pattern
Matching
85
User's Quick Reference: Disk
Commands
86
Chapter 9 Random 1.00 Program Listing 89
Chapter
10
Index
95
Figure
1
2 3
4 5
Table
1 2 3
4 5 6
7
8
9
10
11
12
List
of
Illustrations
Title
Page
Models 2040,
3040,4040,8050:
Rear View 5
Floppy
Disk
Hookup
12
Position
For
Diskette
Insertion
13
2040,3040,4040 Format: Expanded
View
of A
Single
Sector 62
8050
Format:
Expanded View of A Single Sector 63
List
of
Tables
Title
Page
Suggested Reading List 4
Specifications: Model8050 DualDriveFloppy Disk 6
Specifications: Models 2040/3040 Dual Drive Floppy Disk 7
Specifications: Model4040 Dual DriveFloppy Disk 8
Standard Jump Table 53
Block
DistributionByTrack
I 54
2040,3040
BAM
Format 55
2040,3040 Directory
Header
55
4040
BAM
Format
56
4040
Directory Header 56
8050 Directory Header Block 57
8050
BAM
Format
58
Chapter
1
INTRODUCTION
The disk-oriented Commodore Computer System was designed around the central concept
of providingyou, the user, with largefile-handling capabilitiessupported by
BASIC
pro
gramming commandsand further simplified by DOSSupport command abbreviations.
Read the Tableof Contentsand becomeacquaintedwith the broad scopeof material
covered
in thismanual. It hasbeen
designedtoassist
you in
pursuing
an educational pro
grambyutilizing
the
computer
asan
adjunct
to the
learning
process.
That
is,
once
the
disk
driveis properlyinterfaced to a Commodore Computer,
YOU
become asimportant an ele
mentof the
system
asthe
hardware.
Your
importance,
however,ismeasured
in directrela
tionship to how
well
you understand how to effectively utilizethe hardware
arid
software.
That's why it is best to think of your computer and disk drive as only part of a system.
Grasping
andunderstanding the concept that each
individual
component actsand reactsto
signals
and
commands
from
other
devices
inthe
system
will
greatly
accelerate
your
funda
mental
grasp
of how to operate, control, and master the system.This basicconcept forms
the
basis
of this manual: teachingyou how to gainmastery of the system so that it
will
performasdesired.
Thatisthe
primary
reason
this
manualislaid
out in a
building
block
fashion: it permits you to advance as fast as
you
desire.
The first chapters discuss basichardwarefeatures and permit you, right from the start, to
become familiar with
the
disk drive by doing the performance tests which comprise the first
essential"hands
on"
experience. Then, by actually usingyour particular disk drive and
learning to carefullyfollow instructions,you can
gain
confidencein order to proceedto
more
comprehensive
subjects.
Bythe timeyou
begin
Chapter
3—Learning
HowTo
Use
Your Floppy DiskDrive-you
will
havealready used some portions of the DOSSupport system which isnot fully described
until Chapter 7. The reason for this procedure lies within the purpose of DOSSupport:
simplifying commands. It is actually easierto instruct a new user by
using
the simplified
command structure of DOS Support than attempting to explain the entire command hier
archy at an early stage.This concept of providingyou with enough essentialinformation to complete a task, a step-by-stepdescription of the task, and meaningfulexamples is a feature
of this manual which will provide
you
with sufficient incentivetoactually complete
the
task.
The
mannerinwhich
this
manualislaid
out
encourages
the
conceptoflearningbydoing.
Difficult
concepts
and
procedures have
been
broken
down
into
steps
that
walk
the
user
through
examples
which
provide
ample
opportunitytoexperiment
laterbyreturning
to
each
command
description. When possible,
the
command
format
has been included with
the
command description
and,
as an additional aid, a
User*s
Quick Reference has been placed in
Chapter8for
easy
access if
problems
persist.
Error
messages
are
also
presentedinChapter8where
they
canbequickly
referenced,
if
needed.
The
Error
Message discussions have
been
expandedtoinclude:
Howtorequest
error
messages.
Error
message
summary.
Detailed
error
message
descriptions.
For
those
users
who
have
been
reluctanttoattempt
disk programming becauseofthe
pre
sumed
degreeofdifficulty,
note
that
the
entire
disk
command
hierarchyisstructuredinthis
manual
from
least
difficulttomore
complex:
Commands
for
file
manipulation
and
maintenance
Commands
for
data
handling
• Advanced
programming
Advanced
hie
handling
Simplified
commands
Users who have attained some degree of programming skills
may
desiretobegin with
the
advanced subjects such as random access or relative files while others
maybecontent
with
just following the manual's format. In either case, this manual has been laid out to provide
the user with essentialinformation in a logicalsequence. Follow the examples,attempt the
step-by-step procedures,
and
learnbydoing.
GENERAL
INFORMATION
With
the
purchaseofyour
Commodore Dual Drive
Floppy
Disk
you
have greatly enhanced
the
computing power of
your
Commodore system.Toget
the
most
outofyour
system
you
should
study
your
computer's
user guide, and if necessary
the
BASIC manuals listed in
Table 1. You will benefit most if you first read through this entire manual, taking
note
of
those
features
that
relatetoyour
particular
floppy
as well as
those
which are
commontoall
CBM
Floppys.
The information presented in this manual is extensive and may, in some cases, present in formation that is currently beyond your particular levelof expertise. However, by carefully
and thoughtfully studying its contents you will gain the confidence necessary to progres
sively upgrade
your
programming skills and expertise.
This manual presents discussions, descriptions, practices and procedures relating
to
the
use
and
operationofall
Commodore
5-1/4-inch Dual
Floppy
Disk Drives.
Four
models
are
discussed:
Model
2040
(DOS
1)
Model
3040
(DOS
1)
Model
4040
(D0S2)
Model
8050
(DOS
2.5)
The
floppys
are
operationally
compatible
with
the
following
Commodore
Computers.
1.
Series
2001—16K
and
32K
—Operating With BASIC Version
3.0
2. Series
2001—PET8K—UpgradedtoBASIC Version
3.0
3. Series
3000—16K
and
32K
—Operating With BASIC Version
3.0
4. Series
4000
- PET
8K,
16K,
and
32K
- Operating With BASIC Version
4.0
5. Series
8000—32K
—Operating With BASIC Version
4.0
For
ease of reference,
the
Models
2040,
3040,4040,
and
8050
Dual Drive
Floppy
Disks will be referred to in this manual as
"the
2040",
"the
3040",
"the
4040",
and
"the
8050",
respectively. All descriptions
and
discussions are
common
unless
noted
otherwise.
DESCRIPTION
All CBM
Floppys
described in
this
manual
are
dual-drive
diskette
storage
devices.
Their
individual
primary
components
consistofread/write
controls,
drive
motor
electronics,
two
drive mechanisms,
two
read/write
heads,
and
track
positioning mechanisms. All
disk
drives
discussed in
this
manual
conformtoIEEE-488
interface
requirements.
Because
each
device
is an
"intelligent"
peripheral,
their
operation
requiresnospace in
the
computer's
memory.
This means
you
have
justasmuch
computer
memory
availabletoyouaswhen
youdonot
have
the
disks
attached.
Front
Panel
The front panel of the respective disk drive consists of an identification panel across the top;
slots in whichtoinsert two diskettes; and doors to close after inserting the diskettes. When
the door isclosed, the diskette is clamped onto the diskette spindlehub. Alsoon the front
panel are three LEDindicator lights.The one on the right iscalled the Drive0 Active Indi
cator, and lights when drive 0 is active. The LED on the left does the same for drive 1. On
the 8050, the LED in the middle is a two-color power/error indicator. It is normally green,
indicating power ON but flashes red whenevera disk error occurs. On the 2040, 3040, and
4040
the
middle
LED
is activated if
power
is appliedorremoved,
and
whenever an
error
occurs.
.
Back
Panel
The
backofeach
disk
drive
containsanIEEE-488
interface
connector.
Near
the
panel's
lower edge is
the
power ON/OFF switch. There is also a "slow blow"i^fuse,and
the
AC
power
cord.
Table1.Suggested
Reading
List
Pet/CBM
Personal
Computer
Guide.
C. S. Donahue and J. K. Enger, Osborne/McGraw-Hill, 630 Bancroft Way,
Berkeley,
CA
94710
Hands-On
Basic
withaPet.
H. D. Peckham, McGraw-Hill
1979
Entering
BASIC.
J. Sack and J. Meadows, Science Research Associates,
1973
BASIC: A
Computer
Programming Language.
C. Pegels,
Holden-Day,
Inc.,
1973
BASIC
Programming.
J. Kemeny and T. Kurtz, Peoples Computer Co., 1010 Doyle (P.O. Box
3100),
Menlo Park, CA
94025,1967
BASIC
FOR
HOME
COMPUTERS.
Albrecht, Finkleand
Brown,
PeoplesComputer Co., 1010 Doyle (P.O.Box
3100), Menlo Park, CA
94025,1973
A Guided
TourofComputer Programming in BASIC.
T. Dwyer,
Houghton
Mifflin Co.,
1973
Programing Time Shared
Computer
in BASIC.
Eugene H.
Bamett,
Wiley-Interscience, L/C 72-175789
Programming Language
#2.
Digital
Equipment
Corp., Maynard, MA
01754
101
BASIC
Computer
Games.
Software
Distribution
Center,
Digital
Equipment
Corp.,
Maynard,
MA
01754
WhatdoTo
After
You
Hit
Return.
Peoples
Computer
Co.,
1010
Doyle
(P.O.
Box
3100),
Menlo
Park,
CA
94025
Basic
BASIC.
James S. Coan,Hayden Book Co., Rochelle Park, NJ
WORKBOOKS
1-5.
T.I.S., P.O. Box
921,
Los Alamos, NM
87544
Programming
the
6502.
R. Zaks,
Sybex,
1978
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., 1978
Basic Programming
for
Business.
I. H.
Fotknei,
Prentice-Hall,
1977
The
Channel
Data
Book.
B. Lewis,5960 MandarinAve., Goleta, CA 93017,1978
PET and
the
IEEE
488
Bus (GPIP).
Osbome/McGraw-Hill, 630 Bancroft
Way,
Berkeley,CA 94710
Interior
Configuration
Theinterior of your floppy containstwo disk
drives.
All
the
logic
for the disk
drive
iscon
tained
within
the unit.The
mechanical
devices
are,forthe
most
part,
located
beneath
the
disk
spindles.
The
Diskette
The diskette (also known as a minifloppy, floppy diskette, minidiskette, etc.) is similar to
the
standard
flexible
disk.
There
are
several
reputable
manufacturersofthe51/4-inch
diskettes.
You
should
make
sure
that
you
buy
diskettes
for
SOFT
SECTORED
FORMAT.
Your Commodore dealer can supply your needs.
Specifications
Table 2 presents the specifications for the
8050,
Table 3
the
specifications for
the
2040
and
3040,
and
Table4the
4040.
PIGGYBACK CONNECTION
{IEEE
PLUG
)
Figure
1 —
Models
2040,
3040,
4040,
8050:
Rear
View
ON/OFF
SWITCH
Table2.Specifications:
Model
8050
Dual
Drive
Floppy
Disk
STORAGE:
Total
capacity
Sequential
Relative
Directory
entries
Sectors
per
track
Bytes
per
sector
Tracks
Blocks
533248
bytes
per
diskette
521208 bytes per diskette
464312 to 517398 bytes per diskette
depending
upon
file size.
182880 bytes per file
65535 records per file
224
per
diskette
23to29
256
77
2083
IC's:
Controller
6502 6530
6522
microprocessor
I/O,
RAM,
ROM
I/O,
interval
timers
Interface
6502
6532(2)
6564
(2)
microprocessor
I/O,
RAM,
interval
timers
ROM
Shared
6114
(8)
4xlK
RAM
PHYSICAL:
Material
18
ga.
steel
Dimensions
Height
Width
Depth
6.5"
15.0"
14.35"
ELECTRICAL:
Power requirements
Voltage
Frequency
Power
100,117,
220, or 240 VAC
50or60
Hertz
50
watts
MEDIA:
Diskettes
Standard
mini
5 1/4",
single
sided,
single
density
^ I
o;|
i
?
1
-1}
>'1'
i
Table3.Specifications:
Models
2040/3040
Dual
Drive
Floppy
Disk
STORAGE:
Total
capacity
Sequential
Random
Directory
entries
Sectors
per
track
Bytes
per
sector
Tracks
Blocks
176640
bytes per diskette
170180
bytes
per
diskette
170850
bytes
per
diskette
152
per
diskette
17to21
256
35
690
IC's:
Controller
6504
6530
6522
microprocessor
I/O,
RAM,
ROM
I/O,
interval
timers
Interface
6502
6532
(2)
6332(2)
microprocessor
I/O,
RAM,
interval
timers
ROM
Shared
6114
(8)
4xlK
RAM
PHYSICAL:
Material
18
ga.
steel
Dimensions
Height
Width
Depth
6.5"
15.0"
14.35"
ELECTRICAL:
Power
requirements
(2040)
Voltage
Frequency
Power
120
VAC
60
Hertz
50
Watts
Power
requirements
(3040)
Voltage
Frequency
Power
100,
220,or240
VAC
60
Hertz
50
Watts
MEDIA:
Diskettes
Standard mini 5
1/4",
singlesided,
single
density
8
CSsi.
Table4,Specifications:
Model
4040
Dual
Drive
Floppy
Disk
STORAGE:
Total
capacity
Sequential
Relative
Directory
entries
Sectors
per
track
Bytes
per
sector
Tracks Blocks
174848
bytes
per
diskette
168656
bytes
per
diskette
167132
bytes
per
diskette
65535
records
per
file
144
per
diskette
17to21
256
35
683
IC's:
Controller
6504
6530
6522
microprocessor
I/O,
RAM,
ROM
I/O,
interval
timers
Interface
6502
6532(2)
6332(2)
microprocessor
I/O,
RAM,
interval
timers
ROM
Shared
6114(8)
4xlK
RAM
PHYSICAL:
Material
Dimensions
Height
Width
Depth
18
ga.
steel
6.5"
15.0"
14.35"
ELECTRICAL:
Power
requirements
(4040)
USA
(domestic)
Voltage
120
VAC
Frequency 60 Hertz
Power 50 Watts
Power
requirements (4040)(international)
Voltage
100,
220,or240
VAC
Frequency 60 Hertz
Power 50 Watts
MEDIA:
Diskettes
Standard
mini
51/4",
single
sided,
single
density
CARE
OF
THE
2040,
3040,
4040
AND
8050
The
disk drive should be placedona fiat surface freeofvibration.Itis
important
that
dust
particles be
keptata minimum since a particle buildup will interfere with
optimum
opera
tion. If you should experience a hardware failure contact your Commodore dealer. Any
attempttocorrect
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
andtoprotect
the
integrityofthe
data:
1.
Return
the
diskettetoits
storage envelope whenever it is removed
from
the
drive.
2. Keep the diskettes away from magnetic fields. Exposure to a magnetic field can distort
the
data.
3. Never leave a diskette on
topofyour
computer or disk drive.
4. Do not write on the plasticjacket with a lead pencilor ball-pointpen.
Use
a felt tip pen
or fill
out
the
label before attaching it to
the
jacket.
5. Do
not
expose diskettes to
heat
or sunlight.
6. Do
not
touchorattempt
to clean
the
diskette surface. Abrasions will cause loss of stored
data.
7. Before applying power to the
2040,3040,
or 4040 open the drive doors and remove
diskettes.
UNPACKING
THE
DISK
DRIVE
Before unpacking
the
disk drive, inspect
the
shipping
carton
for signsofexternal damage. If
the
carton is damaged, be especially careful when inspecting its contents. Carefully remove
all packing material and
the
contents of the carton. DO NOT discard any packing material
until
you
have
made
sure
you
have
located
all
the
contentsofthe
carton!
The
carton
should
contain:
1.
Commodore
Dual
Floppy
Disk
Drive
2. User
Manual,
Number
320899
3.
Oneofthe
following TEST/DEMO diskettes:
a.
2040/3040/4040
TEST/DEMO diskette, P/N
4040037
b.
8050
TEST/DEMO diskette,
P/N
8050050
If
any
items are missing, please
contact
your
Commodore
dealer immediately.
NOTES
10
Chapter
^
PREPARING
TO
USE
YOUR
DISK
DRIVE
Before
startingto useyour disk
drive,
make
sureit isin
good
working
condition.Thisin
cludes
properly
connecting
it to yourcomputer,
giving
it a
power-on
and
initial
checkout
test,and
finally
the
performance
test
using
theappropriate
TEST/DEMO
diskette.
CONNECTING
THE DISK DRIVE TO
THE
COMPUTER
One
of twoconnector
cables
arerequired to interface the
floppy
to the computer.
These
cablescan be suppliedby your Commodoredealer.
1. PET-to-IEEE cable, P/N 320101
Usethis cable if the disk drive is to be the only (or first) IEEE deviceconnected to your
computer.
2. lEEE-to-IEEE cable, P/N 905080
Use
this
cable
ifyour disk
drive
isto be connected ("daisy-chained") to anotherperi
pheral
device
suchasthe
Commodore
Model
2022,orany
other
suitable
interfaced
printer.
NOTE:
Thedisk driveshould be the first peripheralattached to the computer if other de
vices
aretobe
"daisy-chained".
Follow these stepstoconnect
the
disk drivetoyour
computer:
STEP
1:
Turn
power
OFFtothe
computer.. f
STEP 2: Place
the
disk drive in a convenient location as close as possible to
the
computer.
DO
NOT
connect
the
disk
drivetoa
power
outletatthis
time.
STEP3: Connect the PET-to-IEEEcable between the IEEE-488 interface connector on the
computerand the connectoron the disk
drive.
If additionalIflEE
devices
areto
be connected, the lEEE-to-IEEE cable(s)must be used.
STEP 4: Connect the disk drive power cable to an AC outlet. DO NOT
turn
on power at
this
time.
11
CBM
Computer
iW
PET-to-IEEE
Cable
(P/N 320101)
Printer
Floppy
Disk
lEEE-to-IEEE
Cable
(P/N 905080)
Figure
2—
Floppy
Disk
Hookup
PERFORMING
THE
POWER-ON
TEST
You
are
now
readytoproceed
witli
the
poweron
partofthe
checkout:
STEa-1:
Open
both
disk
drive
doors.
Ensure
thatnodiskettes
are
presentineither
drive.
STEP
2:
power
ONtothe
COMPUTER
and
verify
thatitis
working
properly.
12
J
INSERTING
THE
DISKETTE
INTO
THE
8050
STEP
1:
Insert
the
diskette
into
the
slot
designated
"Drive0"and
with
the
write
protect
tab
oriented
to
the
left.
STEP 2: Once
the
diskette is in
the
slot, push gently on
the
diskette
until
you
hear a
dis*
tinct
"clock".
The diskette is now properly positioned in
the
drive.
STEP
3: Press DOWN firmly on
the
spring-loaded
doorofthe
drivetolower
the
diskette
into
the
correct
position. It is
importanttopress firmly on
the
door
in a
smooth
motiontoavoid damaging
the
diskette.
STEP
4:
To remove
the
diskette, press DOWN firmly on
the
spring-loaded
door.
This will
release
the
spring
and
raise
the
diskette.
Wlien
the
diskette
is level
with
the
open
ing, press UP on
the
door. This will release the diskette
and
push it
out
toward
the
frontofthe
drive.
The
disketteisnow
freetobe
removed
from
the
drive.
STEP
5:
DO
NOT
ATTEMPT
TO
CLOSE
THE
DOOR
WITHOUTADISKETTE
IN
PLACE.
The
doorislocked
openbya
mechanical
interlock
mechanism
associated
with
the
diskette
ejector
that
prevents
the
door
from
closing if no
diskette
has
been
loaded.
WRITE
PROTECT
NOTCH
WHEN
COVERED.
DISKETTE
CONTENTS
CANNOT
BE
ALTERED
3Hoaowwoo
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)INEITHER
DRIVE0OR
DRIVE
1.
STEP1:Ensure
that
the
powertothe
disk drive is
OFF
and
DO
NOT
apply
power
until
you
complete
this
step.
Open
both
disk
drive
doors
and
make
sure
that
no
diskettes
are
presentineither
drive.
STEP 2: If
the
preceding conditions have been
met,
you
may
apply power to
the
disk
drive.
»LTtedlo
°"
tab
STEP4:Once
the
disketteisin
the
slot,
gently
pushonit
untilitis
fully
seated
"
5H~~
THE
4040
AND
8050
PERFORMANCE
TEST
SX\'rrrriryl"dL'ruty
^deit^X
Performance
^
this
point,
enter
the
commaLsTu
f "haPPe»i"gtest.
At
EXPECTED
results
are
obtained
during
any
steoS'th^f
"
™-
most
likely
causeofa
problem
ran"„rnL!'^1 .
The
until
you
become
familiar
with
your
disk
unit.^
'
command.
Thisistobeexpected
press
the
RETURN
key
oVyoi^r
ke^^^
followed
byacarriage
return:
S^in
re^xirif
th7e"^»1nd1crr
H.S"™"
example
anyway.
Re^nter
younas^c^^^^^
Tf^
'he
successful
and
you
may
continue.
^
correction
was
NOTE
FOR
BUSINESS
KEYBOARD
USERS
ONLY-
Ym.
n»„
.f
upper
case
character
entry.Dothisbytyping:
"
POKE
59468,12
and
pressing
the
RETURN
key
STEP1;Insert
the
DEMO
diskette
into
drive0as
previously
instructed.
STEP2:^pe:
LOj^
"*",8
and
press
RETURN.
The
computer
will
load
the
first
file
^^ftom
the
disketteindrive0and
display
the
foUowing:
STEP3: Type: RUN and pressRETURN.This willcausethe
DOS
Support Program to be
executed. (This program is
not
necessary for the disk unit to operate; it just
simplifies the direct mode commands.) A brief introductory descrption of
DOS
Support ispresented in Chapter 3 as it appliesto Chapter 3 operations. A de
tailed description of DOS Support is presented in Chapter 7.
STEP
4:
Insertablank
diskette
into
drive1and
type;
>N1:DEM0,99
>C1=0
This procedure formats the diskette and copys all files from drive 0 to drive 1,
thus creating a backup of the
DEMO
diskette. Remove the
DEMO
diskette from
drive 0 and returnitto its protective envelope. Remove
the
diskette from drive 1
and place it in drive 0. Close
the
door
to drive 0.
STEP 5: Type: LOAD "PERFORMANCE TEST",8
The
screen
will
display:
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
4040or8050.
The
purpose of this test is to ensure
that
the
unit is functioning correctly and will take approximately seven minutes
to
complete.
NOTE: Do
not
use diskettes containing any valuable information since
the
Per formance Test Program will re-format them and any data will be lost. The test program will label these diskettes
"Test
Disk1"and
'Test
Disk
2".
These disk
ettes are ready for further use when
the
test program iscompleted and
the
per
formance
test
has
been
satisfied.
STEP 7: Press RETURN, the following will display:
STEP 8:
Enter
the
appropriate response to
the
question
and
press RETURN.
The
computer
will calculate
the
maximum number of tracks for
the
particular
disk drive
and
begin
the
performance
test.
The
screen displays:
NEW~ei
COMMFlNri
HEW-1
COMfiRHD
OK
Ci
OK 1
00.0
00.0
in drive 1.
the
screen
displays:
®
*^^1®
operation
both
IiRIVES
PfiSS
MECHRNICRL
TEST
The
computer
conducts
the
remainder
of
the
Performance
Test
and
displays;
OPEN
WRITE
FILE
ON
0
UPEN
WRITE
FILE
ON
1
writing
IiflTfl
TO
0
WRITINU
DHTfl
TO
1
CLOSE
WRITE
DRTfl
TO
1
OPpj
REflD
FILE
ON
0
OPEN
REflD
FILE
nw
1
reading
DRTfl
FROM
0
SCRATCH
FILE
ON
0
FILES
SCRATCHED
1
.5=^:RATCH
file
ON
1
files
SCRATCHED
1
WRITE
TRACKxxON
0
hdJJI
ON
1
WRITE
TRACK1ON
0
WRITE
TRACK1ON
1
RERIf
TRACKxxON
0
READ
TRACK
xx
ON
1
RERD
track
1
ON
0
READ
TRACK1ON
1
OK 0
00.
00
OK 1
00,00
OK.0
00,00
OK 0
00.
00
OK 1
00.00
OK 1
00.00
OK 0
00.
00
OK 1
00.
00
OK 0
00-
00
01.00
01,00
OK 0
00.00
OK 1
00.00
OK 0
00.
00
OK 1
00.
00
OK 0
00.00
OK 1
00.00
OK 0
00.
00
OK 1
00.00
UNIT
HAS
PflSSEIi
PERFORMANCE
TEST!
TUW^IN.i'^IJ^Po^F?'''
READV,
I
P™'-«ve
jackets.
The
floppy
has
STEP
10:
^L7/-tp:a?re
P"-
test,
return
to
a
.Msfactory
conclusion
to
the
Performanr^^:tXTct'y^^^^^^^^^^^^
THE
2040
AND
3040
PERFORMANCE
TEST
When
you
have
successfully
completed
the
Power-On
test,
proceed
with
the
Performance
Test.
Don't
worryifyou
don't
fully
understand
exactly
whatishappeninginthis
test.
At
this
point,
enter
the
commands
justtogetafeel
for
what
you
candowith
your
disk.IfUN
EXPECTED
results
are
obtained
during
any
stepofthe
test,
stop
and
start
over
again.
The
most
likely
cause
ofa
problem
isan
improperly
entered
command.
This
isto be
expected
until you become familiar with the procedure.
All
commands
entered
via
the
keyboard
mustbefollowedbacarriage
returni
Dress
the
RETURN
key.
NOTE:
Enter
the
commands
exactlyasshown.DONOT
insert
any
spaces
unless
shown
in
the
example.Ifthe
error
indicator
lights,
you
maybeabletocontinue
the
example
anyway.
Re-enter
your
last
command.Ifthe
light
goes
out,
your
correction
was
successful
and
you
may
continue.
STEP1:Insert
the
DEMO
diskette
into
drive
0 as
previously
instructed.
Insertablank
diskette into drive 1. Close both drive doors.
STEP 2: Type: OPEN1,8,15
This
command
opens
logical
file1on
device8.The
secondary
addressof15
opens
the
command
channeltothe
device.
The
screen
displays
your
entry
followed
by
READY.
NOTE
FOR
BUSINESS
KEYBOARD
USERS
ONLY:Toset
the
computer
for
upper case character entry type:
POKE59468,12 and press RETURN
Although it isnot absolutely
necessarytogive
this
command
priorto communi
cating
with
the
disk
drive,itdoes
permit
easy
entry. In addition, the
examples
in
this
manual
canbe
duplicated
exactly.
(POKE
59468,14
will
returnthe
user
to
lower case letters.)
STEP3: Type: PRINT#1,"I0"
This
command
initializes
drive0.The
initialization
procedure
places
the
magnetic
head
ofthe
drive
inthe
proper
position
above
the
diskette.
This
processisneces
sary
each
time
the
disketteisremoved
and
inserted
into
the
drive.
The
computer
displays
your
entry,
then
the
word READY.
STEP 4: Type: LOAD"*",8 and press RETURN.
The
screen
displays:
STEP
5:
Type:
RUN.
This causes
the
DOS
support
program to be executed. (This program is
not
neces
sary for
the
disk unit to operate, it just simplifies
the
direct mode commands.) A
brief
introductory
discussionofDOS
SupportispresentedinChapter
3 as it
appliestoChapter3operations.Adetailed
descriptionofDOS
Supportispre
sentedinChapter
7.
STEP
6:
Type:>D1=0
This
commands
the
disk
drivetomakeabackup
copyofthe
DEMO
diskette.
Remove
the
original
DEMO
disk
from
drive0and
returnitto
its
protective
envelope.
Insert
the
backup
disk
into
drive
0.
STEP
7:
Type:
>10
This
command
initializes
the
backup
diskette.
STEP 8: Type; LOAD"0:DIAGNOSTIC BOOT",8
This
command
loads
the
Diagnostic
Boot
program
from
the
diskette
in drive 0
into
memory.
The
screen displays
your
entry
and:
Concurrent
with
the
display,
the
drive 0
indicator
lights
and
the
drive 0
motor
runs.
STEP
9:
REMOVE
THE
BACKUP
DISKETTE
BEFORE
PROCEEDING
TO
THE
NEXT
STEP.
STEP
10:
Type:
RUN
and
press
RETURN
Follow the directions on the screen. If all three indicators flicker continuously,
the
test is passed. If all indicators remain lit in a steady
pattern,
the
directions
on the screen can be used to find
the
problem area. After 30 seconds of opera
tion, reset the disk drive by turning the computer's powerswitch OFF, then ON.
STEP
11:
Simultaneously press
SHIFT
and CLR/HOME to clear
the
screen. Use
the
POKE
command described earlier to set the computer for upper case character entry.
STEP
12:
RETURN
THE
BACKUP
DISKETTE
TO
DRIVE
0
STEP
13:
Type:
>10
This
command
initializes
the
disketteindrive
0.
STEP
14:
Type:/0:PET
DISK
This
loads
the
PET
DISK
program
from
the
diskette
in drive 0
into
memory.
The
screen displays
your
entry
and:
STEP
15:
Type:
RUN
The
PET
DISK
programisdisplayed
until
terminated.
Note
that
you
can
hear
the
drive0motor
running
intermittentlyaseach
program
loads
the
next.
STEP
16:
Press
the
RUN/STOP
key.
Simultaneously
press
SHIFT
and
CLR/HOME. This
completes
the
2040
and
3040
performance
test.
NOTES
Chapter
3
LEARNING
HOW
TO
USE
YOUR
FLOPPY
DISK
DRIVE
Your
CBM
Floppy
Disk
Drive
adds
and
enhances
your
computing
power
with
added
storage
andfilehandling capability and iscontrolled directly with:
• BASIC commands entered via
the
keyboard,
• BASIC
statements
within programs,
and
• special disk commands.
In
this
chapter
you
will
learn
howtoapply
those
commands
and
statements.
This
chapter
is
organizedinsuchaway
that
the
functions
and
formatofdisk
commands
are
describedina
manner
which
permits
the
usertoperform
disk-related
tasks.
For
BASIC
4.0
users,
those
BASIC
commands
which
correspondtoeach
disk
maintenance
command
are
also
discussed.
Before
using
your floppy disk makesure you know howto:
1. operate your Commodore Computer,
2. do elementary programmingin
BASIC,
and
%
3.
open
and close files.
NOTE:
The
BASIC
statements
described
inthis
chapter
apply
specifically
to the
2040,
3040,4040,
and
8050.
Certainofthe
commands
and
statements
may
followaslightly
dif
ferent
formatorproduce
different
results
from
those
described
herein
when
they
are
used
with
the
computerorwith
other
peripherals.
Consult
the
appropriate
manual
for
the
exact
usageofthese
commands
and
statements
inother
applications.
This
chapter
will
first
acquaint
the
user
with
those
fundamental
disk
commands
that
per
form
disk
maintenance
and
file
manipulation
and
will
then
progressively
advance
toward
an
understandingofthose
BASIC
commands
used
for
data
handling.
Approachedinthis
man
ner,
the
user
will
then
have
developed
the
necessary
confidence
and
programming
skills
to
proceedtoadvanced
disk
programming
techniques.
Practice
the
disk
commands,
read
the
examples,
and
follow
the
step-by-step
illustrationsoftheir
usage.
The
understandingofthe
more
advanced
disk
programming
techniques
will
depend
to a
large
degree
upon
how
well
the
fundamentals
have
been
mastered.
21
Tofacilitate your
understanding
and
masteryofCommodore
BASIC,
twocomputer
terms
are
stressed
inthis
Chapter:
Block
Availability
Map
(BAM)
and
Disk
Operating
System
(DOS).
Although
these
are
conventional
terms,
they
willbebriefly
discussedasthey
relate
to
Commodore
Floppy
Disk
Usage.
§ \
THE
BLOCK
AVAILABILITY
MAP
(BAM)||
The
BAM
isa
disk
memory
representation of
available
and
allocated
space
ona
disk.
When
the
system
stores
information
ona
disk,
the
BAM
willbeautomatically
referencedbythe
DOStodetermine
what
spaceisavailable
and
how
many
blocks
canbe
allocated.Ifsuffi
cient
spaceisavailabletostoreagiven
file,itwillbestored
onthe
disk
and
the
BAM
updatedtoaccount
for
the
space
allocated.
However,
ifthe
DOS
detects
thata
file
will
occupy
more
space
than
available,
anerror
message
willbegenerated.
Formattingadisk
creates
the
BAM
which
isthen
loaded
into
DOS
memory
upon
initializa
tion. The
BAM
isstored on diskette in varying locations dependingupon the driveused:
Model BAM Location
and
Memory Requured
2040,3040,4040 Track18, Sector0
128
bytes
8050
Track
38,
Sector 0
and
1
2
Blocks
As
changes
occur
to the
BAMinDOS
memory,
the
BAMondisk
will
beupdated to
reflect
these
changes.
Updates
to the
BAM
occur
whenaprogramissaved
ora
CLOSEorDCLOSE
is
performed
ona
new
RELativeorSEQuential
data
file.
Since
the
8050
hastwo
blocks
available
for the
BAM,
onlyone
block
of the
BAMisloaded
into
memory
at a
time.
When
updated, this
block
iswritten to the
disk
andthe other
block
loaded
into
memory.
This
interchange
ofinformation
between
the two
BAMs,
onein
DOS
memory
andthe otheron
disk,
enables
the
systemtomaintainarecordoffree
and
allocated
space
onthe
disk.
Thisdescription of the
BAM
can only stressthe importanceof initializationwhen
using
either
the
2040or3040.
Strict
attentiontothis basic rule will enable
the
usertobenefit
from the advantages of developmg good programming techniques as wellas to develop a better understandingof the relationship of one elementof the systemto another.
THE
DISK
OPERATING
SYSTEM
(DOS)
The
DOSisresponsible
for
managing
information
exchange
between
the
disk
controller
and
the
computer.
The
DOS
performs
many
functions
which
are
transparent
to the
user
but
which
are
vital
to
the
operation
ofthe
system.
For
example,
the
DOS
monitors
theinput/output
(I/O)
ofthe
disksothat
channels
areproperly
assigned
andthat no
lengthy
waits
foran open
channel
occur. In addition to monitoring of disk I/O, the DOSalso usesthe channel structure to
search
the
directory andtodelete and copy files.
There is another function of DOS called DOS Support which was used during
hardwue
checkoutinChapter2.Review
the
Performance
Test
procedure
and
observe
the
special
sym
bolsof
DOS
Support
which
were
used
to duplicate and initialize the
disks
beforethesepro
cedures
were
fully
explained
to the
user.
Because
ofits
easeofuse,
DOS
Support
symbols
-
22
were
easiertoimplement
at that pointthanattempting to
explain
the
programming
pro
cedures
they
replace.
It is
now
appropriatetobriefly
discuss
how
DOS
Support
can
enhance
and
simplify
your
knowledge
of operating your
Commodore
computer.
Thefirst
file
on the
TEST/DEMO
diskette that
comes
withyourdisk
drive
isthe
Universal
Wedge
program,
often
referred
to as
DOS
SUPPORT.
This
program,
when
loaded
into
com
puter memory, permitsthe userto enter abbreviations for manydisk commands.
For
example,
disk
commands
which
would
normallybetransmitted
to the
disk
using
the
PRINT#lfn
"commandstring"
format
maybetransmitted
via
DOS
SUPPORTbypreceding
the
command
with
> or
Typing
slash
(/)
followed
bya
program
name
and
RETURN
will
cause
DOS
SUPPORTtoload
that
program
into
memory.
Replacing
certain
disk
commands
with
DOS
Support
special
symbols
can
simplify
learning
about
your
Commodore
computer
by
providingafaster
methbdtocommunicate
virith
the
disk.
Chapter7contains
detailed
instructionsconcerningthe useof these special symbolsand their limitations.
DISK
MAINTENANCE
COMMANDS
The
following
disk
commands
permit
the
usertoperform
file
manipulation
and
disk
maintenance.
BASIC
COMMAND
NEW
INITIALIZE
LOAD"$0"
.
VALIDATE
FUNCTION
Formatsadisk
Prepare
diskette
for
use
Read
disk
directory
Reconstruct
Block Availability
Map
(BAM)
BASIC
4.0
DIRECT
COMMAND
HEADER
Diskette
Level
File
Level
DUPLICATE Duplicates a
diskette
COPY
RENAME
SCRATCH
Copies
files
(optional
concatenation)
Renamesafile
Erasesafile
DIRECTORY
COLLECT
BACKUP
COPY
CONCAT
RENAME
SCRATCH
NOTE:
Diskettecommands can be transmittedto the disk by PRINT#commands or
through
the
abbreviated
conmiandsofDOS
support. The
examples
in thischapter
assume
that a
file
has
been
opened
with
the
OPEN
15,8,15
command.
If the
error
message
?FILE
OPEN
ERROR
appears
upontyping the
OPEN
command,itmeans
that the
logical
file
was
opened but had not beenproperly
closed.
Thiserrorcondition
will
automatically
close
the
file. To recover, retype
the
OPEN command.
23
NEW
Each time a diskette is placed in one of the drives, both the diskette and the drive must be ^
prepared
for
use. A previously
unused
diskette
must
fkstbeformattedinthe
soft-sector
format recognized by your particular disk drive. This may be accomplished by use of the
NEW
disk
command.
To use the
NEW
command,to format the diskette and initializethe diskdrive,enter the
command:
PRINT#15,"commandstring"
where 15 is the logical file number of a file which has been opened to the disk command
channel (primary address 8, secondary address
15).
The
format
of
NEW
is:
"NEWdr:fn,xx"
or
"Ndr:fn,xx"
Where dr=the drive number, 0 or 1
fn=the filename you
wishtoassign
to the disk. It may be up to 16
characters
long.
xx=a unique two-character,alphanumericidentifier supplied by the user.
The NEWcommand (with ID specified) is used on an unformatted diskette or one which the
user
wishes
to reformat.
NEW
creates
the
block
headers,
writing
the
sync
characters,
disk
ID,and track and sector numbers at the
beginning
of eachblock.The directory header
and
the
BAM
arecreated and the diskette is
made
readyto acceptdata.The
command
maybe
used
on an
ahready
formatted diskette (with no IDspecified) to clearthe diskdirectory
and
reinitialize the
BAM,
deallocating all blockson the diskette.The time
involved
in refo?^\t-
ting without an ID ismuch less
than
formatting with an ID.
Example 1: OPEN15,8,15
PRINT#15,"NO:TESTDISK,88"
TTiese
commands will open the command and error channel to the disk drive and format a
disk in drive 0, givingita disk identiferof88.
Kerens
an example of reformatting a diskette using the NEWcommand and no disk ID.
Example 2:
0PEN1,8,15
PRINT#1,"N0:NEWNAME"
The diskette willbe
assigned
the name
"NEWNAME"
and the directory and
BAM
willbe
cleared. This procedure will work
onlyifthe
diskette has been formatted.
The
NEW disk command SHOULD NOT be confused with
the
NEWcommand in BASIC.
The latter willdelete the program currently in memory and clear all variables before enter-
mganew
program.
24
Loading...
+ 74 hidden pages