Compute Gazette - Commodore Computers
Compute Gazette - Commodore Computers
Compute Gazette - Commodore Computers
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
PEEKing Time<br />
PEEKing Time<br />
I own a <strong>Commodore</strong> 64, and I am just starting to<br />
learn machine language. I have a question about<br />
the time (TJ$) (TI$) function. What location in memory<br />
do you look at to get the current value for the<br />
T1 TI$ $ function?<br />
Corey McKinnon<br />
BASIC's time variables ([1$ alld TI) ra/llm tile CIITrelit<br />
vallie of a blli/t·ill illterval timer.; PRINT TI re<br />
BASIC'S time variables (71$ and TI) return the cur<br />
rent value of a built-in interval timer: PRINT TI re<br />
fil turns ms a /IIul1cric numeric vallie value s/lOw;II8 showing the currellt current lilller timer<br />
cOIlII1 count ill in jllcrcmcllts increments called jiffies, where olle one jiffy is<br />
1/60secoud. second. Thus, to display the COlltellts contents of tile the<br />
timer as seconds, you would fYl'C ti/pe PRl PRINT ~T TI/60.<br />
71/60.<br />
PRINT TIS 775 refllnls returns til thee vallie value of Tl TI tralls/aled<br />
translated<br />
;1110 into a strillg string of characters represelltillg representing the lime time ill in<br />
hOllrs, hours, miml/es, minutes, (llId and seconds.<br />
The illtcl1Ja/ interval tilller timer is [alllICI found at memory loealioll5<br />
tions 160-162 (hex addresses $AO-$A2) SA0-SA2) ill in botll both tile the<br />
loca<br />
VIC and 64. Location 160 licks once every 1092 sec<br />
ollds onds (65536 jiffies), locatioll location 161 ticks every 4.26<br />
seconds secollds (256 jiffies), alld and 162 ticks every jiffy (sixty<br />
times a second). BASIC determilles determines tile the vallie value of TI Tl<br />
by performing the equivalent of:<br />
VIC alld 64. Locatioll 160 licks alice every 1092 sec<br />
by performillg the eqllivalent of:<br />
TI - I'EEK( 160) ° 65536 + PEEK( 161 )0 256 + l'EEK(162)<br />
It th ell determilles the val lie of TIS fro m the vallie<br />
It then determines the value of TI$ from the value<br />
of TI, 71, so there are 110 no locatious locations which actually hold<br />
the CIIrrellt current vallie value of TIS. Thai That is, there Ihere are 110 no locatiolls<br />
tions ill in thee compllter computer holding Iioldillg the lim timee ill in hOllrsmil/lltes-secminutes-seconds<br />
l/ds format. fomw You YOI/ call can read the clock from frolll macl/il/e machine lal/gllage<br />
language<br />
hours-<br />
simply by examillillg examining tile the cOl/tel/ts contents of locations<br />
160-162. 162. You can call also use lise the bllilt-ill built-in Kernal Ken/al ROM<br />
rOl/lilles routines RDTIM (SFFDE) to read the clock or<br />
SETTIM (SFFDB) to set it. See the e VIC or 64 Programmer's<br />
Reference Guide for more details. However,<br />
in il/ either case, you will have to do some<br />
manipulating mal/ipllialillg if you want Wa/lt the e time tillle in ill seconds in illstead<br />
of jiffies.<br />
You YOII should be aware that thai the /Ire clock stops run rllI!-<br />
ning 1Iillg during dllrillg tape SAVEs and LOADs. WADs. If you set the<br />
clock and then eu perform one of these tape operations, operatiolls,<br />
the time value will be incorrect.<br />
th e time vall/e will be incorrect.<br />
Disk Drive Device Number<br />
Disk Drive Device Number<br />
Change<br />
I have two 1541 disk drives and want to change<br />
the address of one of them via the hardware<br />
method. I followed owed the instructions in the<br />
owner's manual, but can't tell which wires are<br />
the jumpers in question. Please help.<br />
Nolan L. Green<br />
The Tile instruction ;1Istmctioll manual's manllal's reference to jumpers might<br />
be misleading. misieadillg. The Tile "jumpers" are actually two<br />
round rOlllld disks of solder, each about 1/4 inch illell in ill diameter.<br />
Each Eacll disk is separated into ill to halves, with witll a thin tlli"<br />
strand stralld of solder sohler connecting cO llllectillg each half. llalf.<br />
12 COMPUTE'S COMPUTE!", Gazorro GOtOl/1I September Scplembor 19fM 1984<br />
U"plug tile power cord frolll til e wall and ope"<br />
Unplug the power cord from the wall and open<br />
tile the disk drive following llowillg tile the illstructions instructions in tile the<br />
user's IIlmlllal. manual. 0" On tile the older (white case) model<br />
1541s, til thee jllmpers jumpers are fo found 0on 1/ fil thee left edge of til thee<br />
eire/lit circuit board, jllsf just behind tile the fOllg long plugs wii11 with wires.<br />
01/ On th thee n(.'wer newer (tall (tan case) model 1541s, 1s, th they are arc fOl found llld<br />
IIear near fhe the cellter center of ti,e the circuit board, toward ti,e the<br />
frolli front. . 0On11 both models, jumper 1 is "earest nearest the front.<br />
0" On tile the "ewer newer models, tlley they ca" can be found ulld i" in the middle<br />
toward<br />
ti,e the front. fro"t.<br />
0" the older 1541, tile ju.mpers are all the left edge, to<br />
ti,e rca r.<br />
On the older 1541, the jumpers are on the left edge, to<br />
the rear.<br />
Challging the dev ice 1llimbers is accomplished by<br />
Changing the device numbers is accomplished by<br />
taking a sharp, pointed pail/ted object and scratching scratelling away<br />
the e thin til strand of solder connecting comlec/illg the tile two halves<br />
on one or both of the jumpers. Do this til is very care<br />
re·<br />
fully flilly so as not II0t to damage the til e circuit it board or any allY<br />
other of /l er components.<br />
cO II/pol/ellts.