Makes a backup of machine code that sits above RAMTOP: it copies the bytes into an array, which is saved with the program and puts them back when loaded.
Set RAMTOP and load the machine code first, then load and RUN this program and give the two numbers POKEd into 16388 and 16389 and the normal RAMTOP. At 9/310 start the recorder and enter GOTO 370. The backup runs by itself when loaded; set RAMTOP before loading it. It needs five bytes of working memory for each byte copied: 100 bytes fit in 2K, the article’s 1024 bytes need 16K, and 1K is too small for the program.
Reprinted from SYNC, January/February 1983.
Published in LISTing February 1989 (Making Backups for Machine Language Tapes).
Source Code
40 FAST
50 PRINT TAB 7;"ML PROGRAM BACKUP"
60 PRINT
70 REM "ENTER PARAMETERS FOR YOUR ML PROGRAM"
80 PRINT "ENTER THE NUMBER TO BE POKED"
90 PRINT TAB 10;"INTO 16388",,
100 PRINT TAB 7;"IF NONE, ENTER 0"
110 INPUT A
120 CLS
130 PRINT "ENTER THE NUMBER TO BE POKED"
140 PRINT TAB 10;"INTO 16389",,
150 PRINT TAB 7;"IF NONE, ENTER 0"
160 INPUT B
170 CLS
180 PRINT "ENTER YOUR NORMAL RAMTOP"
190 PRINT "(17408 FOR 1K, 32768 FOR 16K)"
200 INPUT R
210 CLS
220 REM "C = NUMBER OF BYTES PROTECTED"
230 LET C=R-(A+256*B)
240 REM "D = LAST BYTE BEFORE NEW RAMTOP"
250 LET D=(A+256*B)-1
260 REM "STORE MACHINE LANGUAGE IN E"
270 DIM E(C)
280 FOR N=1 TO C
290 LET E(N)=PEEK (D+N)
300 NEXT N
310 STOP
320 REM "PUT ML ABOVE RAMTOP"
330 FOR N=1 TO C
340 POKE (D+N),E(N)
350 NEXT N
360 STOP
370 SAVE "P"
380 GOTO 0330Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.




