A programmer’s utility which includes renumber, REM kill, and a compactor.
Appears on
Capital Area Timex Sinclair User Group’s Library Tape.
Gallery
Source Code
10 REM TOOLKIT 12 REM By John Charlesworth 14 REM YOUR COMPUTER, APRIL 84 16 REM adapted for 2068 by 18 REM Jack Dohany 20 REM (415)321-7684 50 BORDER 0: PAPER 0: INK 7: CLS : PRINT " **TOOLKIT DOCUMENTATION MENU**" 52 PRINT ''"1. BACKUP"''"2. READ DOCUMENTATION"''"3. GO TO TOOLKIT MENU"''"4. STOP" 54 PRINT AT 20,5;"**PLEASE PRESS A KEY**" 56 IF INKEY$="" THEN GO TO 56 58 LET K$=INKEY$ 60 IF K$="1" THEN GO TO 90 62 IF K$="2" THEN GO TO 100 64 IF K$="3" THEN GO TO 9980 66 IF K$="4" THEN PRINT AT 20,0;" OK TO RUN ": STOP 68 GO TO 56 90 CLS : PRINT AT 10,0;"TWO-PART SAVE": SAVE "TOOLKIT" LINE 9998: BEEP .1,25: SAVE "TKB"CODE 64048,1350: CLS : PRINT AT 10,0;"REWIND and PLAY to VERIFY": VERIFY "": VERIFY ""CODE : GO TO 1 100 CLS : PRINT "** TOOLKIT DOCUMENTATION **" 102 PRINT '"TOOLKIT has 4 main functions:"''"1) RENUMBER the BASIC program"''"2) KILL all REM statements"''"3) LIST all VARIABLES used"''"4) COMPACT the BASIC program"''"Each will be discussed in turn." 104 PRINT '"TOOLKIT also has a BACKUP"'"function, which should be used"'"before other functions." 106 PRINT '"TOOLKIT can be used with your"'"own BASIC programs. See Page 5." 108 GO SUB 900: IF k$="M" THEN RUN 109 IF k$="L" THEN GO TO 100 110 PRINT TAB 10;"PAGE 2"''"RENUMBER renumbers all BASIC"'"lines, including TOOLKIT's Basic"'"Handler, lines 9980-9999." 112 PRINT '"You get to specify the NEW FIRST"'"LINE(e.g.100) and STEP(e.g.10)." 114 PRINT '"Line numbers following GOTO,"'"GOSUB, RUN, LIST, LLIST and"'"RESTORE are renumbered, with"'"the following limitations:"'" 1) No computed line numbers"'" 2) No nonexistent line numbers" 116 PRINT '"Line numbers specified by other"'"kinds of statements are NOT"'"renumbered...such as"'" SAVE ""TK"" LINE 9998." 118 GO SUB 900: IF K$="M" THEN RUN 119 IF K$="L" THEN GO TO 100 120 PRINT TAB 10;"PAGE 3"''"Also, line numbers of the form"'" GO TO VAL ""1000"""'"will NOT be renumbered." 122 PRINT '"Any statements containing"'"computed or eVALuated line"'"numbers should be deleted prior"'"to renumbering. They can be re-"'"entered afterwards." 124 PRINT '"Other kinds of statements"'"specifying line numbers will"'"be ignored, and should be"'"fixed after renumbering." 126 PRINT '"NOTE: a NONSENSE IN BASIC"'"message following use of a TOOL-"'"KIT function is not abnormal." 128 GO SUB 900: IF K$="M" THEN RUN 129 IF K$="L" THEN GO TO 110 130 PRINT TAB 10;"PAGE 4"''"REMKILL simply deletes all"'"statements beginning with a"'"REM statement." 132 PRINT '"LIST VARIABLES does just that..."'"on the screen only. Use COPY to"'"get them on paper." 134 PRINT '"COMPACTION changes all numbers"'"in the BASIC program to the form"'"VAL ""n"". This saves 3 bytes"'"per number. NOTE:"'"RENUMBER BEFORE COMPACTING!!" 136 PRINT ''"TOOLKIT's machine code is 1350"'"bytes long, starting at Location"'"64048. Entry points can be"'"discovered in the BASIC handler." 138 GO SUB 900: IF K$="M" THEN RUN 139 IF K$="L" THEN GO TO 120 140 PRINT TAB 10;"PAGE 5"''"USING TOOLKIT WITH YOUR OWN"'"BASIC PROGRAM:" 142 PRINT '"First, make sure your BASIC"'"program does not have any lines"'"numbered from 9980 to 9999."''"Then load TOOLKIT, STOP and"'"DELETE 1,1000 (documentation)."'"Then MERGE (or write) your BASIC"'"program. Then GO TO 9980." 144 PRINT '"If your program itself uses"'"machine code that would occupy"'"the same area as TOOLKIT's"'"machine code, then do not load"'"your program's machine code"'"until you're done with TOOLKIT." 148 GO SUB 900: IF K$="M" THEN RUN 149 IF K$="L" THEN GO TO 130 150 PRINT TAB 10;"PAGE 6"''"TOOLKIT's machine code was"'"written for SPECTRUM by John"'"Charlesworth. It appeared in"'"YOUR COMPUTER VOL 4, NO 4."''"TOOLKIT was adapted for 2068 by"'"Jack Dohany, (415)321-7684."''"TOOLKIT's machine code could"'"use some improvement, but at"'"least it works."'''TAB 10;"THE END" 152 GO SUB 900: RUN 158 GO SUB 900: IF K$="M" THEN RUN 159 IF K$="L" THEN GO TO 140 160 GO TO 100 800 STOP 900 LET k$="": PRINT #1;AT 0,0;"Copy Menu Last pg else next pg" 910 IF k$=INKEY$ THEN GO TO 910 920 LET k$=INKEY$ 925 IF k$>"Z" THEN LET k$=CHR$ (CODE k$-32) 930 IF k$="C" THEN COPY 940 CLS : RETURN 9980 CLS : PRINT TAB 9;"** TOOLKIT **"'''"1: RENUMBER"''"2: KILL REMS"''"3: LIST VARIABLES"''"4: COMPACTION"''"5: MAKE BACKUP"''"6: STOP"''"OK TO RUN AFTER STOPPING"''"NOTE: TOOLKIT DOCUMENTATION IS A"'"SEPARATE PROGRAM, NEXT ON TAPE.": INPUT FFF: IF FFF<>1 THEN GO TO 9988 9982 LET TTT=100: LET SSS=10: IF FFF=1 THEN INPUT "NEW FIRST LINE: ";TTT,"STEP: ";SSS 9984 IF TTT>9999 OR TTT<1 OR SSS<1 OR SSS>TTT THEN GO TO 9980 9986 POKE 23300,INT (TTT/256): POKE 23299,TTT-256*PEEK 23300: POKE 23302,INT (SSS/256): POKE 23301,SSS-256*PEEK 23302: RANDOMIZE USR 64048: PRINT AT 20,0;"RENUMBER DONE": PAUSE 200: GO TO 9980 9988 IF FFF=2 THEN RANDOMIZE USR 64841: PRINT AT 20,0;"REMS KILLED": PAUSE 200: GO TO 9980 9990 IF FFF=3 THEN PRINT USR 65184: STOP 9992 IF FFF=4 THEN RANDOMIZE USR 65017: PRINT AT 20,0;"COMPACTION DONE.": PAUSE 200: GO TO 9980 9994 IF FFF=5 THEN CLS : PRINT AT 10,0;"TWO-PART SAVE": SAVE "TK" LINE 9998: BEEP .01,25: SAVE "TKB"CODE 64048,1350: CLS : PRINT AT 20,0;"REWIND AND PLAY TO VERIFY": VERIFY "": VERIFY ""CODE : GO TO 1 9995 IF FFF=6 THEN STOP 9996 GO TO 9980 9998 CLEAR 64048: BORDER 0: PAPER 0: INK 7: CLS : PRINT AT 10,0;"I'VE SET RAMTOP TO 64048"''"I'M LOADING THE 1350 BYTES"'"OF TOOLKIT CODE AT 64048": LOAD ""CODE 9999 GO TO 1