This is a program to relocate bytes from one address to another. Specifically a machine code from a lower address to another higher address.
Content
Source Code
1 REM This is a program to relocate bytes from one address to another. Specifically a machine code from a lower address to another higher address.
2 REM This is a machine code program to do that. I am setting it up to locate this code at 64700. The transfer address will be variable but generally at 60000.
3 REM To use this program you enter the information asked for. When the program is completed you can then delete this loader with NEW.
4 REM You then load in the program you want relocated, key in RANDOMIZE USR 64700 and your program will be relocated above RAMTOP.
5 GO SUB 1000
10 LET s=64700
20 RESTORE : FOR j=0 TO 11: READ a: POKE s+j,a: NEXT j
40 DATA 17,lfrom,hfrom,33,lto,hto,1,lbytes,hbytes,237,176,201
50 RANDOMIZE USR 64700
60 STOP
1000 INPUT "Enter address to be moved from ";from
1010 LET hfrom=INT (from/256)
1020 LET lfrom=from-(hfrom*256)
1030 INPUT "Enter address to be moved to ";to
1040 LET hto=INT (to/256)
1050 LET lto=to-(hto*256)
1060 INPUT "Enter number of bytes to be transferred ";bytes
1070 LET hbytes=INT (bytes/256)
1080 LET lbytes=bytes-(hbytes*256)
1090 POKE 23730,(lto-1): POKE 23731,hto: IF (lto-1)<0 THEN POKE 23731,(hto-1)
1100 RETURN
1200 STOP
9000 SAVE "Relocate": PRINT "Rewind & key ENTER to verify.": PAUSE 0: VERIFY "Relocate"