Commodore PET User Manual page 420

Table of Contents

Advertisement

There is one potential problem with this routine. though it is doubtful vou
will ever encounter the problem. If the PET has been powered up for close to
twenty-four hours. or vou have set the internai clock close ta the twenty-fourth
hour. the routine might hang up during the wait loop. At 24:00:00 the jiffy clock is
reset from 5184000 jiffies to zero. If T is assigned within a few jiffies of 5184000
both TI and the jiffy clock will be reset to zero. The result is that the condition
TI-T
<
10 will always be true (0000008-5183998
<
10) and the wait loop will
hang up infinitely because TI-Twill never be greater than nine. It is very improba-
ble that this will ever happen to vou. but vou should use caution if the jiffy clock is
nearing the twenty-fourth hour.
Here is another way to advance the tape:
F'OKE 59411 .. 53
POKE 514.,13
~·JAIT
514.,16
POKE 55'411,61
:REM tSTART TAPE MOTORt
REM tZERO JIFFY CLOCKt
REM tWAITS 16 JIFFIESt
REM tSTOP TAPE MO TORt
POKE 514.0 pokes a zero into the low-order byte of the internai clock at
memory address 514. wiping out the current jiffy time and resetting the clock to
zero. The WAIT 514.16 inhibits further program action until the clock has incre-
mented 16 jiffies. Meanwhile. the tape advances until memory address location
514 contains 16 and the following POKE turns the cassette motor off.
There is one drawback with this wait loop. Every time the jiffy clock is reset
ta zero the PET loses track of time. Therefore. this routine should NOT be used if it
is important within the program that real time be kept or used in any way.
Here is yet another way to implement a wait loop du ring the data tape
advance:
POfΠ59411 .. 53
FOR 1=1 TO 60:NEXT 1
POKE 59411 .. 61
This method is simple but less accu rate than the previous two. Using a FOR
...NEXT loop. the program is stalled as the loop increments to the maximum value
of
1
before turning off the motor. However, the time it takes ta increment through a
FOR... NEXT loop cannot be measured as accurately as time measured in jiffies.
and thus the interrecord gaps cannot be precise. One advantage with this method
is that it does not alter or inhibit the use of the jiffy clock in any way.
407

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents