--- title: "Super Utility" id: 56719 type: "computer_media" slug: "super-utility" url: "http://localhost/computer_media/super-utility/" markdown_url: "http://localhost/computer_media/super-utility.md" published_at: "2024-09-22T23:31:54+00:00" modified_at: "2026-04-03T07:58:55+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/SCR-20241029-saeq.png" excerpt: "A self-contained Z80 toolkit packs a disassembler, memory map, machine-code editor, variable lister, and ROM searcher into one BASIC program—with some clever RAM-saving tricks." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" 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: "WIDJUP Company" slug: "widjup-company" taxonomy: "post_tag" url: "http://localhost/tag/widjup-company/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "William J. Pedersen" slug: "william-j-pedersen" taxonomy: "indiv" url: "http://localhost/indiv/william-j-pedersen/" genre: - name: "Machine Language" slug: "machine-language" taxonomy: "genre" url: "http://localhost/type/machine-language/" - name: "Programming" slug: "programming" taxonomy: "genre" url: "http://localhost/type/programming/" - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" programmers: - name: "William J. Pedersen" slug: "william-j-pedersen" taxonomy: "indiv" url: "http://localhost/indiv/william-j-pedersen/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Super%20Utility%20%281983%29%28WIDJUP%29%28TS1000%29%28US%29%28Cassette%29.zip" mediadate: "1983" producer_company: - id: 27769 title: "WIDJUP Company" type: "company" url: "http://localhost/company/widjup-company/" images: - url: "http://localhost/wp-content/uploads/2024/09/SCR-20241029-saeq.png" - url: "http://localhost/wp-content/uploads/2024/09/SCR-20241029-safb.png" - url: "http://localhost/wp-content/uploads/2024/09/Super-Utility.jpg" related_products: - id: 56553 title: "Super Utility" type: "product" url: "http://localhost/product/super-utility/" media_type_tags: "Machine Language, Programming, Utility" --- # Super Utility This program is a comprehensive Z80 assembly-language utility suite for the ZX81/TS1000, providing a disassembler, memory map, machine-code editor, variable lister, ROM/RAM search tool, and a memory spy. The disassembler (lines 9000–9108) decodes Z80 opcodes—including DD/FD (IX/IY) and ED prefixes—using two lookup tables, T$() and W$(), to reconstruct mnemonics. The machine-code editor (lines 9200–9320) supports 15 entry modes covering single bytes, double bytes, 16-bit load pairs, PUSH sequences, and conditional/unconditional jumps, calculating relative offsets for JR instructions automatically. To conserve RAM, numeric constants throughout the program are replaced by pre-initialised variables (I, II, III, IV, FIV, VI, etc., set in lines 9810–9829), and GOTO/GOSUB targets are stored in named variables (VLST, MAP, DISA, etc., set in lines 9841–9861), exploiting the fact that a two-byte variable reference is shorter than a five-byte literal line number. Machine code is embedded in REM statements at lines 7–9, and a USR call at line 9801 executes a purge routine, with additional USR calls at lines 9474 and 9476 driving the ROM search engine. *** ## Program Analysis ### Program Structure The program is divided into clearly labelled, self-contained modules, each beginning with an inverse-video REM label. Entry points are stored in named numeric variables (e.g. `VLST=9501`, `MAP=8101`, `DISA=9000`) set at lines 9841–9861, allowing `GOTO` and `GOSUB` to reference a short variable name instead of a five-digit literal, saving several bytes per call site. | Lines | Module | Function | | --- | --- | --- | | 7–9 | Machine code | Z80 binary embedded in REM statements | | 8100–8140 | MAP | Visual memory map with system variable decoding | | 9000–9108 | DISA | Z80 disassembler | | 9120–9141 | WCOD | Dumps the T$() opcode decode table | | 9135–9142 | WSTR | Dumps the W$() mnemonic string array | | 9200–9320 | EDIT | Interactive machine-code editor | | 9449–9493 | SEARCH | ROM/RAM byte-sequence searcher (with LPRINT option) | | 9500–9524 | VLST | Variable lister | | 9532–9696 | Support subroutines | STRING, SINGL, N(), MULT, $(), F-N variable decoders | | 9697–9704 | DTB / DB | String-trim and 16-bit PEEK helpers | | 9705–9742 | SRCH | BASIC source-text searcher using USR | | 9750–9766 | SPY | Interactive memory inspector | | 9800–9860 | PURG / INIT / KEYS | Initialisation: constants, label variables, USR purge call | | 9892–9898 | Array deletion note | Documents DIM-to-zero trick | | 9899–9914 | SAVE | Tape save with animation and re-entry control | | 9915–9926 | MEM | Free-memory reporter | | 9927–9933 | SYSV | System variable reader via character-code lookup | | 9950–9959 | SLEEP | Animated pause/delay routine | | 9960–9989 | HELP | Two-page help screen | | 9997–9999 | Templates | Column-ruler REMs for code layout reference | ### Machine Code Usage Three REM lines (7, 8, 9) hold raw Z80 opcodes. A `USR` call at line 9801 (`LET N(1)=USR 16900`) executes a routine inside REM line 7, which appears to purge or initialise data structures. Additional `USR 16860` and `USR 16809` calls at lines 9474–9476 and 9723 drive the byte-sequence search engine, returning a result address or the sentinel value 55555 to signal “not found”. The SRCH module (line 9705) builds a parameter block by POKEing data starting at address 17015 before invoking the machine-code search. ### Constant-Variable Optimisation All small integers used throughout the program are pre-computed as named variables in the initialisation block (lines 9810–9829). This is a well-known ZX81 memory optimisation: a variable reference in a BASIC line encodes as the variable name plus a two-byte pointer, whereas an inline numeric literal encodes as a keyword plus a five-byte floating-point value. | Variable | Value | Variable | Value | | --- | --- | --- | --- | | `I` | 1 | `TEN` | 10 | | `II` | 2 | `XX` | 20 | | `III` | 3 | `XXX` | 30 | | `IV` | 4 | `F4` | 16 | | `FIV` | 5 | `F5` | 32 | | `VI` | 6 | `F6` | 64 | | `VII` | 7 | `F7` | 128 | | `VIII` | 8 | `F8` | 256 | | `IX` | 9 | `FF` | 255 | | `Z0` | 0 | `IK` | 1/65536 | ### Disassembler Design The disassembler at lines 9000–9108 handles all major Z80 opcode classes. It first checks for DD/FD index-register prefixes (setting flag `WF` and `WFK`), then the CB and ED escape bytes, before looking up the base opcode in a 345-entry table `T$()`. Each `T$()` entry holds three character-code indices into the mnemonic array `W$()`. The subroutine at line 9066 decodes one operand field at a time; special sentinel codes (`WN+IV` = error, `WN+V` = byte operand, `WN+VI` = displacement, `WN+VII`/`WN+VIII` = word operand) drive the operand-fetch logic. Relative-jump displacement sign-extension is performed at lines 9096–9100, and DJNZ/JR targets are resolved to absolute addresses at line 9101. ### System Variable Reader (SYSV) The `SYSV` subroutine (lines 9927–9933) decodes a single-character variable name in `D$` to a ZX81 system variable address. It maps the ASCII code of the character to an offset into the string `E$="10141824260002"`, extracts a two-digit decimal offset, adds the base address 16386, then reads a 16-bit little-endian value via two `PEEK`s. This avoids hard-coding every system variable address individually. ### Variable Lister (VLST) The variable lister (lines 9500–9696) walks the ZX81 variable area starting from address 16400. It reads the type byte of each variable, extracts the type in the high three bits, and dispatches to one of six handler subroutines: `STRING` (9532), `SINGL` (9564), `N()` (9596), `MULT` (9628), `$()` (9660), and `F-N` (9692), corresponding to the six ZX81 variable storage formats. The `DB` subroutine (9703) reads a 16-bit little-endian value from address `E`, a pattern used heavily throughout. ### Machine-Code Editor (EDIT) The editor (lines 9200–9320) presents a 15-option menu for entering different instruction categories. It uses computed `GOTO` via the expression `L-F4+VI*N` (where `L=9228`) to jump directly to the handler for the selected entry type—a dispatch table implemented arithmetically. Jump encoding (lines 9296–9316) automatically selects between relative (JR/DJNZ, 2 bytes) and absolute (JP, 3 bytes) forms based on whether the target is within signed 8-bit range of the current address. ### Notable Techniques and Anomalies - The `SAVE` routine (line 9902) prints “LOOPING”, “HELP”, or “LOAD-AND-GO” by multiplying Boolean expressions: `"text" AND NOT (NTRY-value)` exploits the ZX81 rule that a false condition evaluates a string to `""`. - The `SLEEP` subroutine (9950–9959) accumulates a large delay value across four additions into `ZZ` to circumvent the 16-bit integer limit of a single `PAUSE` argument, then calls `PAUSE E` and resets the `FRAMES` system variable via `POKE 16437,FF`. - Line 9536 uses `(E AND E=F4)` as a minimum function, clamping a length to 20. - Line 9481 uses `INT (L/F8+II**-IX)`—where `II**-IX` is 2^-9 ≈ 0.00195—as a small epsilon to handle floating-point rounding when computing the high byte of a 16-bit value. - Line 9512 appears twice (the second being a duplicate line number that should be 9513); this is an anomaly that some interpreters resolve by executing the first occurrence only. - The `GOTO ERR` and `GOTO HELP` (etc.) idiom throughout the code references the label variables set in lines 9841–9861, keeping branch targets readable while saving memory. ## Source Code ``` 1 REM %U%T%I%L%I%T%Y 2 REM ************* 3 REM COPYRIGHT NOV 14, 1983 BY WILLIAM J. PEDERSEN. 1120 MERRIFIELD S.E., GRAND RAPIDS, MICHIGAN 49507 4 REM REPRODUCTION OR USE OF THIS PROGRAM IS PROHIBITED WITHOUT EXPRESS WRITTEN PERMISSION. 5 REM ************* 7 REM 7EE6E0FEC028EF29941FE80287F2A241FE60281023229341ED5B937B192323C911C019116019C923CB7E28FB18F4F5D5E52ADB42ED4BDF42ED5BE7421AEDB1201B22DB42ED43DF422BED4BE5421AEDA120DF13EAC841ED4BDB42182113D9181CF5D5E5210022DB4221FF1F22DF4218BF00D9186 8 REM E1D1FD2A0403E1EED47F1C9F5D5E52A104022DB423E80BE28E6CB6EF5CD784122DD42F12082ADD4222DB4218E7CD2E422ADB4218DF2ADB42E5ED5BDD42D5AFED52EB2A1C4019221C402A1A4019221A402A1440E519221440E1D1AFED52E5C132ADB42EBEDB0E1C91B1B1B1B1D1B1B1B1B1B1B0000186 9 REM DC7F23D9FA9CADEA78421B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B571B957BA841B1B1B1B2078421B1B1B1B1B1B1E1B1B 8100 REM %M%A%P 8101 CLS 8102 PRINT ,," % %M%E%M%O%R%Y% %M%A%P% ";Z$ 8103 LET G$="####%P:.'.':%V:'..':%U%U.'.'1638420479204802457524576286712867232767ABCEFG0 PROGRAM =VARIABLES=AVAIL MEM=RAMTOP UP=" 8104 LET H$="16509" 8105 LET Q=1 8106 LET S=37 8107 LET I$=CHR$ S 8108 FOR K=IV TO XX-I STEP FIV 8109 LET T=II*K+VII 8110 LET L=53.4+II*K/FIV 8111 LET D$=H$ 8112 GOSUB SYSV 8113 LET TT=VAL D$ 8114 LET D$=G$(L) 8115 GOSUB SYSV 8116 LET QQ=VAL D$ 8117 IF QQ=Z0 THEN LET QQ=32768 8118 LET LL=54+II*K 8119 PRINT AT K-I,Z0;G$(LL TO LL+IX);QQ-TT;" BYTES." 8120 LET H$=G$(L+I) 8121 FOR N=Z0 TO 31 8122 PRINT AT K,N;G$(Q); 8123 LET B=13107.2+F7*N+819.2*K 8124 LET D$=I$ 8125 GOSUB SYSV 8126 LET BB=VAL D$ 8127 IF BB-BB+F7 THEN GOTO 8137 8129 LET Q=Q+II 8130 LET S=S+I 8131 LET D$=CHR$ S 8132 GOSUB SYSV 8133 LET I$=D$ 8134 IF LEN I$B+F7 THEN GOTO 8137 8136 GOTO 8130 8137 NEXT N 8138 PRINT G$(T TO T+IV);TAB 27;G$(T+FIV TO T+IX) 8139 NEXT K 8140 STOP 8141 GOTO HELP 8999 REM % %D%I%S%A%S%S%E%M%B%L%E%R% 9000 PRINT AT XX,Z0;"DISASSEMBLE STARTING WHERE?" 9001 INPUT WB 9002 CLS 9003 LET WL=Z0 9004 LET WIA=WB 9005 LET WFS=Z0 9006 LET WFN=I 9007 LET WFK=Z0 9008 LET WF=Z0 9009 LET WFW=Z0 9010 LET WV=Z0 9011 LET G$="" 9012 LET WN=112 9013 LET WL=WL+I 9014 LET WP=PEEK WB 9015 IF WP<>221 AND WP<>253 THEN GOTO 9021 9016 IF WFK THEN GOTO ERR 9017 LET WF=I+(I AND WP=253) 9018 LET WFK=I 9019 LET WB=WB+I 9020 GOTO 9014 9021 IF WP<>203 THEN GOTO 9034 9022 LET WFN=Z0 9023 LET WJ=345 9024 LET WB=WB+I+WFK 9025 LET WP=PEEK WB 9026 LET W1=INT (WP/F6) 9027 LET W=WP-F6*W1 9028 LET W2=INT (W/VIII) 9029 LET W=W-VIII*W2 9030 IF WFK AND W<>VI THEN GOTO ERR 9031 IF W1 THEN LET T$(WJ)=CHR$ (97+W1)+CHR$ (F4+I+W2)+CHR$ (W+I) 9032 IF NOT W1 THEN LET T$(WJ)=CHR$ (49+W2)+CHR$ (W+I)+CHR$ 97 9033 GOTO 9042 9034 LET WJ=I+PEEK WB 9035 LET WW=Z0 9036 IF WP<>237 THEN GOTO 9040 9037 LET WB=WB+I 9038 LET WW=PEEK WB 9039 LET WJ=193+WW-(36 AND WW>159) 9040 IF WW>123 AND WW<160 OR WJ>344 THEN GOTO ERR 9041 LET WDIS=PEEK (WB+I) 9042 LET V$="" 9043 LET W0=CODE T$(WJ,I) 9044 IF W0=WN+IV THEN GOTO ERR 9045 IF W0<>WN-IV THEN GOTO 9048 9046 LET WV=VAL (W$(CODE T$(WJ,II))) 9047 LET G$=" " 9048 GOSUB 9066 9049 LET B$=I$+" " 9050 LET W0=CODE T$(WJ,II) 9051 GOSUB 9066 9052 IF I$="" THEN GOTO 9063 9053 IF WP=211 THEN LET I$="(N)" 9054 LET B$=B$+I$ 9055 LET W0=CODE T$(WJ,III) 9056 GOSUB 9066 9057 IF I$="" THEN GOTO 9060 9058 IF WP=219 THEN LET I$="(N)" 9059 LET B$=B$+","+I$ 9060 IF WFK AND NOT WFW THEN GOTO ERR 9061 LET V$=STR$ WV 9062 IF NOT LEN G$ AND WV=Z0 THEN LET V$="" 9063 PRINT WIA;TAB VI;B$;TAB XX-I;V$+G$ 9064 LET WB=WB+I+WFS*WFN 9065 GOTO 9004 9066 LET I$=W$(W0) 9067 GOSUB DTB 9068 IF W0=WN+FIV THEN GOSUB 9094 9069 IF W0<>WN+VI THEN GOTO 9075 9070 LET WB=WB+WFK+I 9071 LET WFN=Z0 9072 LET WV=PEEK WB 9073 IF WP=211 OR WP=219 THEN GOTO 9078 9074 LET G$=":"+CHR$ WV+":" 9075 IF WV>=F5 THEN GOTO 9078 9076 LET W=F4+I+III*WV 9078 IF W0VII THEN GOTO 9091 9088 LET WFS=I 9089 GOSUB 9095 9090 LET I$=W$(WN+WF, TO III)+I$+")" 9091 IF W0=61 THEN LET I$=W$(WN+WF,II TO III) 9092 IF W0=WN THEN LET I$=W$(WN+WF) 9093 RETURN 9094 LET WB=WB+I 9095 LET W=WDIS 9096 IF W=Z0 THEN LET I$="+"+STR$ W 9100 IF WF4-II THEN GOTO M 9216 PRINT AT N+FIV,F4;"% " 9217 GOTO L-F4+VI*N 9218 INPUT K 9219 IF K<0 OR K>FF THEN GOTO M 9220 POKE B,K 9221 LET B=B+I 9222 GOTO 9209 9224 INPUT K 9225 IF K<0 OR K>=F8*F8 THEN GOTO M 9226 POKE B+I,INT (K/F8) 9227 POKE B,K-F8*INT (K/F8) 9228 LET B=B+II 9229 GOTO 9209 9236 POKE B,XXX+N 9237 LET B=B+I 9238 GOTO L-IV 9242 POKE B,245 9243 POKE B+I,213 9244 POKE B+II,229 9245 LET B=B+I 9246 GOTO L 9266 POKE B,237 9267 POKE B+I,XX-I+VIII*N 9268 LET B=B+II 9269 GOTO L-IV 9290 POKE B,237 9291 POKE B+I,VIII*N-F4+II 9292 GOTO L 9296 PRINT AT F4,F4;"JUMP TO?" 9297 INPUT N 9298 IF N<16760 OR N>=F8*F8 THEN GOTO M 9299 LET W=(B-N)>F7+I OR B-N<-F7+II 9300 PRINT AT VI,F4;"WHICH CONDITION?",AT VIII,F4;" 1 DJNZ",AT IX,F4;" 2 NONE",AT TEN,F4;" 3 NZ",AT TEN+I,F4;" 4 Z",AT VI+VI,F4;" 5 NC",AT IX+IV,F4;" 6 C",AT F4-II,F4;" 7 PO",AT F4-I,F4;" 8 PE",AT F4,F4;" 9 P ",AT F4+I,F4;"10 M" 9301 INPUT S 9302 IF STEN THEN GOTO M 9303 IF W OR S>VI THEN GOTO 9309 9304 LET N=N-B-II 9305 IF N>=F7 THEN LET N=F7-N 9306 POKE B,VIII+VIII*S 9307 POKE B+I,N 9308 GOTO L 9309 IF S=I THEN GOTO M 9310 POKE B,170+VIII*S 9311 IF S=II THEN POKE B,195 9312 LET B=B+I 9313 LET P3=INT (N/F8) 9314 POKE B,N-F8*P3 9315 POKE B+I,P3 9316 GOTO L 9317 CLS 9318 PRINT AT IX,Z0;"%Q%U%I%T OR AN ERROR HAS OCCURRED. THE LAST LOCATION WAS ";B;".","CONTINUE FOR DISASSEMBLER." 9319 STOP 9320 GOTO DISA 9449 REM %S%E%A%R%C%H 9450 CLS 9451 LET Q=Z0 9452 LET E=I 9453 PRINT ,,"OBJECTIVE/TITLE?", 9454 INPUT G$ 9455 PRINT AT I,Z0;G$;" ";AT II,Z0;"PRINT? %YES OR %NO", 9456 LET W=Z0 9457 INPUT H$ 9458 IF LEN H$ THEN IF H$(I)="Y" THEN LET W=I 9459 PRINT AT II,Z0;"INPUT YOUR CODE ", 9460 INPUT L 9461 IF L>FF THEN GOTO 9481 9462 PRINT AT II,Z0;"IF DOUBLE BYTE, ENTER ""D""" 9463 INPUT H$ 9464 IF LEN H$ THEN IF H$(I)="D" THEN GOTO 9481 9465 POKE 17015+E,L 9466 LET E=E+I 9467 PRINT AT II,Z0;"ANOTHER ENTRY? %YES OR %NO", 9468 INPUT H$ 9469 IF LEN H$ THEN IF H$(I)="Y" THEN GOTO 9459 9470 CLS 9471 IF NOT W THEN PRINT ,,G$ 9472 IF W THEN LPRINT G$ 9473 POKE 17125,E-I 9474 LET K=USR 16860 9475 GOTO 9477 9476 LET K=USR 16809 9477 LET Q=Q+I 9478 IF K=55555 THEN GOTO 9486 9479 GOSUB 9490+II*W 9480 GOTO 9476 9481 LET P2=INT (L/F8+II**-IX) 9482 POKE 17016+E,P2 9483 POKE 17015+E,L-F8*P2 9484 LET E=E+II 9485 GOTO 9467 9486 IF NOT W THEN PRINT "$";Q-I 9487 IF W THEN LPRINT "$";Q-I 9488 STOP 9489 GOTO SEARCH 9490 PRINT K-I;TAB TEN;PEEK K;TAB 15;PEEK (K+I);TAB XX;PEEK K+F8*PEEK (K+I) 9491 RETURN 9492 LPRINT K-I;TAB TEN;PEEK K;TAB 15;PEEK (K+I);TAB XX;PEEK K+F8*PEEK (K+I) 9493 RETURN 9499 STOP 9500 REM %V%L%S%T 9501 CLS 9502 PRINT ,,,," %V%A%R%I%A%B%L%E%S",,, 9503 LET E=16400 9504 GOSUB DB 9505 LET L=E-I 9506 LET T=Z0 9507 LET T=T+I 9508 LET L=L+I 9509 LET B=L 9510 IF LEN H$>I THEN IF H$( TO II)="H$" THEN GOSUB VLST+XX 9511 LET CH=PEEK L 9512 PRINT TAB III-LEN STR$ T;T;" "; 9512 LET TP=INT (CH/F5) 9514 LET CH=CH-TP*F5+F5 9515 LET H$=CHR$ CH 9516 GOSUB VLST-F5+F5*TP 9517 LET E=TP=II OR TP=VI 9518 IF E THEN PRINT H$;TAB XX+VI;B 9519 IF NOT E THEN PRINT H$;TAB XX+III-LEN STR$ Q;Q;TAB XX+VI;B 9520 GOTO VLST+VI 9521 PRINT ,," %E%N%D% %O%F% %L%I%S%T ";L 9522 LET H$="***" 9523 STOP 9524 GOTO VLST 9532 REM %S%T%R%I%N%G 9533 LET H$=H$+"$ " 9534 LET E=L+I 9535 GOSUB DB 9536 FOR Q=I TO (E AND E=F4) 9537 LET H$=H$+CHR$ PEEK (L+II+Q) 9538 NEXT Q 9539 LET L=L+II+E 9540 RETURN 9564 REM %S%I%N%G%L 9565 LET Q=VAL H$ 9566 LET L=L+FIV 9567 RETURN 9596 REM %N%(%) 9597 LET H$=H$+"(" 9598 LET I$=H$ 9599 LET S=PEEK (L+III) 9600 FOR Q=I TO S 9601 LET E=L+II+II*Q 9602 GOSUB DB 9603 IF Q>=S THEN GOTO VLST+105 9604 LET H$=H$+STR$ E+"," 9605 LET I$=I$+"1," 9606 NEXT Q 9607 LET H$=H$+STR$ E+")" 9608 LET I$=I$+"1)" 9609 LET Q=VAL I$ 9610 LET E=L+I 9611 GOSUB DB 9612 LET L=L+II+E 9613 RETURN 9628 REM %M%U%L%T 9629 LET L=L+I 9630 LET CH=PEEK L 9631 IF INT (CH/F6)=II THEN GOTO VLST+133 9632 LET H$=H$+CHR$ CH 9633 GOTO VLST+F7 9634 LET H$=H$+CHR$ (CH-F7) 9635 LET Q=VAL H$ 9636 LET L=L+FIV 9637 RETURN 9660 REM %$%(%) 9661 LET H$=H$+"$(" 9662 LET S=PEEK (L+III) 9663 FOR Q=I TO S 9664 LET E=L+II+II*Q 9665 GOSUB DB 9666 IF Q>=S THEN GOTO VLST+168 9667 LET H$=H$+STR$ E+"," 9668 NEXT Q 9669 LET H$=H$+STR$ E+")" 9670 LET E=L+VI 9671 LET U=L+III+II*S 9672 GOSUB DB 9674 FOR Q=U TO U+(E AND E=F4) 9675 LET H$=H$+CHR$ PEEK Q 9676 NEXT Q 9677 GOTO VLST+109 9692 REM %F%-%N 9693 LET Q=VAL H$ 9694 LET H$=H$+" FOR-NEXT" 9695 LET L=L+XX-III 9696 RETURN 9697 REM %D%T%B 9698 FOR J=LEN I$ TO I STEP -I 9699 IF I$(J)=" " THEN NEXT J 9700 LET I$=I$( TO J) 9701 RETURN 9702 REM %D%B 9703 LET E=F8*PEEK (E+I)+PEEK E 9704 RETURN 9705 REM %S%R%C%H 9706 CLS 9707 PRINT AT IX,I;"WRITE YOUR STRING WITHOUT LINE NUMBER. ADD A QUOTE AND PRECEDESTRING WITH",,,," LET H$=""",,,," THEN ENTER AND CONTINUE." 9708 LET E=17116 9709 STOP 9710 POKE E+IX,LEN H$ 9711 POKE E-I,247 9712 POKE E,66 9713 LET K=PEEK 16396+F8*PEEK 16397-17143 9714 LET S=INT (K/F8) 9715 LET K=K-F8*S 9716 POKE E+III,K 9717 POKE E+IV,S 9718 FOR E=I TO LEN H$ 9719 POKE (E+17015),CODE H$(E) 9720 NEXT E 9721 CLS 9722 PRINT ,,"""";H$;"""";TAB Z0;,, 9723 LET K=USR 16809 9724 IF K=55555 THEN GOTO 9740 9727 LET Q=K 9728 LET Q=Q-I 9729 IF PEEK Q<>118 THEN GOTO 9728 9730 IF K-Q"Q" THEN GOTO 9755 9754 STOP 9755 IF H$<>"H" THEN GOTO 9758 9756 LET B=B+F4 9757 GOTO 9762 9758 IF H$<>"L" THEN GOTO 9761 9759 LET B=B-F4 9760 GOTO 9762 9761 LET B=VAL H$ 9762 CLS 9763 FOR E=B TO B+XX+I 9764 PRINT E;TAB VI;PEEK E;TAB TEN;":";CHR$ PEEK E;":";TAB XX;F8*PEEK (E+I)+PEEK E 9765 NEXT E 9766 GOTO 9752 9800 REM %P%U%R%G 9801 LET N(1)=USR 16900 9802 REM %I%N%I%T%I%A%L%I%Z%A%T%I%O%N%S 9810 LET I=1 9811 LET Z0=I-I 9812 LET II=I+I 9813 LET III=II+I 9814 LET IV=II+II 9815 LET FIV=IV+I 9816 LET VI=IV+II 9817 LET VII=VI+I 9818 LET VIII=IV+IV 9819 LET IX=VIII+I 9820 LET TEN=IX+I 9821 LET XX=II*TEN 9822 LET XXX=30 9823 LET F4=II*VIII 9824 LET F5=II*F4 9825 LET F6=II*F5 9826 LET F7=II*F6 9827 LET F8=256 9828 LET FF=F8-I 9829 LET IK=I/F8/F8 9840 REM %K%E%Y%S 9841 LET VLST=9501 9842 LET DB=9703 9843 LET PURG=9801 9844 LET MEM=9916 9845 LET ZZ=9953 9846 LET ZZZ=ZZ-I 9847 LET ZZZZ=ZZ-II 9848 LET SAVE=9900 9849 LET SYSV=9928 9850 LET MAP=8101 9851 LET SEARCH=9450 9852 LET SRCH=9706 9853 LET HELP=9961 9854 LET SPY=9751 9855 LET DISA=9000 9856 LET ERR=9103 9857 LET DTB=9698 9858 LET WCOD=9121 9859 LET WSTR=9136 9860 LET NTRY=HELP 9861 LET EDIT=9201 9892 CLS 9893 PRINT ,,,,"* TO DELETE STRINGS AND ARRAYS, REDIMENSION THEM TO ZERO." 9894 PRINT ,," DIM (NAME)$(0) OR" 9895 PRINT ,," DIM (NAME)(0)" 9896 PRINT ,," THIS WILL PULL ERROR 3/0 BUT"," THE JOB IS DONE." 9897 STOP 9898 GOTO VLST 9899 REM %S%A%V%E 9900 CLS 9901 PRINT ,,,,"""";Z$;""" IS TO BE SAVED.",,,"START RECORDER. PRESS ANY KEY.",,,Q$,, 9902 PRINT "MODE IS ";"LOOPING" AND NOT (NTRY-SAVE);"HELP" AND NOT (NTRY-HELP);"LOAD-AND-GO" AND NOT (NTRY-1000) 9903 SLOW 9904 IF NTRY<>SAVE THEN PAUSE 40000 9905 FOR N=F6 TO I STEP -I 9906 UNPLOT N-I,XXX 9907 NEXT N 9908 SAVE Z$ 9909 FAST 9910 CLS 9911 PRINT Y$;X$ 9912 PRINT AT IX+VI,VII;"PRESENTS***" 9913 GOSUB ZZZ 9914 GOTO NTRY 9915 REM %M%E%M 9916 LET L=F8*(PEEK 16387-PEEK 16413)+PEEK 16386-PEEK 16412 9917 LET E=INT (L/F5/F5) 9918 PRINT AT IX,Z0;"MEMORY LEFT IS:";E;" K, ";L-F5*F5*E;" BYTES.",,,"(";L;" BYTES)" 9919 IF L13 THEN GOTO 9933 9930 LET E$="10141824260002" 9931 LET E=VAL E$(E TO E+I)+16386 9932 LET D$=STR$ (F8*PEEK (E+I)+PEEK E) 9933 RETURN 9950 REM %S%L%E%E%P 9951 LET ZZ=ZZ+F8 9952 LET ZZ=ZZ+F7 9953 LET ZZ=ZZ+F6 9954 LET ZZ=ZZ+F5 9955 LET E=ZZ-ZZZ+F5 9956 LET ZZ=ZZZ+I 9957 PAUSE E 9958 POKE 16437,FF 9959 RETURN 9960 REM %H%E%L%P 9961 CLS 9962 LET PAGE=I 9963 LET H$="% %H%E%L%P% PAGE " 9964 PRINT AT I,IX;H$;PAGE 9965 PRINT ,,"* USE GOTO FOR DESIRED LOCATION,",,"* LET Z$=""(YOUR PROGRAM NAME)""",,,"* LET NTRY=1000 IF YOU WANT YOUR PROGRAM TO RUN AFTER LOADING." 9966 PRINT ,,"* Z$=""";Z$;"""" 9967 LET I$="% %K%E%Y%W%O%R%D% %L%I%N%E% %F%U%N%C%T%I%O%N% " 9968 PRINT ,,I$,"""HELP"" 9960 HERE.","""VLST"" 9500 VARIABLE LIST.","""MEM"" 9915 AVAILABLE MEMORY. ""SAVE"" 9900 SAVE PROGRAM," 9969 PRINT """NTRY"" HELP UNLESS CHANGED." 9970 PRINT """PURG"" 9800 DELETE VARIABLES." 9971 PRINT """MAP"" 8100 MEMORY MAP." 9972 PRINT """SPY"" 9750 LOOK AT MEMORY." 9973 PRINT """DISA"" 9000 DISASSEMBLE." 9974 LET PAGE=II 9975 PRINT 9976 CLS 9977 PRINT AT I,IX;H$;PAGE,,,I$ 9978 PRINT """WCOD"" 9120 DECODE TABLE." 9979 PRINT """WSTD"" 9135 MNEMONICS." 9980 PRINT """SRCH"" 9705 BASIC CODE." 9981 PRINT """SEARCH"" 9450 ROM SPACE." 9982 PRINT """EDIT"" 9200 MACH CODE." 9983 PRINT "*""GOTO VLST"" CODES AS:"," :236:V:L:S:T: (5 BYTES)" 9984 PRINT "*""GOTO 9500"" CODES AS:"," :235:9:5:0:0:126:EXP:B4:B3:B2:B1:B0: (12 BYTES)" 9985 PRINT "* USING VARIABLES IN PLACE OF NUMBERS CAN SAVE MEMORY." 9986 PRINT "* USE:Z0,I,II,III,IV,FIV,VI,VII,VIII,IX,TEN,XX,XXX IN PLACE OF:0,1,2,3,4,5,6,7,8,9,10,20,30." 9987 PRINT "* LIST 9802 TO SEE." 9988 STOP 9989 GOTO HELP 9997 REM %M%/%L% %C%0%D%E% %T%E%M%P%L%A%T%E%S 9998 REM .........1.........2.........3.........4.........5.........6.........7.........8.........9.........0....... /.' 9999 REM .........1.........2.........3.........4.........5.........6.........7.........8.........9.........0.........1....... /.' ```