A time-of-day clock for the TS2068, as lines 8400 to 8436 to add to your own program. GO TO 8400 asks for the hour, minute and second, clears the FRAMES counter at 23672-23674 and stores the starting time; after that GO TO tm works out the time from the frame count and prints it in 12-hour form (HR MIN SEC). The article warns that RUN, CLEAR and NEW wipe the clock’s variables, and shows how to make it update the time on the screen continuously.
By Dick Scoville, first published in the Triangle TS User Group Newsletter and reprinted with permission. Our transcription had the variable O1S typed with a zero, which the TS2068 cannot accept; it is corrected to the letter O as printed. Line 8420 was printed multiplying U instead of the frame count V by 4.2585, so the time shown did not keep step; the download has V.
Published in The Plotter April 1985 (Real Time Clock for Your TS2068).
Source Code
8400 REM *** TIME
8402 PRINT "INPUT": PRINT
8403 PRINT "HR MIN SEC"
8404 INPUT U: INPUT V: INPUT W
8405 FOR I = 23672 TO 23674
8406 POKE I, 0
8407 NEXT I
8408 LET TM = 8420
8410 LET O1S = 60*60*(U-1)+60*V+W
8420 LET V = PEEK 23672/256 + PEEK 23673 + 256 * PEEK 23674: LET U = V * 4.2585
8425 LET U = U + O1S + .5
8427 LET V = INT (U/3600)
8428 LET W = INT (U/60)-60*V
8429 LET U = INT (U-60*60*V)-60*W
8430 LET V = V+1: IF V > 12 THEN LET V = V-12
8431 CLS: PRINT "HR MIN SEC"
8435 PRINT V; TAB 4; W ; TAB 8; U;" "
8436 STOPNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.


