User`s guide

HOUSEKEEPING
HINTS
Hint
#1:
It
is
best to open
file
IS
once at the very start
of
a program, and only close
it
a1
the end
of
the program, after all other files have already been closed. Do this beca
use
closing the command channel automatically closes all other disk files .
By
opening once
a1
the start, the file
is
open whenever needed for disk commands elsewhere
in
the progr
am
Closing
it
at the end makes sure all disk files
are
properly closed without interrupting
ani
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 I
S4
I will
normally default to drive
0 (not having a drive 1,)
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, Basic aborts them withou1 SAVING
PROGRAMS:
BASIC 3.5
closing them properly on the disk. To close them properly on the disk, you must type:
OPEN IS,8,lS:CLOSE
IS
This opens the command channel and immediately closes it, along with all other d
isk
Before you can save a program to diskette, the diskette must
be
formatted,
as
described earlier. Saving to diskette
is
just like saving to cassette, except that the device
number
of
the disk drive
is
not optional.
files. Failure to close a disk
file
properly both
in
Basic and
on
the disk may result
in
los
ing
FORMAT FOR THE DSA VE COMMAND
the entire
file!
HINT
#3:
One disk error message
is
not always
an
error. Error 73,
"CBM
DOS
2.6
IS41"
will appear if you read the disk error channel before sending any disk commands
when you turn on your computer. This
is
a handy way to check which version
of
DOS y
ou
are
using. However,
if
this message appears later, after other disk commands,
it
me
an
s
there
is
a mismatch between the DOS used to format your diskette and the DOS
in
y
ow
drive.
HINT
#4:
To reset drive, type: OPEN IS,8,IS,
"UJ"
Then wait until the drive activ
it)
LED
is
off and motor goes off, then type: CLOSE
IS
. This also applies to sending a
UI
+
or a
Ul
-
SAVING
PROGRAMS:
BASIC 2
Before you can save a program
to
diskette, the diskette must be formatted ,
35
described earlier. Saving to diskette
is
just like saving to cassette, except that the dev
ice
number
of
the disk drive
is
not optional.
FORMAT
FOR THE SA VE COMMAND
SAVE
"drive
# :file name" ,
device#
where
"file
name"
is
any string expression
of
up
to
16
characters, preceded by the d
rive
number (always 0 on the l
S4
l) and a colon, and followed by the device number
of
th
1
disk, normally 8.
However,
it
will not work
in
copying programs that are not
in
the Basic text ar
ea
such as
"DOS
S.
I"
for the Commodore 64. To copy
it
and similar machine langu
ag
e
programs
,
you
will
need
a
machine
language
monitor
program
. Its u
for
thi~
purpo~e
is
identical
to
the monitor save described on the next page
un
de
Ba~ic
3.S.
28
DSAVE "file name" ,Ddrive # ,Udevice #
where
"file
name"
is
any string expression of up to
16
characters, optionally followed
by
the
drive number (the
"D"
parameter, always 0 on the IS41), and the device number
o(
the
disk drive (the
"U"
parameter).
If
omitted, the drive number defaults to 0, and the
device number to 8.
However,
it
will not work
in
copying programs that are not
in
the Basic text area,
such
as
"DOS
S.
l"
for the Commodore 64. To copy
it
and similar machine language
programs, you will need the
.S command
of
the machine language monitor built into the
Commodore
16
and Plus/4 . To access a built-
in
monitor, type MONITOR. To exitยท a
monitor, type X alone on a line.
FORMAT FOR A MONITOR SA VE
S"drive
#:file name",device # ,starting address,ending address+ I
where
"drive#
:"
is
the drive number, 0 on the IS41; "file name"
is
any valid
file
name
up
to
14
characters long (leaving 2 for the drive number and colon);
"device#"
is
a two
digit device number, normally
08
on
the
IS41
(the leading 0
is
required); and the
addresses to be saved are given
in
Hexadecimal (base 16,) but without a leading dollar
sign
($). Note that the ending address listed must be I location beyond the last location
to
be
saved.
EXAMPLE:
Here
is
the required syntax
to
save a copy
of
"DOS
S.
l"
S"O:DOS S. l ",08,CCOO, C FSA
29