--- title: "Relocate" type: "article" slug: "relocate" url: "http://localhost/article/relocate/" markdown_url: "http://localhost/article/relocate.md" published_at: "2022-10-07T12:25:41+00:00" modified_at: "2026-07-31T00:24:55+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Relocates a machine code program to new location in RAM. 1 REM THIS TAPE WAS DONATED BY TORONTO TIMEX SINCLAIR USER'S GROUP. 2 REM MODIFIED AND COPIED BY ALGIS E. GEDRIS DECEMBER 20, 1986 3 REM \"2068\" COMPUTER 9500 REM RELOCATE 9505 PRINT \"Note:- This program will relocate a machine code program to a new…" category: - name: "LISTing Newsletter" slug: "listing-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/listing-newsletter/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Machine language programming" slug: "machine-language" taxonomy: "post_tag" url: "http://localhost/tag/machine-language/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Algis Gedris" slug: "algis-gedris" taxonomy: "indiv" url: "http://localhost/indiv/algis-gedris/" publication_r: id: 38992 title: "LISTing Newsletter" type: "periodical" url: "http://localhost/periodical/listing-newsletter/" authors: "Algis Gedris" authors_r: - name: "Algis Gedris" slug: "algis-gedris" taxonomy: "indiv" url: "http://localhost/indiv/algis-gedris/" issues_articles: - id: 40153 title: "LISTing Newsletter January 1992" type: "issue" url: "http://localhost/issue/listing-newsletter-january-1992/" pages: "12" pubdate: "January 1992" archive_link: false --- # Relocate Relocates a machine code program to new location in RAM. ``` 1 REM THIS TAPE WAS DONATED BY TORONTO TIMEX SINCLAIR USER'S GROUP. 2 REM MODIFIED AND COPIED BY ALGIS E. GEDRIS DECEMBER 20, 1986 3 REM "2068" COMPUTER 9500 REM RELOCATE 9505 PRINT "Note:- This program will relocate a machine code program to a new location in RAM. Since it is in BASIC, it i s rather slow. "''"Follow the instructions." 9510 INPUT "Enter new start address",ns 9520 INPUT "Enter old start address",OS 9530 INPUT "Enter old end address",oe 9540 LET a=ns-os 9550 FOR i=os TO oe 9560 LET v=PEEK (i+1)+256*PEEK (i+2) 9570 IF (PEEK i=17 OR PEEK i=33 OR PEEK i=34 OR PEEK i=42 OR PEEK i=50 OR PEEK i=83 OR PEEK i=91 OR PEEK i=115 OR PEEK i=194 OR PEEK i=195 OR PEEK i=196 OR PEEK i=202 OR PEEK i=204 OR PEEK i=205 OR PEEK i=210 OR PEEK i=212 OR PEEK i=218 OR PEEK i=220 OR PEEK i=218 OR PEEK i=220 OR PEEK i=242) 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 ((vta)/256): LET i=i+2 : GO TO 9590 9580 POKE i+a, PEEK i 9590 NEXT i: CLEAR (ns-1) 9595 STOP 9998 SAVE "RELOC" LINE 9500 ```