Relocate a machine code program to a new location in RAM.
Appears on
Library tape of the Indiana Sinclair Timex User’s Group.
Source Code
9900 REM THIS TAPE WAS DONATED BY TORONTO TIMEX SINCLAIR USER'S GROUP. Modified & copied by A. E. Gedris for the "2068" computer 9905 REM RELOCATE 9910 CLS : PRINT "Note:- This program will"'"relocate a machine code program to a new location in RAM. Since it is in BASIC, it is rather slow."''"Follow the instructions." 9915 INPUT "Enter new start address"'ns'"Enter old start address"'os'"Enter old end address",oe 9920 LET a=ns-os 9925 FOR i=os TO oe 9930 LET v=PEEK (i+1)+256*PEEK (i+2) 9935 LET ii=PEEK i: FOR f=1 TO 19: READ iii: DATA 17,33,34,42,50,83,91,115,194,195,196,202,204,205,210,212,218,220,242 9940 IF iii=ii AND v>=os AND v<=oe THEN POKE i+a,PEEK i: POKE i+1+a,(v+a)-256*INT ((v+a)/256): POKE i+a+2,INT ((v+a)/256): LET i=i+2: GO TO 9955 9945 NEXT f 9950 POKE i+a,PEEK i 9955 NEXT i:: CLEAR (ns-1) 9960 STOP 9965 SAVE "RELOCATE" LINE 9905