--- title: "ML Program Backup" id: 79563 type: "computer_media" slug: "ml-program-backup" url: "http://localhost/computer_media/ml-program-backup/" markdown_url: "http://localhost/computer_media/ml-program-backup.md" published_at: "2026-11-22T19:36:03+00:00" modified_at: "2026-11-22T19:36:03+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-1.png" excerpt: "Backs up machine code held above RAMTOP on the ZX81 or TS1000." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Jack Ryan" slug: "jack-ryan" taxonomy: "indiv" url: "http://localhost/indiv/jack-ryan/" genre: - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" programmers: - name: "Jack Ryan" slug: "jack-ryan" taxonomy: "indiv" url: "http://localhost/indiv/jack-ryan/" download_url: "https://archive.org/download/timex-sinclair-software-archive/ML%20Program%20Backup%20%281983%29%28Ryan%2C%20Jack%29%28TS1000%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-1.png" - url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-2.png" - url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-3.png" - url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-4.png" - url: "http://localhost/wp-content/uploads/2026/11/ml-program-backup-5.png" article_media: - id: 45797 title: "Making Backups for Machine Language Tapes" type: "article" url: "http://localhost/article/making-backups-for-machine-language-tapes-2/" - id: 24462 title: "Making Backups for Machine Language Tapes" type: "article" url: "http://localhost/article/making-backups-for-machine-language-tapes/" media_type_tags: "Utility" license: false --- # ML Program Backup 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](https://timexsinclair.com/article/making-backups-for-machine-language-tapes/). Published in LISTing February 1989 ([Making Backups for Machine Language Tapes](https://timexsinclair.com/article/making-backups-for-machine-language-tapes-2/)). ## 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 0330 ```