--- title: "ROM CLS and Scroll Demo" id: 77324 type: "computer_media" slug: "rom-cls-and-scroll-demo" url: "http://localhost/computer_media/rom-cls-and-scroll-demo/" markdown_url: "http://localhost/computer_media/rom-cls-and-scroll-demo.md" published_at: "2026-11-15T18:39:09+00:00" modified_at: "2026-11-15T18:39:09+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/rom-cls-and-scroll-demo-1.png" excerpt: "Calls the TS2068 ROM routines that clear and scroll part of the screen, from tiny machine-code stubs built in BASIC." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - 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: "Cameron Hayne" slug: "cameron-hayne" taxonomy: "indiv" url: "http://localhost/indiv/cameron-hayne/" genre: - name: "Machine Language" slug: "machine-language" taxonomy: "genre" url: "http://localhost/type/machine-language/" media_type: "Program" programmers: - name: "Cameron Hayne" slug: "cameron-hayne" taxonomy: "indiv" url: "http://localhost/indiv/cameron-hayne/" download_url: "https://archive.org/download/timex-sinclair-software-archive/ROM%20CLS%20and%20Scroll%20Demo%20%281986%29%28Hayne%2C%20Cameron%29%28TS2068%29%28UK%29%28Program%29.zip" tsrun_member: "ROM CLS and Scroll Demo (1986)(Hayne, Cameron)(TS2068)(UK)(Program)/ROM CLS and Scroll Demo (1986)(Hayne, Cameron)(TS2068)(UK)(Program).tap" mediadate: "1986" images: - url: "http://localhost/wp-content/uploads/2026/11/rom-cls-and-scroll-demo-1.png" - url: "http://localhost/wp-content/uploads/2026/11/rom-cls-and-scroll-demo-2.png" article_media: - id: 38260 title: "PLOT, CLS and SCROLL on the TS2068" type: "article" url: "http://localhost/article/plot-cls-and-scroll-on-the-ts2068/" media_type_tags: "Machine Language" license: false --- # ROM CLS and Scroll Demo A short demonstration of calling TS2068 ROM display routines from machine code. The program builds two tiny machine-code stubs at 60000 from DATA (a DEF FN pair splits each ROM address into bytes): one clears a given number of rows at the bottom of the screen through the ROM routine at 2431, the other scrolls them up one row through the routine at 2363. It fills the screen with numbered rows, writes in the lower screen, prints POOF! and wipes the bottom half, then keeps scrolling random numbers up the bottom of the screen. The article gives the matching Spectrum ROM addresses for each routine. Published in Sinc-Link January-February 1986 ([PLOT, CLS and SCROLL on the TS2068](https://timexsinclair.com/article/plot-cls-and-scroll-on-the-ts2068/)). ## Source Code ``` 1 GOTO 100 10 DEF FN H(x)= INT(x/256): DEF FN L(x)=X-256*FN H(x) 20 RESTORE 30 READ byte : IF byte <> PI THEN POKE address, byte : LET address = address + 1 : GOTO 30 40 RETURN 50 DATA 6, n, 205, FN L (romaddr), FN H (romaddr), 201, PI 100 LET address = 60000 : LET n = 12 110 LET clsbottom = address : LET romaddr = 2431 : GOSUB 20 120 LET scroll = address : LET romaddr = 2363 : LET n=n-1 : GOSUB 20 200 FOR r = 0 TO 21 : PRINT "row ";r: NEXT r 210 FOR r = 0 TO 1 : PRINT # 1; AT r, 0; "lower row ";r: NEXT r 220 PAUSE 200 230 PRINT AT 12, 10; "POOF !" : PAUSE 20: RANDOMIZE USR clsbottom 240 PRINT #1; AT 1, 0; RND 250 PAUSE 20 : IF USR scroll THEN GOTO 240 ```