Spaces in REM Statements

Author(s): Frank O'Hara
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n8 (Volume 3, Issue 8)
Date: August 1982
Pages: 8

If you put your machine code in large REM statements, you need not laboriously type in spaces or digits. This 8K/16K program produces a REM statement containing up to 14991 full stops. You choose the number you want at line 40.

Delete lines 10-130 after running. You can change the line number for the REM statement by editing line 200 after your REM line is created. If the line is too big to edit, POKE 16510,1 works after you delete lines 10-130. Lines 20 and 30 are fool-proofing; I would not advise deleting them until you are happy with your REM statement.

This routine simply builds up the REM line one byte at a time, calling the ROM routine that makes one space and moves all the pointers up each time. It’s quicker to make all the spaces at once, but a bit more complicated to program. Using this method, a 500-byte REM line takes less than 20 seconds.

If you prefer digits 1234…, change line 100 to:

 100 POKE D+I,I-10*INT (I/10)+28

Hex code in line 10 reads:

1D 1E 2A 82 40 CD 9B 09 C9

The keystrokes in line 10 after 10 REM are:

number1 number2 letterE graphicshiftW tokenRND tokenLN inverse period graphicshiftD tokenTAN

Don’t type any spaces.

  10 REM 12E▙RNDLN .▓TAN
20 PRINT "ENTER 200 REM; THEN GOTO 40"
30 STOP
40 INPUT N
50 LET D=PEEK 16396+256*PEEK 16397-2
60 FOR I=1 TO N
70 POKE 16515,INT ((D+I)/256)
80 POKE 16514,D+I-256*PEEK 16515
90 RAND USR 16516
100 POKE D+I,27
110 NEXT I
120 POKE D-1,INT ((N+2)/256)
130 POKE D-2,N+2-256*PEEK (D-1)
SYNTACTIC SUM: 17705, 8K

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