ZX81 Screen Clear

See all articles from CATS v6 n9/10
Author(s): John Thomas
Publication: CATS Newsletter
Pub Details: CATS v6 n9/10 (Volume 6, Issue 9-10)
Date: February/March 1989
Pages: 8

Here’s a nice touch for a program. It allows erasing “bottom lines” rather than all as in CLS.

Enter this demonstration program:

1 REM 1 2 3 4 5 6
10 PRINT"XXXXXX"
20 PRINT "XXXXXX"
30 PRINT "XXXXXX"
40 PRINT "XXXXXX"
50 PRINT "XXXXXX"
60 PRINT "XXXXXX"
70 PRINT "XXXXXX"
80 PRINT "XXXXXX"
90 POKE 16515,20
100 RAND USR 16514

Then enter these POKEs

POKE 16514, 6
POKE 16515, 22
POKE 16516, 205
POKE 16517, 44
POKE 16518, 10
POKE 16519, 201

(This will change the look of the LINE 1 REM)

The example above will leave the top 4 lines (1, 20, 30, and 40) and erases lines 50, 60, 70, and 80.

To use this routine in a program, add the REM line to a program and make USR calls to it when desired. In the program, before using the USR call, POKE 16514 minus the number of lines you want left from the top. May be used many times in a program to keep just the important lines on a screen in view.

The M/C is relocatable as long as the program POKE and call are changed to suit.

Reprinted from Sinc-Link

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.