Copying Programs; Validating The Diskette - Commodore 1541 User Manual

Hide thumbs Also See for 1541:
Table of Contents

Advertisement

NOTE:
Du~I
dri".'es mai:e
full~r
use of this
command,
copying programs from one
dis~c
to another in a
single
disk unit. To do that on the 1541, refer to Appendix E to
find
programs that you need.
COPYING
PROGRAMS: BASIC
3.5
.
The Copy command allows you to make a spare copy of any
program
or
file
ot
diskette. However, on a single drive
like
the 1541, the copy must be on the
same disk
which means it must be given a different name from the file copied. The source
file
other files on the diskette are not changed. Files must be clo ed before they are
copic
Although the 1541
supports
a Concatenate option, Basic 3.5 doesn't
have
a
spe~
command for it. The Basic 2
syntax
from the previous page may be
used
instead.
·
FORMAT FOR THE COPY COMMAND
COPY Ddrive #,"old file" to Ddrive #,"new file",Udevice #
where
"D"
is the drive number
(always
0
on the 1541,)
"
new
file" is the copy
,
"o
file" is the original, and
"U"
is the device number. If omitted, the drive number
defa~
to
0
and the device number
(unit)
to
8.
EXAMPLES:
After renaming a
file
named
"BOOT"
to
"TEMP"
in the last
section's
example,
1
can use the Copy command to make a
spare copy
of the program elsewhere
on
u
diskette, under the original name:
COPY
"TEMP"
TO
"BOOT"
To copy a file on a
second
disk drive, we would use:
COPY
"ORIGrNAL"
TO
"BACKUP'',U9
NOTE: Dual drives make fuller use
of
this command,
copying
programs from one
diske1
to another in a
single
disk unit. To do that on the 1541, refer to Appendix E to
find
rl
programs that you need
.
VALIDATING THE DISKETTE: BASIC 2
The Validate
command
recalculates the Block Availability Map
(BAM)
of
d
current
diskette,
allocating only
those
sectors still
being used by valid,
properly-clo
files and programs
.
All other
sectors (blocks)
are left unallocated and free for
re-use,
ar
all improperly-closed files are automatically Scratched. However, this bare descript
ion
its workings doesn't indicate
either
the power or the danger of the Validate
command. I
power is in restoring to good health many diskettes whose directories or block
availabili'
maps have become muddled
.
Any time the blocks used by the files
on
a diskette
plus
~
blocks
shown as
free don't add up to the 664 available on
a
fresh diskette
, Validate
needed, with one
exception
below
.
Similarly, any time a diskette
contains
an
improper!'
38
oscd
file
(splat file), indicated by an asterisk(*) next to its file type in the directory,
that
'~sk
tte needs to
be validated. In fact, but for the one exception below, it is a good idea to
di
·~te
diskettes
whenever you are the least bit concerned about their integrity.
\'all
The
exception is
diskettes
containing Direct Access files, as described in Chapter 7
.
1
direct
access (random) files do not allocate their
sectors
in a way the Validate
M:mand can recognize
.
Thus, using Validate on such a diskette may result in un-
c~ocating
all
direct.access
files,
wit~
loss of all their c?ntents
wh~n
other
files_
~e ad~ed
.
~
Jess
specifically instructed otherwise, never use Vahdate on a diskette containing direct
n
ess
files
.
(Note: these are
not
the
same
as the relative files described in Chapter
6.
~idate
may
be used on relative files without difficulty.)
FORMAT FOR THE VALIDATE COMMAND
PRINT#\5
, "VALIDATEO"
or
abbreviated as
PRINT#15
,"VU''
where "O" is the drive number
(always
0 on the 1541.) As usual, it is assumed file 15 has
been
opened to
the command channel on the 1541
.
EXAMPLE:
PRINT#l5,
"VO'
VALIDATING THE DISKETTE: BASIC 3.5
The
Collect command in Basic 3.5 is the
same
as the Validate command in Basic
2.
It
recalculates the Block Availability Map
(BAM)
of the
current
diskette
,
allocating
only
those sector
still
being used by
valid,
properly-closed files and programs
.
All other
sectors
(blocks) are left unallocated
and
free
for
re-use,
and
all improperly-closed files
are
automatically
Scratched
.
However, this bare description of its workings doesn't indicate
either
the
power or the danger of the Collect
command
.
Its power is in restoring to
good
health
many
diskettes whose directories or block
availability
maps have become muddled.
Any
time the
blocks used by the files
on a
diskette
plus
the blocks
shown as
free don
'
t
add
up to
the
664 available on a fresh diskette
,
Collect is needed
(with
one exception below
.)
Similarly, any time a diskette
contains an
improperly-closed file
(splat
file)
,
indicated by
an
asterisk (*) next to its file type in the directory
,
that diskette needs to be collected
.
In
fact,
but
for the
one exception
below, it is
a good idea
to
collect
diskettes
whenever you
are
the least
bit concerned
about
their integrity
.
Just note the number of blocks free
in
the
diskette's directory before
and after
using
Collect,
and if the totals
differ,
there was
indeed
a
problem, and the diskette should probably be
copied
onto
a
fresh diskette file by
file
,
Using
the
Copy
command
described in the previous
section
,
rather than using
a
backup
cornrnand or program.
M
The
exception
is
diskettes
containing
Direct Access
files,
as described
in
Chapter
7.
OSt
direct
access
(random)
files do not allocate their
sectors in a
way
Collect can
recognize
.
Thus
,
collecting such a
diskette may result in un-allocating
all direct access
39

Advertisement

Table of Contents
loading

Table of Contents