Moves machine code from one place in memory to another. GOTO 20 asks for the first and last addresses of the code, copies the bytes into a string (printing each one), and stops; GOTO 130 then asks for the new address and POKEs the bytes there. Because the code is held in E$, you can SAVE the program between the two steps and move the code later.
Lines 10-16 print the instructions: delete lines 105 and 175 to stop the bytes being printed and speed it up (lines 205 and 275 keep copies to put back). Line 300 (RAND USR 14336) is the Larken ZX81 disk save and needs the Larken ROM; GOTO 310 for a tape save only reaches a REM and restarts the program, so SAVE it yourself. No author is printed; this is Listing 3 (MLCOPY.B1) of the EPROM board article.
Published in Sinc-Link May-June 1988 (ZX81 EPROM Board).
Source Code
10 PRINT "TO PRINT ML BEING COPIED/POKED."
11 PRINT "ENTER C:TO SPEEDUP.DELETE 105,"
12 PRINT "175.SEE PROGARM END TO REPLACE"
13 PRINT "AFTER ML IS COPIED.USE GOTO 130"
14 PRINT "TO PLACE ML WHERE DESIRED.IF THE"
15 PRINT "DELETIONS WERE MADE.USE GOTO20"
16 STOP
20 PRINT "INPUT FIRST ML ADDRESS TO COPY"
30 INPUT A
35 PRINT A
36 PRINT
40 PRINT "INPUT LAST ML ADDRESS TO COPY"
50 INPUT B
55 PRINT B
56 PRINT
60 LET C=(B-A)+1
65 DIM E$(C)
70 PRINT "BYTES TO BE COPIED=";C
72 PAUSE 100
75 CLS
76 FAST
80 LET A=A-1
90 FOR N=1 TO C
100 LET E$(N)=CHR$ PEEK (A+N)
105 PRINT CODE E$(N);" ";
110 NEXT N
112 PRINT
113 PRINT
114 SLOW
115 PRINT "TRANSFER TO STRING COMPLETE"
116 PRINT "GOTO 310 TO TAPE SAVE:GOTO 300"
117 PRINT "FOR DISK:GOTO 130 TO MOVE ML"
120 STOP
125 PRINT
130 PRINT "FIRST ML ADDRESS OF DESTINATION"
131 PRINT "IT IS NOW= ";A+1
140 INPUT A
145 CLS
146 FAST
150 LET A=A-1
160 FOR N=1 TO C
170 POKE (A+N),CODE E$(N)
175 PRINT PEEK (A+N);" ";
180 NEXT N
184 PRINT
185 PRINT
186 PRINT "ML MOVED TO DESIRED LOCATION"
187 SLOW
190 STOP
200 REM "LINES 105,175 ARE BELOW SO THAT"
201 PRINT "THEY MAY BE RE-ENTERED IF WISHED"
205 PRINT CODE E$(N);" ";
275 PRINT PEEK (A+N);" ";
300 RAND USR 14336
310 REM SAVE"MLCOPY.B1"
320 GOTO 1Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.


