5 CLS:REM read date/time from RTC chip 10 c%=PEEK(&haf080f):y%=PEEK(&haf080a):REM Century / Year 20 m%=PEEK(&haf0809):d%=PEEK(&haf0806):REM Month / Day 30 h%=PEEK(&haf0804):n%=PEEK(&haf0802):REM Hour / miNute 40 s%=PEEK(&haf0800):f%=PEEK(&haf080d):REM Second 50 yr%=(INT(c%/16)*10+(c% AND 15))*100:REM decode BCD numbers 60 yr%=yr%+(INT(y%/16)*10+(y% AND 15) 70 mo%=(INT(m%/16)*10+(m% AND 15)) 80 dy%=(INT(d%/16)*10+(d% AND 15)) 90 ho%=(INT(h%/16)*10+(h% AND 15)) 100 mi%=(INT(n%/16)*10+(n% AND 15)) 110 se%=(INT(s%/16)*10+(s% AND 15)) 120 IF (f% AND 1)=1 THEN 140 130 PRINT "Battery Failing, date/time might be invalid!":GOTO 120 140 PRINT "Battery Status Ok!” 150 PRINT "time stamp:";yr%;"/";mo%;"/";dy%;" “; 160 PRINT ho%;”:";mi%;":";se% 170 PRINT "press y to change date/time” 180 GET k$: IF k$<>"y" THEN 340 190 INPUT "Enter Year”;y% 200 INPUT "Enter Month”;m% 210 INPUT "Enter Day”;d% 220 INPUT "Enter Hour”;h% 230 INPUT "Enter Minute”;n% 240 c%=INT(y%/1000)*16+(INT(y%/100)-INT(y%/1000)*10):REM BCD Century 250 y%=y%-INT(y%/1000)*1000:REM get decimal Year 260 yr%=INT(y%/10)*16+(y%-INT(y%/10)*10):REM BCD year 270 mo%=INT(m%/10)*16+(m%-INT(m%/10)*10):REM BCD month 280 dy%=INT(d%/10)*16+(d%-INT(d%/10)*10):REM BCD day 290 ho%=INT(h%/10)*16+(h%-INT(h%/10)*10):REM BCD hour 300 mi%=INT(n%/10)*16+(n%-INT(n%/10)*10):REM BCD minute 310 POKE &haf080f,c%:POKE &haf080a,yr%:POKE &haf0809,mo% 320 POKE &haf0806,dy%:POKE &haf0804,ho%:POKE &haf0802,mi% 330 GOTO 10340 END