![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bgb.png)
Once
you've
mastered
the
basic
steps
however,
you
will
needtorefertothe
rest
of
this
manual
in
order
to
make
full
use
of
the
1541
*s
features.
In
fact,
before
you
begin,
you
should
takealookatthe
following
short
sections,
which
offer
precautions
on
handling
the
equipment:
"Simple
maintenance
tips,"
"Safety
rules
for
diskette
care,"
and
"Safety
rules
for
removing
diskettes."
1.
Unpack,
hook-up,
and
turnonthe
disk
drive.
There'snoshortcut
through
this
part.
You'll
havetoread
this
sectiontofind
out
what
connectstowhat,
whentoturn
everything
on,
and
howtoempty
the
drive.
If
you
run
into
any
problemsatthis
point,
refertothe
Troubleshooting
Guide.
Gently
insertapre-programmed
diskette.
For
the
purposeofdemonstration,
use
the
Test/Demo
diskette
that
was
included
with
the
disk
drive.
If
you
run
into
any
problemsatthis
point,
refertoChapter2,"Inserting
a
Diskette."
3.
Type:
LOAD
"HOW
TO
USE",8
(forBasic2)
DLOAD
"HOW
TO
USE"(for
Basic
3.5)
Press:
RETURN
HOW
TO
USE
is
the
name
ofaparticular
program
on
the
Text/Demo
diskette.
To
loadadifferent
BASIC
program,
substitute
the
name
of
that
program
inside
the
quotation
marks.
If
you
want
to
loadaprogram
that
isn't
written
in
BASIC
language,
you
must
use
the
Basic2command
and
add
the
following
after,the
8
in
that
command:
,1
If
you
run
into
any
problems
at
this
point,
refer
to
Chapter
2,
the
section
enti
tled
"LoadingaPackaged
Program."
4.
After
you
perform
step3,the
following
will
appearonthe
screen:
SEARCHING
FOR
HOW
TO
USE
LOADING
READY
At
this
point,
type
RUN
and
press
the
RETURN
key
and
follow
the
directions
for
the
program.
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bge.png)
EMPTY
THE
DRIVE
First,itis
very
important
tobesure
nothingisinside the
disk
drive.Ifyou
turn
the
power
off
or
oh
withadiskette
in
the
drive,
you
could
lose
its
contents
and
have
to
re-
record
it.
Since
you
wouldn't
like
havingtodo
that,
always
checktobe
sure
nothing
is
inside
the
drive
before
turningitofforon.
When
you
first
unpack
the
disk
drive,
you
will
findacardboard
shipping spacer
inside.
Following
the
instructions
below,
pullitoutasthoughitwereadiskette,
but
don't
throwitaway.
You
will
wanttoputitback
inside
the
slot
any
time
you
moveorship
the
disk
drive
later.
To
check
whether
the
driveisempty
(Fig.
1),
simply
rotate
the
leveronthe
front
of
the
disk
drive
counter-clockwise
untilitstops,
one-quarter
turnatmost.
Then
reach
inside
the
long
slot
the
lever
covers
whenitpoints
down,
and
pull
out
any
diskette
you
find
there.
CONNECTING
THE
CABLES
With
the
power
supply,
the
power
cable
plugs
into
the
backofthe
disk
driveatone
end,
and
intoagrounded
(3-prong)
outletatthe
other
end.It
will
onlygoin
one
way.
Before
you
plugitin
though,
make
sure
that
your
entire
computer
systemisturned
off.
The
disk
drive's
on/off
switchisin
the
back,onthe
right
side
(when
viewed
from
the
back).Itis
off
when
the
botton
halfispushed
inward.
Leave
your
whole
system
off
until
everything
is
connected.Wewill
tell
you
whenitis
safe
to turniton.
Fig
2.
Back
Panel
DIP
SWITCH
FOR
CHANGING
POWER
SWITCH
DEVICE
NUMBER
SERIAL
INTERFACE
POWER
ON/OFF
ON
1
SERIAL
PORT
OFF
0
POWER
CORD
SOCKET
CONNECTORS
FOR
INTERFACE
CABLES
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bgf.png)
After
plugging the
power
supply
into
the
disk
drive
andasuitable
outlet,
find
the
black
cable
that
goes
from
the
disk
drivetothe
computer.Itis
calledaserial
bus
cable
to
describe
the
way
the
computer,
and
other
accessories
communicate
with
each
other
through
its
wires.Ithasanidentical
6-pin
DIN
connectorateach
end,
which
like
the
power
connector
can
onlygoin
one
way—with
the
dimpleinthe
sideofthe
plug
facing
up.
To
pluginthe
serial
bus
cable,
find
the
dimpleonthe
sideofthe
metal
partofthe
plug
and
turn
that
side
up.
Then
pushitstraight
into
oneofthe
two
serial
bus
connectors
on
the
backofthe
disk
drive.
The
other
end
goes
into
the
similar
connectoronthe
back
of
your
computer,
marked
'*serial
bus."Ifanother
accessory,
suchasa
printer,isalready
connected
there,
unplug
the
other
device's
cable
from
the
computer,
and
attachitto
the
spare
serial
bus
connectoronthe
backofthe
1541.
Then
install
the
serial
cable
from
the
1541inthe
serial
bus
connectoronthe
backofthe
computer
(Fig
3.A.)
If
you
have
more
than
one
disk
drive,
each
added
disk
drive's
serial
bus
cable
is
plugged
into
the
second
serial
bus
connectoronthe
backofthe
previous
disk
drive,
like
a
daisy
chain
(Fig
3.B).
However,
don't
connect
the
other(s)
until
you've
learned
how
to
change
their
device
numbers,asno
two
disk
drives
can
have
the
same
device
number.
We'll
cover
waysofchanging
disk
device
numbersinAppendixA.Until
you
are
ready
to
read
that
section,
you
may
finditeasiertoleave
your
extra
drive(s)
unconnected.
TURNINGONTHE
POWER
With
everything
hooked
up,
and
the
disk
drive
empty,itis
timetoturnonthe
power.
You
can
turnonthe
powertothe
disk
and
other
devicesonthe
serial
bus
(connected
via
serial
cables)inany
order
you
like.
Justbesuretoeither
turnonthe
powertothe
computer
itself
last,orto.
use a
multiple
outlet
power
box
withamaster
switchtoturn
everything
off
andonat
once.
When
everything
is
on,
including
the
computer,
the
disk
drive
will
go
throughaself
check
forasecondorso, tobesureitis
working
correctly.
After
the
drive
is
satisfied
with
its
own
health,itwill
flash
the
green
light
once,
and
the
red
power-on
light
will
glow
continuously.Atthe
same
time,
the
computer
willbegoing
throughasimilar
self-test,
and
displaying
its
hello
messageonyourTVor
video
monitor.
Once
the
green
lightonthe
disk
drive
has
flashed
and
gone
out,itis
safetobegin
working
with
the
drive.
If
the
light
doesn'tgoout,
but
continuestoflash,
you
may
haveaproblem.
Refertothe
troubleshooting
guide
for
help.
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg13.png)
SIMPLE
MAINTENANCE
TIPS
Your
1541
should
serve
you
well
for
yearstocome,
but
there
areafew
things
you
candoto
avoid
costly
maintenance.
1.
Keep
the
drive
well-ventilated.
Likearefrigerator,
it
needsafew
inchesofair
circulation
on
all
sidestowork
properly.
2.
Use
only
good
quality
diskettes.
Badly-made
diskettes
could
cause
increased
wear
on
the
drive's
read/write
head.Ifa
particular
diskette
is
unusually
noisyinuse,itis
probably
causing
added
wear,
and
shouldbereplaced.
3.
Avoid
using
programs
that
"thump"
the
driveasthey
load.
Many
commercial
programs,
and
diskettes
that
are
failing,
cause
the
disk
drivetomakeabumping
or
chattering
noiseasit
attemptstoreadabad
sector.
If
the
diskette
canbecopiedtoa
fresh
diskette,
dosoimmediately.
Ifitis
protected
by
its
maker
against
copying,
the
thumping
is
intentional
and
will
havetobe
endured.Beaware,
however,
that
excessive
thumping,
especially
when
the
driveishot,
caused
some
older
1541'stogo
outofalignment
and
led
to
costly
repairs.
Current
1541's
have been
redesigned
to
prevent
the
problem.
Note:
the
"Memory-Write"
exampleinChapter8temporarily
turns
off
the
bumps.
4.Itwouldbea
good
ideatohave your
1541
checked
over
about
onceayearinnormal
use.
Several
items
are
likelytoneed
attention:
the
felt
load
padonthe
read/write
head
may
be
dirty
enoughtoneed
replacement,
the
head
itself
may
needabitofcleaning
(with
91%
isopropyl
alcoholona
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
needtobe
dustedtobe
sure
its
optical
sensor
hasaclear
view.
Since
mostofthese
chores
require
special
materialsorparts,itis
besttoleave
the
worktoan
authorized
Commodore
service
center.Ifyou
wishtodo
the
work
yourself,
ask
your
dealertoorder
the
1541
maintenance
guide
for
you
(part
number
990445),
butbeaware
that
home
repair
of
the
1541
will
void
your
warranty.
11
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg14.png)
CHAPTER
2
DISKETTES
WHAT
ISADISKETTE?
Beforeweactually
begin
using
the
drive,
let's
takeamomenttolookatthe
Test/Demo
diskette
packed
with
the
disk
drive.Todo
this,
graspitby
the
label,
which
shouldbesticking
outofthe
paper
jacket.
Then
pullitoutofthe
jacket
which
keepsitfree
of
dust
and
other
contaminants.
(Save
the
jacket;
the
diskette
should
alwaysbekeptinits
jacket
except
when
actually
in
useinthe
disk
drive.)Itis
often
calledafloppy
diskette,
becauseitis
flexible,
even
thoughitis
not
safetobend
diskettes.
A
diskette
is
much
likeacassette
tape,
butinthe
formofa
circle
and
enclosed
within
a
protective
square
plastic
cover.Asonacassette
tape,
onlyasmall
exposed
portion
of
the
magnetic
recording
surfaceissensitive.
You
may
touch
the
restofthe
diskette
any
time
you
like,
but
avoid
touching
the
few
small
portions
that
are
not
coveredbythe
protective
cover.
Also,
never
trytoremove
this
cover.
Unlike
the
paper
jacket,
the
plastic
diskette
coverisintendedtoremainonpermanently.
Next,
notice
the
notchonone
sideofthe
diskette
(it
maybecoveredbya
piece
of
tape).
This
notchiscalled
the
write
protect
notch.
Whenitis
covered
with
the
opaque
tape
packed
with
blank
diskettes,
the
disk
drive
cannot
change
the
contentsofthat
diskette.
Never
remove
the
tapeonthe
Test/Demo
diskette.
The
labelonthe
topofthe
diskette
says
"1541
Test/Demo"onit,
and
tells
you
which
diskette
you
are
using.
Blank
diskettes
come
with
extra
labelsinaddition
to
one
appliedbythe
makerofthe
diskette.
Use
themtodescribe
your
own
diskettes.
<*Atleast
two
other
partsofthe
diskette
are
worth
mentioning:
The
hub
and
the
access
slot.
The
holeinthe
centeriscalled
the
hub.Acone-shaped
spindle
fillsitwhen
the
drive
doorisclosed,
and
its
edges
are
clamped.
This
keeps
them
from
slipping,
when
the
diskette
spinsat300
RPMinuse.
The
oval
openinginthe
diskette
opposite
the
labeliscalled
the
access
slot.Itexposes
just
enoughofthe
diskette's
surface
for
the
read/write
head
and
load
pad
inside
the drive
to
touchaone
inch
long
line
from
the centertothe
edgeofthe
diskette's
working
surface.
The
bottom
sideofthat
slotiswhere
all
the
information
is
writtenasthe
diskette
spins.
It
is
one
place
your
fingers
should
never
touch.
ACCESS
SLOT
HUB
WRITE
PROTECT
NOTCH
WHEN
COVERED,
DISKETTE
CONTENTS
CANNOT
BE
ALTERED
LABEL
Fig.4.
Position
for
Diskette
Insertion
12
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg15.png)
SAFETY
RULES
FOR
DISKETTE
CARE
1.
Keep
the
disk
drive
and
its
diskettes
away
from
all
moisture,
dust,
smoke,
food,
and
magnets
(including
the
electromagnets
in
telephones
and
TV's).
Also
keep
them
away
from
temperatures
either
too
hotortoo cold
for
youtoworkinfor
extended
periods.
2.
When
notinthe
drive,
diskettes
shouldbestored
upright
inside
their
paper
jackets.
Do
not
allow
themtobecome
bentorfolded.
Since
the
working
partofthe
diskette
is
on
the
bottom,
never
setitdownona
table
top,orother
place
where
dustormoisture
might
affect
it,
andbeespecially
carefultokeep
your
fingers
away
from
the
openings
in
the
diskette
cover.
3.
Although
some
people
sell
kits
intendedto"double
your
diskette's
capacity"
by
cuttinganextra
write-protect
notch
intoadiskette,
itisbest
nottouse
the
other
side
of
the
diskette
on
the
1541
drive,
evenifyour
diskette
is
labeled
"double-sided."
Doing
so
will
cause
added
weartoyour
diskettes
and
drive,
and
may
cost
youanimportant
program
some
day.
4.
When
buying
diskettes,
you
may
use
any
good
quality
5lA
inch
diskette.
5.
Make
sure
the
diskette
center
holeismoreorless
centeredinits
opening
before
inserting
the
diskette
into
the
drive.
Although
the
hub
assembly
will
correctly
center
most
any
diskette,
it
wouldbevery
difficult
to
rescue
data
fromadiskette
recorded
with
its
hub
off-center.
One
waytohelp
center
diskettes
isto"tickle"
the
drive
door
shut
insteadofslammingitdown.Bygently
closing
it
part-way,
and
then
openingabit
and
then
closing
the
restofthe
way,
you
give
the
spindle
more
chancestocenter
the
diskette
properly.
Another
waytoease
diskette
centering
istobuy
diskettes
that
come
with
reinforced
hubs.
These
hard
plastic
rings
around
the
hub
opening
make
the
diskette
hub
more
rigid,
and
easiertocenter
properly.
INSERTINGADISKETTE
To
insertadisketteina
1541
(Fig.
1),
first
open
the
drive
doorbyrotating
the
door
lever
counter-clockwise
one
quarter
turn
untilitstops,
with
the
lever
level
with
the
slot
in
the
frontofthe
drive.
Grasp
the
diskettebythe
side
opposite
the
large
oval
access
slot,
and
holditwith
the
labelupand
the
write-protect
notchtothe
left.
Now
insert
the
diskettebypushing
it
straight
into
the
slot,
the
access
slot
goinginfirst
and
the
label
last.Besure
the
diskette
goesinuntilitstops
naturally,
withnopart
showing
outside
the
drive,
but
you
shouldn't
havetoforceorbenditto
getitthere.
With
the
disketteinposition,
seatitproperly
for
usebytwisting
the
door
lever
clockwise
one-quarter
turn,
vertically
over
the
slot
untilitstops.Ifit
does
not
move
easily,
stop!
You may
have
put
the
diskette
in
the
wrong
way,orincompletely.
If
that
happens,
reposition
the
diskette
until
the
door
lever
closes
easily.
13
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg17.png)
Lastisthe
relocate
flag.Itcan
have
oneoftwo
values,0and1.If
the
relocate
flag
is
0oromitted,
all
Commodore
computers
that
use
the
1541
automatically
relocate
the
programs
they
loadtoliveinthe
partofcomputer
memory
reserved
for
BASIC
programs.
If
the
relocate
flag
valueis1,
auto-relocation
is
turned
off,
and
the
programisloaded
into
the
exact
partofmemory
from
whichitwas
originally
saved.
This
feature
allows
machine-language
and
other
special
purpose
programstocome
into
the
computer
at
the
correct
location
for
themtooperate
properly.Atthis
pointinyour
learning,
the
only
thing
you
needtoknow
about
the
relocate
flagishowtouse
it.
Simply
include
the1at
the
endofthe
LOAD
commandifa
particular
program
doesn't
run
properly
when
loaded
the
usual
way.
After
you
typeinthe
command
and
press
the
RETURN
key,
the
fallowing
will
appearonthe
screen:
SEARCHING
FOR
"HOW
TO
USE"
LOADING
READY.
When
the
word
READY
and
the
flashing
cursor
reappearonthe
screen
and
the
green
light
goes
offonthe
drive,
the
program
named
"HOW
TO
USE"onthe
Test/Demo
diskette
has
been
loaded
into
the
computer.Touse
it,
just
type
the
word
RUN
and
press
the
RETURN
key.
The
same Load
command
will
also
allow
youtoload
other
prepackaged
programs
from
the
Test/Demoorother
diskettes.
Merely
substitute
the
exact
program
name
that
you
wanttouse
between
the
quotation
marksinthe
above
example,
and
that
willbethe
program
the
computer
will
load(alistofTest/Demo
programsisshowninChapter3,in
the
section
entitled
"WhataDirectory
Shows").
Note:
here
andinthe
remainderofthe
book,wewill
assume you
areingraphic
mode,
seeing
upper
case
letters
and
graphic
characters
when
you
type.
Thisisthe
normal
condition
of
all
Commodore
computers
coveredbythis
manual
when
they
are
first
turned
on.Ifyou
now
see
lower-case
letters
when
you
type
without
using
the
SHIFT
key,
you
are
in
text
mode
instead.
Press
the
COMMODORE
key
(Q:),atthe
lower
left
cornerofyour
keyboard,
together
with a
SHIFT
keytoswitchtographic
mode.
HOW
TO
PREPAREANEW
DISKETTE:
BASIC
2
A
diskette
needsapatternofmagnetic
groovesinorder
for
the
drive's
read/write
headtofind
thingsonit.
This
patternisnotonyour
diskettes
when
you
buy
them,
but
addingittoadisketteissimple
once
you
knowtodo
it.
Hereisthe
procedure:
FORMAT
FOR
THE
DISK
NEW
COMMAND
OPEN
15,device
#,15,"Ndrive
#:diskette
name,id"
CLOSE
15
This
Open
command
willbedescribed
more
fully in
Chapters
4
and5.For
now,
just
copyitas
is,
replacing
only
the
parts
giveninlower
case.
These
include:
the
device
15
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg18.png)
numberofthe
1541,
normally8;the
drive
number,
always0on
the
1541;
any
desired
name
for
the
diskette,
upto16
characters
in
length,
followedbya2character
diskette
ID
number.
The
Close
command
is
often
optional;
just
don't
Open
that
same
file
again
without
Closingitthe
first
time.
EXAMPLE:
OPEN
15,8,15,"N0:MY
FIRST
DISK,01":
CLOSE
15
Note:
the
chattering
or
thumping
noise
you
hear
just
after
the
disk
New
command
beginsisentirely
normal.
The
disk
mustbesureitisattrack1,whichitassures
by
stepping
outward45times
(ona35
track
diskette.)
The
noise
you
hearisthe
head
assembly
hitting
the
track1bumper
after
its
inevitable
arrival.
HOW
TO
PREPAREANEW
DISKETTE:
BASIC
3.5
A
diskette
needsapatternofmagnetic
groovesinorder
for
the
drive's
read/write
headtofind
thingsonit.
This
patternisnotonyour
diskettes
when
you
buy
them,
but
addingittoadiskette
is
simple
once
you
knowtodo
it.
Hereisthe
procedure:
FORMAT
FOR
THE
HEADER
COMMAND
HEADER'diskette
name''
,Iid,Ddrive
#
,Udevice
#
Where
"diskette
name"isany
desired
name
for
the
diskette,
upto16
characters
in
length;
"id"isa2character
disketteIDnumber;
"drive#"is
the
drive
number, 0
if
omitted
(asitmustbeon
the
1541);
and
"device#"is
the
disk's
device
number,
assumed
tobe8ifomitted.Asdescribedinthe
next
page,
"id"isoptionalif(and
only
if)
the
diskette
has
been
previously
formattedona
1541.
Also,
theIDmustbea
string
literal,
not
a
variableorexpression,
and
may
not
include
Basic
reserved
words.
Thus,
",IFI"
cannot
be
used
becauseIfisaBasic
keyword,
and
",I(A$)"isnot
allowed
becauseA$is
a
variable.
",IA$"isallowed,
but
theIDnumber
willbethe
letter
"A"
plusadollar
sign
($),
not
the
contents
of
the
variable
A$.Ifyou
needavariable
ID
number,
use
the
Basic
2
formofthe
format
command.
EXAMPLE:
HEADER
"MY
FIRST
DISK,I01,DO"
Note:
the
chattering
or
thumping
noise
you
hear
just
after
the
Header
command
beginsisentirely
normal.
The
disk
mustbesureitisattrack1,whichitassures
by
stepping
outward45times
(ona35
track
diskette).
The
noise
you
hearisthe
head
assembly
hitting
the track1bumper
after
its
inevitable
.arrival.
REUSINGANOLD
DISKETTE
After
you
have
once
formatted
a
particular
diskette,
you
can
re-format
itasthough
it
were
brand
newatany
time,
using
the
above
procedures.
However,
you
can
also
change
its
name
and
erase
its
programs
more
quickly
and
easilybyomitting
theIDnumber
in
16
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg1a.png)
CHAPTER
3
DIRECTORIES
WHAT
ISADIRECTORY?
Oneofthe
primary
advantages
of a
disk
driveisthatitcan,
with
nearly
equal
ease
and
speed,
access
any
partofa
diskette's
surface,
and
jump
quickly
from
one
spot
to
another.ADATASSETTE™,onthe
other
hand,
usually
readsacassette
file
from
the
beginningtothe
end,
without
skipping
around.Tosee
what'sona
cassette,
itisnecessary
to
lookatits
entire
length,
which
could
takeaslongasan
hour.Ona
disk
drive,byway
of
contrast,
itisa
quick
and
simple
mattertoviewalistofthe
programs
and
data
filesona
diskette.
This
listiscalled
the
directory.
VIEWING
THE
DIRECTORY:
BASIC
2
To
view
the
directory
in
Basic2,itisusually
necessary
to
load
it,
likeaprogram.
As
when
you
load
other
programs,
this
erases
anything
alreadyinBasic
memory,sobe
sure
to
save
any
work
you
don't
wanttolose
before
loading
the
directory
in
Basic2.(Chapter
4
describes
howtoSave
a program.)
For
example,toload
the
entire
directory
from
disk
device8,type:
LOAD'T',8
Then,todisplay*the
directoryonyour
screen
afteritloads
into
computer
memory,
type
LIST.
You
may
slow
the
listingbypressing
the
CONTROL
keyonthe
VIC20and
Commodore
64,
and
haltitentirelybypressing
the
STOP
key.
You
can
also
use
this
commandtolimit
the
directory
to
desired
filesbyusing
pattern-
matching
characters
described
laterinthis
chapter.
VIEWING
THE
DIRECTORY:
BASIC
3.5
To
view
the
directory
in
Basic
3.5,
simply
type
the
word
DIRECTORYona
blank
line,
and
press
the
RETURN
key.
Unlike
Basic
2's
methodofloadingadirectory,
this
does
not
erase
anything
alreadyinBasic
memory,soyou
can
safely
ask
foradirectory
at
almost
any
time,
even
from
within
another
program.
Again,
you
may
slowadirectory
listingonthe
Commodore16and
Plus/4byholding
down
the
COMMODORE
key(Ql),or
haltitentirely
by
pressing
the
STOP
key.
You
may
also
pauseitwith
CONTROL-S
(by
holding
down
the
CONTROL
key
while
pressing
the.
"S"
key),
and
resume by
pressing
any
other
key.
WHATADIRECTORY
SHOWS
Now
let's
lookatatypical
directoryonyour
1541
Test/Demo
Diskette.
18
![](/html/cf/cf89/cf8984fac902ceacf1d3da2f27be05bbe574027024ae2af4173fe6701982987a/bg1d.png)
PRINTINGADIRECTORY
To
makeapermanent
copyofa
directory,
perhapstofastentothe
diskette's
outer
(paper)
envelope,
you
will
needtosend
the
directory
toaprinter,
suchasCommodore's
MPS
801,
1520 and
1526
serial
bus
models.Todo
this,
you
may
needtorefertoyour
printer
manual,
but
briefly
the
procedure
for
listingadirectorytodevice4isasfollows:
LOAD44$0",8
OPEN
4,4:CMD
4:LIST
PRINT#4:CLOSE
4
Also
note
that
allofthe
statements
that
can be
combinedonone
line
already
have
been.
Type
theminimmediate
modetoavoid
disturbing
the
directory.
All
other
options,
suchasdiffering
device
numbers,
and
selective
directories
(see
next
section)
can
alsobespecified
as
usualinthe
Load
command.
WARNING:Besuretoinclude
the
PRINT#
command
after
every
printer
listing.
Otherwise,
the
printer
will
remainasan
unwanted
listener
on
the
serial
bus,
and
may
disrupt
other
work.
Also,donot
abbreviate
PRINT#as?#.
Although
it
will
look
proper
when
listed
out,itwill
causeaSYNTAX
ERRORinuse.
The
proper
abbreviation
for
PRINT#ispR.
READINGADIRECTORYASA
FILE
If
you
would
liketoreadadirectory
from
withinaprogram,
you
maydoso.InBasic
3.5,
simply
include
the
DIRECTORY
commandinyour
Basic
program.InBasic
2,
however,
and
optionally
in
the
others,
you
will
havetoOpen
the
directory
as
though
it
were"a
data
file
and
readitcharacter
by
character.
See
the
discussion
of
Get#inChapter
5
for
more
information.
ANOTHER
WAY
TO
BE
SELECTIVE
Before
discussing
the
pattern-matching
options
available
for
useinseveral
disk
commands,
let's
cover
one
more
thatisonly
usableina
directory.
Several
different
types
of
files
can
coexist
peacefully
on^the
same
diskette.Byaltering
our
directory
load
command,wecan
createadirectory
from
the
filesofa
single
selected
type.
Thus,
we
might
requestalistofall
sequential
data
files
(see
Chapter
5),
oneofall
the
relative
data
files
(see
Chapter
6),oroneofonly
program
files.Todo
this,
simply
addtothe
end
of
your
selective
directory
request
the
equals
sign
(=)
followedbythe
first
letterofthe
file
type
you
wantinyour
directory.
For
example,
the
Basic2command:
21