Saving Programs - Commodore 1541 User Manual

Hide thumbs Also See for 1541:
Table of Contents

Advertisement

HOUSEKEEPING HINTS
Hint
#I:
It is best to open file J
5
once at the very start of a
program,
and
only. close
i
the end of the program, after all other files have already tx:en
closed.
Do
~1s
bee
closing the command channel automatically closes all other disk files
.
By ?penmg
on
the start, the file is open whenever needed for disk commands else:-vhere .m the
pr~g
Closing it at the end makes sure all disk files are properly closed without
mterruptmg
other file commands
.
Note: the
"O:"
at the start of file
names is
a holdover from the days when all
Commodore disks had two drives in the same cabinet. Although the 1541 will
normally default
to drive 0 (not having a drive
I ,)
it
is
best to specify the drive
number
whenever saving or writing a file
.
This avoids potential confusion in DOS
(the
Disk Operating
System .)
Hint
#2:
If Basic halts with an error when you have files open, Bas~c aborts them
With
A
VING PROGRAMS: BASIC
3.5
closing them properly on the disk
.
To close them properly on the disk, you must
type
Before
you can save a program to
diskette,
the diskette must be formatted
,
as
OPEN 15,8,15:CLOSE 15
jescribed earlier. Saving to diskette is just like saving to cassette
,
except that the device
.
.
1
umber of
the
disk drive is not optional.
This opens the command channel and immediately closes 11,
al~ng
with all
o~er
files
.
Failure to close a disk file properly both in Basic and on the disk may result m
1
ORMAT FOR THE DSA VE COMMAND
the entire file!
HINT
#3:
One disk error message is not always an error.
Err~r
73
, "
C.BM
DOS
DSAVE
"file name
",
Ddrive # ,Udevice #
1541
"
will appear if you read the disk error channel before
send1.
n g any
~1sk
comma
when you turn on your computer. This is a handy way to check
w~ich
version of
£?OS
here
"file
name'
' is any string expression of up to 16 characters
,
optionally followed by
are
using.
However,
if this message appears
later,
after
oth~r
disk
comman~~t·
11\e
drive number
(the
"
D
" parameter,
always 0 on the 1541 ), and
the
device number of
there is a mismatch between the
DOS
used
to format your diskette and the
m
·he
disk drive
(the
" U"
parameter)
.
If omitted, the drive number defaults to
O,
and the
drive.
levice
number to
8.
.
.
However,
it will not work in copying programs that are not in the Basic text area
,
.
OPEN 15 8 15 "UJ
"
Then wait unlll the
dnve
ac
h
"DOS
5
1
..
fi
h C
.
. .
.
HINT
#4:
To reset
dnve, type:
, • '
.
.
luc
as
.
or t e
ommodore
64.
To copy
11
and s1m1Jar machme language
LED is off and motor goes off, then type: CLOSE
15.
This also apphes to
sendmg a
1
rograms, you will need the .S command of the machine language monitor built into the
or a
UI - .
:ommodore
16
and Plus/4
.
To access a built-in monitor, type
MONITOR.
To exit
a
nonitor,
type
X
alone on a line
.
SAVING
PROGRAMS: BASIC
2
Before you can save a program
to
diskette
,
the diskette must be
formatted
,ORMAT
FOR
A MONITOR SAVE
described earlier. Saving to diskette is just
like
saving to
cassette,
except that
the
dt
number of the disk drive is not optional.
S"drive #
:file name'
'
,device #, starting address.ending address+ J
FORMAT FOR THE SA VE COMMAND
ihere "drive#:" is the drive
number,
0 on the 1541
; "
file name" is any valid file name
~ ~o
14 characters
long (leaving
2
for the drive number and
colon);
"device#
"
is a two
~gu
device
number,
normally
08 on the 1541 (the
leading
0 is
required);
and the
SAVE "drive # :file name" ,device#
dresses
to
be
saved are given in Hexadecimal (base 16,) but without a leading dollar
.
d d
b
he
gn
($).
Note that the
ending address listed must be I location beyond the
last
location to
where
"
file name
" is
any string express10n of up to 16 characters
,
pre~e
e
Y t
0
saved.
number
(always
o
on the 1541) and a colon
,
and followed by the device
number
Xft.M
disk
,
normally 8.
.
.
xt
PLE:
However it will not work in copying programs that are not m the
Basic
te
·
d
·
·1
h"
e
Jan
h
"
DOS 5 l" for
the
Commodore
64.
To copy 11 an s1m1 ar mac m
sue
as
.
.
Jt•
P
rograms
you will need a machine
language
monitor program
.
.
.
h
ge
'
S"o
Do
for
this
purpose is identical
to
the monitor save described on t e next pa
:
S
5.
J
" ,08
,CCOO,
C FSA
Basic
3.5.
ffere
·
is the required
syntax to save a copy of
"
DOS
5. 1"
28
29

Advertisement

Table of Contents
loading

Table of Contents