Some hobbyists have trouble keeping track of parts. This program, written for the CD4000 series of ICs and using the 4K ZX80 ROM and at least 2K RAM, can be adapted for any series of things following consecutive numbers. It is beneficial to keep two lists for each series–one of those in stock and one of those used in circuits for emergency substitutions.
The first part of this program is also useful for setting aside memory for machine code routines.
Enter line 1:
1 REM 480 BYTES FOR DATA 0123456789012345678901234567890
Then type EDIT, RUBOUT, 2, NEWLINE. This duplicates line 1 as line 2 as saves lengthy typing. Repeat procedure for line 3.
Next POKE out the newline characters at the ends of lines 1&2, combining all three into one long REM statement for the data:
POKE 16477,61
POKE 16531,61
Then repeat the duplicating procedure:
EDIT, RUBOUT, 2, NEWLINE EDIT, RUBOUT, 3, NEWLINE
Set the memory behind the first REM to zeros:
10 LET A=16426
20 FOR B=0 TO 480
25 POKE A+B,0
30 NEXT B RUN
This leaves 1 REM on the screen and about 2/3 blank, with 90 above the E in line 10. Line 1 now has 482 data spaces available if nothing larger than 255 is entered. Do not enter quantities greater than 255. Each quantity is held in 1 byte, with a 255 maximum.
Now enter the following program. Note that line 25 is changed. After pressing RUN, the screen takes at least 5 seconds to display.
10 LET A=16426
15 PRINT,"CURRENT LIST"
20 FOR B=0 TO 480
25 IF PEEK(A+B)>0 THEN GO SUB 300
27 IF PEEK(A+B)>0 THEN PRINT,
30 NEXT B
40 PRINT
50 PRINT "FOR CMOS IC S"
60 PRINT "INPUT THE NUMBERS AFTER CD4--"
70 INPUT B
80 IF B>480 THEN PRINT "OVERRANGE"
85 PRINT
90 IF B>480 THEN GO TO 60
100 CLS
110 GO SUB 300
130 PRINT " IN STOCK"
140 PRINT "LIST OR CHANGE? L/C"
150 INPUT C$
155 CLS
160 IF C$="" THEN GO TO 45
165 IF C$="L" THEN GO TO 10
170 PRINT "TO WHAT?"
180 INPUT D
190 POKE (A+B),D
195 GO SUB 300
197 PRINT
200 GO TO 45
300 PRINT "CD4";
305 IF B<100 THEN PRINT "0";
310 IF B<10 THEN PRINT "0";
320 PRINT B,
330 PRINT PEEK(A+B);
350 RETURN
390 REM CMOS IC LIST 5/1/82
Syntactic Sum: -30692, 4K
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.