--- title: "Line Renumbering" id: 76493 type: "computer_media" slug: "line-renumbering" url: "http://localhost/computer_media/line-renumbering/" markdown_url: "http://localhost/computer_media/line-renumbering.md" published_at: "2026-11-11T08:02:31+00:00" modified_at: "2026-11-11T08:02:31+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/line-renumbering-1.png" excerpt: "Renumber the lines of the BASIC program in memory to any start and step on a 4K ZX80; GO TO and GO SUB targets are left for you to fix." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "ZX80" slug: "zx80" taxonomy: "post_tag" url: "http://localhost/tag/zx80/" model: - name: "Sinclair ZX80" slug: "zx80" taxonomy: "model" url: "http://localhost/model/zx80/" indiv: - name: "Martin Irons (K2MI)" slug: "martin-irons-k2mi" taxonomy: "indiv" url: "http://localhost/indiv/martin-irons-k2mi/" genre: - name: "Renumber" slug: "renumber" taxonomy: "genre" url: "http://localhost/type/renumber/" media_type: "Program" programmers: - name: "Martin Irons (K2MI)" slug: "martin-irons-k2mi" taxonomy: "indiv" url: "http://localhost/indiv/martin-irons-k2mi/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Line%20Renumbering%20%281981%29%28Irons%2C%20Martin%29%28ZX80%29%28US%29%28Program%29.zip" mediadate: "1981" images: - url: "http://localhost/wp-content/uploads/2026/11/line-renumbering-1.png" - url: "http://localhost/wp-content/uploads/2026/11/line-renumbering-2.png" - url: "http://localhost/wp-content/uploads/2026/11/line-renumbering-3.png" article_media: - id: 19758 title: "Line Renumbering" type: "article" url: "http://localhost/article/line-renumbering/" related_content: - id: 19742 title: "Syntax Errors" type: "article" url: "http://localhost/article/syntax-errors-13/" media_type_tags: "Renumber" license: false --- # Line Renumbering A renumbering utility for the ZX80 (4K ROM) that sits at lines 9000-9399. Type it in first, then write your program below line 9000, ending with STOP. RUN 9010 (or GO TO 9010) asks for the first line number and the step, then walks through the program from address 16424, POKEing a new number into each line until it reaches the STOP, and prints the first and last new numbers. It does not change GO TO and GO SUB statements, and it can’t renumber itself or a program loaded from tape, since LOAD would replace it. As printed, line 9130 reads GO SUB 9300; the June 1981 Syntax Errors column corrects it to GO TO 9300. The download has both versions. Published in Syntax May 1981 ([Line Renumbering](https://timexsinclair.com/article/line-renumbering/)). ## Source Code ``` 9000 REM RENUMBER FIRST PROGRAM. PROGRAM MUST END WITH STOP. RENUMBER GO TO/GO SUB YOURSELF. DO NOT ATTEMPT TO RENUMBER THIS PROGRAM. 9010 LET S=16423 9020 PRINT "START WITH FIRST LINE AT?", 9030 INPUT N 9040 PRINT N 9050 LET F=N 9060 PRINT 9070 PRINT "RENUMBER BY?",, 9080 INPUT D 9090 PRINT D 9100 GO SUB 9200 9110 LET S=S+1 9120 IF PEEK(S)=118 THEN GO SUB 9200 9130 IF PEEK(S)=248 THEN GO SUB 9300 9140 GO TO 9110 9200 REM SUBROUTINE TO POKE NEW LINE NUMBER 9210 POKE (S+1),(N/256) 9220 POKE (S+2),(N-(N/256)*256) 9230 LET N=N+D 9240 RETURN 9300 REM END OF PROGRAM 9310 PRINT 9320 PRINT "FIRST PROGRAM WAS" 9330 PRINT " RENUMBERED FROM ";F;" BY ";D 9340 PRINT 9350 PRINT "LAST LINE NUMBER= ",(N-D) 9399 STOP ```