SPIRAL CLS (16K ZX-81)
by Gary Nugent, Churchtown, Dublin, Eire
from Your Computer (December 1982), page 52

Spiral CLS was written for a 16K ZX-81. It clears a 22 by 32 screen. The
screen is first filled by a spiral of inverse spaces, and then by a spiral of
spaces. The screen is then ready for output, the Print position having been
reset to 0,0.

The routine is in machine code and is 91 bytes long. It should be entered
into a line 1 Rem statement using any of the hexadecimal loaders that have
been in previous issues of Your Computer. The code is not relocatable. Should
you wish to move it, all the Call addresses will have to be changed.

This is a novel way to clear the screen and is faster than the system CLS
when large amounts of memory and Scroll are in use.

Poking address 16599 with a value less than 192 increases the speed of the
spirals. A larger value decreases the speed. To make the routine clear a 24
by 32 screen, do as direct commands:

   POKE 16535,23    (21 for 22x32 screen)
   POKE 16575,9     (11 for 22x32 screen)

The routine is called by RAND USR 16514.