Personal Computer News


Commodore 64 Jiffies In The Bag

 
Published in Personal Computer News #047

Commodore 64 Jiffies In The Bag

Recently a reader explained how Commodore 64 owners could obtain the time in Jiffies (1/60th) of a second.

However, no reference was made to the fact that the jiffy clock can be PEEKed. It is at locations 160, 161 and 162. This means the time can be altered by POKEing these locations and read by PEEKing them. The WAIT instruction can be used in conjunction with these locations to time delays, e.g. TI$="000000":WAIT 162,128

will wait for 128 jiffies (approx. 2 seconds)

TI$="000000":WAIT 161,2

will wait for 256*2 jiffies (approx. 8 seconds)

The clock can be switched off at any time with:

POKE 788,PEEK(788)+3

and switched on again with:

POKE 788,PEEK(788)-3

(Disabling the clock disables the RUN/STOP key)

David Gristwood
Sunderland, Tyne & Wear

David Gristwood