Chapter 3: DEVELOPING A PROGRAM, Interactive Programming
ln the old ROMs. the system location
that
enables the cursor ta blink
is
loca-
tion 548.
Ta
enable the cursor. you
would
use the statement:
80
POKE
548.0 Enable cursor (old
ROMs)
instead of
80
POKE
167.0
Chapter 4:
RN
0
Enable cursor (new
ROMs)
RND(O)
is
non-functional. An argument of zero returns a value that
is
con-
stant. or nearly constant. and that may vary from
PET
ta
PET.
You
will
have ta use
-TI
ta generate random seeds. This
is
the method used
in ail of the examples in Chapter 5 under "Generating Random Numbers."
Chapter 5: FILES
This section
is
for
PET
users who are having problems reading data files
using the old ROMs. If your
PET
has the old
ROMs
and you intend ta use data files
frequently. you should seriously consider replacing the old
ROMs
with
the new.
as
the new ROMs ensure greater reliability when reading and
writing
data files.
If you do plan to use the old
ROMs.
you must do a little extra programming
ta get around these problems. Wh
en
writing
data
to
the data tape. the old
ROMs
neglect ta initialize the pointer ta the start address of the cassette tape buffer. and
also fail ta leave enough blank space
on
the tape between physical records. Con-
sequently. when the
PET
attempts to read the data back from the data tape. the
problems may result in lost or garbled data. Here
are
a few precautions you can
take to overcome these obstacles.
1. Initialize the pointer of the cassette buffer start address. Because
the old ROMs fail
ta
initialize the start address ta the cassette tape buffer before a
file
is
OPENed. you must
be
sure
ta
do sa before opening a file
with
a series
of
POKEs:
cassette
*1:
POKE
243.122:POKE 244.2:0PEN
1,1.1
cassette
*2:
POKE
243,58
:POKE
244,3:0PEN
2.2.1
Memory address locations 243 and 244 point ta the start address of the cur-
rent tape buffer.
By
POKEing in the above values the pointer
will
be
initialized pro-
perly.
2. Force interrecord
gaps.
The old
ROMs
do not leave enough blank
space
on
the tape between physical records. When the
PET
attempts ta read back
the data
with
an
INPUT*
or
GET*.
if the physical records
are
tao close together
the data cannot
be
read. resulting in read errors and lost data,
Ta
prevent this. you
can force larger interrecord gaps ta
be
written
between records by calling a
routine to advance the tape each time the cassette buffer
is
emptied.
404