--- title: "Clock" type: "article" slug: "clock-3" url: "http://localhost/article/clock-3/" markdown_url: "http://localhost/article/clock-3.md" published_at: "2026-01-25T21:51:28+00:00" modified_at: "2026-06-21T23:35:58+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "This program is quite simply a clock, it might be useful in many ways. Example in a game where you need a timer, or just to know the time while programming. This clock works under interrupt, so you can use it at all time, even while programming! It's very simple to use, RANDOMIZE USR 65296…" category: - name: "Byte Power" slug: "byte-power" taxonomy: "category" url: "http://localhost/category/periodicals/byte-power/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" publication_r: id: 38570 title: "Byte Power 1st Class Magazine" type: "periodical" url: "http://localhost/periodical/byte-power-1st-class/" authors_r: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" issues_articles: - id: 38575 title: "Byte Power Dec 86/Jan 87" type: "issue" url: "http://localhost/issue/byte-power-5/" pubdate: "December 1986/January 1987" archive_link: true article_media: - id: 63237 title: "Clock" type: "computer_media" url: "http://localhost/computer_media/clock-4/" --- # Clock This program is quite simply a clock, it might be useful in many ways. Example in a game where you need a timer, or just to know the time while programming. This clock works under interrupt, so you can use it at all time, even while programming! It’s very simple to use, RANDOMIZE USR 65296 will start it, but the easiest way is to RANDOMIZE USR 64770 that will allow you to input the time using the keyboard (H-HOURS, M-MINUTES, S-SECONDS and ENTER when right time) and the clock will then be displayed at the upper right hand corner. The clock may be stopped by RANDOMIZE USR 65303. Here is a list of all that can be modified to suit your needs. - RANDOMIZE USR…65296 starts clock - 64770 inputs time & starts clock - 65303 stops clock USEFUL POKES…6 - 4887,201 NO DISPLAY - 64887,33 DISPLAY ON - 64894,x color of clock (ATTR) - 64858,60 TS2068 - 64858,50 ZX Spectrum USEFUL PEEKS… These can be POKEd so you may be able to change the time without USR 64770 (input). - 64972 Hours (0-23) - 64971 Minutes (0-59) - 64970 Seconds (0-59) WEIRD POKES… - 64888 Color address - 64902 Print position address These 2 POKES are used to position the clock on the screen, I didn’t use the ROM to print on screen because it is too slow, so the color and the character are printed separately. To re-position the clock use this small program as a guide: ``` 10 LET X=10 15 LET Y=10 (x=line, y=column) 20 PRINT AT X,Y; 30 LET A=PEEK 23684+256*PEEK 23685 40 POKE 64902,A-256*INT (A/256) 50 POKE 64903,INT (A/256) 60 LET A=X*32+Y+22528 70 POKE 64888,A-256*INT (A/256) 80 POKE 64889,INT (A/256) ``` Note that when there is no display (POKE 64887,201) the PEEKS of hours, minutes and seconds still work. ## Source Code: Clock ``` 10 REM INTERUPT CLOCK By Eric Boisvert ©1987 BYTE POWER 25 REM USR CALLS 30 REM 64770 ENTER TIME, Keys [H]our,[M]inutes,[S]econds and [ENTER] 40 REM 65303 STOP CLOCK 50 REM 65296 START CLOCK 60 REM USEFULL POKES 70 REM 64970,SECONDS 80 REM 64971,MINUTES 90 REM 64972,HOURS 100 REM 64887,201 NO DISPLAY 110 REM 64887,33 DISPLAY ON 120 REM 64894,COLOR OF CLOCK 130 REM 64858,60 T/S 2068 140 REM 64858,50 ZX SPECTRUM 150 REM SPECIAL POKES 160 REM 64888,COLOR POSITION 170 REM 64902,NUMBERS POSITION 175 IF PEEK 23681=0 THEN CLS : LIST 9999: STOP 180 STOP 9000 REM LOAD CODES 9010 LOAD "CLOCK Mc"CODE : IF PEEK 23681<>0 THEN RANDOMIZE USR 65296: CLS : LIST 9020 CLS : LIST 9999: STOP 9999 SAVE "CLOCK" LINE 9000: SAVE "CLOCK Mc"CODE 64770,536: VERIFY "": VERIFY ""CODE ```