THIS COPIER for the 16K ZX-81 will duplicate any program up to 15K long including those which cannot be Saved by the normal routine.
The program is a modified version of the ZX-81 Load and Save routines and comprises 128 bytes of machine code and a supportiing “no-frills” Basic program. It fits into 1K with a little to spare.
The program to be copied is loaded above RAMtop, from where it can be saved as required.
Before typing in anything,
POKE 16389,72
and New. This sets RAMtop to 18432, which allows sufficient space to enter and edit the program, but is low enough to collapse the Display File. If this is not done the expanded Display File will be saved with your completed program, making it too long to Load into the 1K finally allocated for it.
Load or type in your favourite hex loader and create a Line 1 Rem statement with 128 characters of your choice.
If your hex loader starts at Line 10,
POKE 16419,10
If not create a dummy Line 10 — 10 Rem will do — and then
POKE 16419,10
Load the machine code — listing 1 — into the Rem statement and check it. Note that the first two bytes of machine code prevent the rest of the machine code listing in the Rem statement.
When the machine code is loaded in,
POKE 16510,10
The Rem statement should now be Line 0. This cannot be accidently deleted.
Now delete all lines excepting Line 0 and 10, and enter the remainder of the program — listing 2 — overwriting the previous line 10. Save the program a couple of times before proceeding.
The program in the computer cannot be Run in its present state because RAMtop is too high.
It is necessary then to clear the program from memory, reset RAMtop to 17408 and reload the program.
I prefer to set RAMtop using the short program in listing 3.
I keep this on tape in front of the Copy program with approx. 10 secs of tape running between them.
Whichever you prefer, enter New. Set RAMtop using the RAMtop program or
POKE 16389,68
Now reload Copy and run it.
The first prompt asks for the name of the program to be copied. Note that the name is not used to find the named program on the tape.
After entering the name and Newline, the next prompt appears, “Start Tape the New Line”.
Audibly monitor the program to be copied and locate the start of the 5 second silent period which precedes the program proper. Stop the tape there. Then with the recorder set for Load, start the tape and press Newline immediately.
When the program is Loaded, the prompt “Loaded-Start Blank Tape then Newline to Save” appears. Place a clean tape in the recorder set for Save, run tape and press Newline.
When the program has Saved, the option to take further copies is presented. The Break key may be used to abort both Load and Save routines.
After Break, Run will return you to the Load routine. Goto 180 will return you to the Save routine.
LIST 1 HEX DUMP
16514: 76 76 21 00 44 0E 01 3E 16522: 7F DB FE D3 FF 1F D0 17 16530: 17 38 02 18 F2 1E 94 06 16538: 1A 1D DB FE 17 CB 7B 78 16546: 38 F5 10 F5 20 04 FE 56 16554: 30 DD 3F CB 11 30 D8 71 16562: CD B7 40 18 D0 23 EB 2A 16570: 00 00 01 00 00 09 37 ED 16578: 52 E8 D0 E1 C9 11 CB 12 16586: CD 46 0F 30 27 10 FE 18 16594: 7A B3 20 F4 21 00 44 CD 16602: E1 40 CD B7 40 18 F8 5E 16610: 37 CB 13 C8 9F E6 05 C6 16618: 04 4F D3 FF 06 23 10 FE 16626: CD 46 0F D0 06 1E 10 FE 16634: 0D 20 EF A7 10 FD 18 E1
LIST 2 “COPY”
0 REM -128 CHARACTERS-
10 PRINT "ENTER NAME OF PROG."
20 PRINT
30 INPUT A$
40 LET X=17419+LEN A$
50 POKE X+1,69
60 LET Y=X-16404
70 RAND X
80 POKE 16570,PEEK 16434
90 POKE 16571,PEEK 16435
100 RAND Y
110 POKE 16573,PEEK 16434
120 POKE 16574,PEEK 16435
130 PRINT "START TAPE THEN N/L"
140 INPUT D$
150 CLS
160 FAST
170 RAND USR 16516
180 PRINT "LOADED",,"START BLANK TAPE THEN N/L TO SAVE"
190 INPUT D$
200 RAND USR 16583
210 CLS
220 PRINT "DONE:-ANOTHER COPY ?"
230 INPUT D$
240 IF D$="Y" THEN GOTO 180
250 SLOW
LIST 3 “RAMTOP”
5 REM "RAMTOP"
10 RAND 17408
20 POKE 16388,PEEK 16434
30 POKE 16389,PEEK 16435
40 PRINT "RAMTOP NOW SET TO ";PEEK 16388+256*PEEK 16389
50 PRINT AT 2,0;" "
60 FOR N=1 TO 6
70 NEXT N
80 PRINT AT 2,0;"STOP TAPE"
90 FOR N=1 TO 6
100 NEXT N
110 PRINT AT 4,0;"PRESS ANY KEY TO CONTINUE",,,"THEN LOAD ""COPY"""
120 IF INKEY$="" THEN GOTO 50
130 NEW
140 SAVE "RAMTOP"
150 GOTO 10
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.