Two short relocatable machine-code routines from Ray Elder’s ZX81 column, for the giant-REM routine library. Program A (22 bytes, suggested address 16514) extends the line 1 REM: type a line 2 REM followed by as many dots as you need and call it, and line 2 is joined onto line 1. Program B (21 bytes, suggested address 16550) turns every character on the screen into its inverse, skipping the end-of-line markers.
Each comes with its hex in LET X$ and Program C, a loader to add at line 20. As printed Program C does not work: it reads A$ while the hex is in X$ (report 2/40), and it would also step through the string two characters at a time with A$(2 TO ) where A$(3 TO ) is needed. So the downloads already hold the bytes in a line 1 REM of 100 dots, as the article suggests: PROGA.p (RAND USR 16514), PROGB.p (RAND USR 16550) and INVERSE.p, the article’s 50-times loop around Program B.
From Ray Elder’s ZX81 column in ZX Computing Monthly (UK), reprinted in Sinc-Link.
Published in Sinc-Link January-February 1987 (ZX Programming).
Source Code
PROGRAM A:
2 REM PROGRAM A,ADDRESS 16514
3 REM LENGTH 22 BYTES
10 LET X$="2A7F40118340195E235
62B19117F40AFED52227F40C9"
20 REM ADD PROGRAM C HERE....
30
40
50
PROGRAM B:
2 REM PROGRAM B,ADDRESS 16550
3 REM LENGTOH 21 BYTES
10 LET X$="01D6022A0C40237EFE7
628FAC680770B78B120F2C9"
20 REM ADD PROGRAM C HERE....
30
40
50
Loop for PROGRAM B:
10 FOR I=1 TO 50
20 RAND USR start_address
(16550?)
30 NEXT I
PROGRAM C:
2 REM PROGRAM C,LOAD IN CODE
3 REM TO REM,ADD AFTER A OR B
20 PRINT "LOCATION ADDRESS IN
DECIMAL ?"
30 INPUT A
40 FOR I=A TO A+((LEN A$)/2)
50 POKE I,16*CODE A$+CODE A$(2
)-476
60 LET A$=A$(2 TO )
70 NEXT INote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

