A machine-code renumber utility for BASIC programs. It renumbers the lines and also the line numbers used by GO TO, GO SUB, RESTORE, RUN, LIST and similar statements. After CLEAR 62800 and LOAD "RENUM63000" CODE, start it with RANDOMIZE USR 63000; it asks for the first line number and the step. Line references must be written as four-digit constants with no variables (for example RUN 0001), user-defined graphics are not affected, and if something goes wrong it stops and reports the line in error.
Written by Eric Boisvert for the first issue of Byte Power, August 1986, where it is listed as “Renumber Basic Program” with a loading time of 15 seconds.
Program Analysis
The file is a single 2,122-byte CODE block loaded at 62839, which the magazine says can be saved again with SAVE "RENUM63000" CODE 62839,2122. The entry point at 63000 lies 161 bytes into the block. Its messages, visible in the code, are “RENUMBER FROM”, “BY”, “RENUMBERING”, “ERROR, LINE OVERFLOW” and “ERROR IN LINE”. The routine itself has not been disassembled.
Notable Techniques
- Requiring four-digit line references means each number can be replaced in place without changing the length of the line.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.