--- title: "A 0 REM Generator" id: 77336 type: "computer_media" slug: "a-0-rem-generator" url: "http://localhost/computer_media/a-0-rem-generator/" markdown_url: "http://localhost/computer_media/a-0-rem-generator.md" published_at: "2026-11-15T18:39:05+00:00" modified_at: "2026-11-15T18:39:05+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/a-0-rem-generator-1.png" excerpt: "Make a REM line 0 of any length, sized with RAND, with a 54-byte relocatable machine-code routine." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Rene Bruneau" slug: "rene-bruneau" taxonomy: "indiv" url: "http://localhost/indiv/rene-bruneau/" genre: - name: "Machine Language" slug: "machine-language" taxonomy: "genre" url: "http://localhost/type/machine-language/" media_type: "Program" programmers: - name: "Rene Bruneau" slug: "rene-bruneau" taxonomy: "indiv" url: "http://localhost/indiv/rene-bruneau/" download_url: "https://archive.org/download/timex-sinclair-software-archive/A%200%20REM%20Generator%20%281992%29%28Bruneau%2C%20Rene%29%28TS1000%29%28CA%29%28Program%29.zip" mediadate: "1992" images: - url: "http://localhost/wp-content/uploads/2026/11/a-0-rem-generator-1.png" - url: "http://localhost/wp-content/uploads/2026/11/a-0-rem-generator-2.png" article_media: - id: 23725 title: "ZX81 Resources: A 0 REM Generator" type: "article" url: "http://localhost/article/zx81-resources-a-0-rem-generator/" media_type_tags: "Machine Language" license: false --- # A 0 REM Generator Creates a REM line 0 of any length at the top of the program, to hold machine code. The 54-byte relocatable routine takes the length from SEED, so you set it with RAND: RAND 20 then LET L=USR (address) makes 0 REM with 20 characters. Rene Bruneau modified a routine from Your Computer and added an installer that copies the code to any address you give. In the article you type a hex loader (RUN 100) and the bytes, then delete the loader; the download is that finished program, with the code already in the line 1 REM. RUN and give an address for the code; it must be outside the program area (the routine moves the program up), so lower RAMTOP first and put it above. Published in Sinc-Link May-June 1992 ([ZX81 Resources: A 0 REM Generator](https://timexsinclair.com/article/zx81-resources-a-0-rem-generator/)). ## Source Code ``` 1 REM ---54 SPACES---- 10 PRINT "ROUTINE ADDRESS" 20 INPUT ADD 30 FAST 40 FOR X=0 TO 53 50 POKE ADD+X, PEEK (16514+X) 60 NEXT X 70 SLOW 80 STOP 100 LET X=16514 110 LET T=0 120 LET A$="" 130 IF A$="" THEN INPUT A$ 140 IF A$="S" THEN PRINT "CHECK SUM = ";T,P 150 POKE X,16*CODE A$+CODE A$(2)-476 160 LET T=T+ PEEK X 170 IF PEEK 16442<=2 THEN SCROLL 180 PRINT X;" ";A$(1 TO 2) 190 LET X=X+1 200 LET A$=A$(3 TO) 210 GOTO 130 Listing 2 (machine code, hex): 16514 ED 4B 32 40 C5 21 06 00 16522 09 E5 C1 21 7D 40 CD 9E 16530 09 3E 76 EB 77 3E 17 C1 16538 C5 04 2B 77 0D 20 FB 05 16546 20 F8 2B 3E EA 77 D1 13 16554 13 7A 2B 77 7B 2B 77 3E 16562 00 2B 77 2B 77 C9 ```