Commodore PET User Manual page 419

Table of Contents

Advertisement

POKE 59411,53 pokes "53" into memory address location 59411 which con-
trois the cassette motor. Value 53 turns on the motor to advance the tape. Once
the motor is on, a wait loop lets the tape advance for a few jiffies. The wait loop
will be discussed shortly. To stop the tape, a POKE 59411,61 turns off the cassette
motor. The length of the wait loop may be varied or altered, but these two POKEs
are absolutely necessary to turn the cassette motor on and off.
Following is a sample wait loop inserted between the two POKE statements:
1000 POKE 59411.53
101E:1 T=Tl
1020 IF (TI-T><10 GOTO 1020
1030 POKE 59411.61
1040 G!T=0
1E:15E:1 F.:ETUF.:t·i
REM
~8TART
TAPE
MOTOR~
:REM
~WAIT
10
JIFFIE8~
REM
~8TOP
TAPE MOT OR'
Lines 1010 to 1020 make up the wait loop. Line 1010 sets variable T to the
current value of TI. TI is the number of jiffies since the PET was powered up or the
clock was zeroed. (A jiffy is 1/60 of a second.) TI is incremented once every jiffy,
or 60 times a second. By subtracting T from
TI.
the elapsed time is calculated. The
program must wait until ten jiffies (1/60 of a second) has elapsed before the pro-
gram can continue. While TI increments, until the difference between TI and T
equals ten jiffies the program is stalled, letting the cassette tape ad vance. This
blank space on the tape is the interrecord gap. Once (TI-T) equals ten, the next
statement tu rns off the cassette motor with a POKE 59411,61.
The routine calculates the space between each record. The tape is advanced
exactly the same amount between each physical record because the time be-
tween POKEing on and off the cassette motor will always be ten jiffies:
The length of the wait loop may be adjusted by changing the constant of the
condition expression:
TI-T
<
X
The larger the value of X, the larger the interrecord gap will be. If you're
unsure how long the interrecord gap should be, keep the wait loop between 5 and
30 jiffies. It is always better to have the interrecord gap too long than too short.
406

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents