--- title: "Screen Store Program for TS2068" type: "article" slug: "screen-store-program-for-ts2068" url: "http://localhost/article/screen-store-program-for-ts2068/" markdown_url: "http://localhost/article/screen-store-program-for-ts2068.md" published_at: "2022-10-07T12:24:17+00:00" modified_at: "2026-08-01T12:20:01+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Screen Store Program for TS2068 Here's a piece of a program that may interest some of your readers. It's designed to store the screen contents of the TS 2068. The cute thing about the program is that it stores the machine code routine and the data together in one string (A$). With this approach you…" category: - name: "ISTUG Newsletter" slug: "istug-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/istug-newsletter/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - 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: "John (Basil) Wentworth" slug: "john-basil-wentworth" taxonomy: "indiv" url: "http://localhost/indiv/john-basil-wentworth/" publication_r: id: 39269 title: "ISTUG Newsletter" type: "periodical" url: "http://localhost/periodical/istug-newsletter/" authors: "John (Basil) Wentworth" authors_r: - name: "John (Basil) Wentworth" slug: "john-basil-wentworth" taxonomy: "indiv" url: "http://localhost/indiv/john-basil-wentworth/" issues_articles: - id: 39825 title: "ISTUG Newsletter Nov 1986" type: "issue" url: "http://localhost/issue/istug-newsletter-nov-1986/" pages: "2-3" pubdate: "November 1986" archive_link: false --- # Screen Store Program for TS2068 Here’s a piece of a program that may interest some of your readers. It’s designed to store the screen contents of the TS 2068. The cute thing about the program is that it stores the machine code routine and the data together in one string (A$). With this approach you don’t have to mess around with RAMTOP, or separate M/C SAVEs. What you do have to be careful about is that you DIMension A$ the first thing, and that you do not reDIMension it. It’s OK to change the contents of the string—in fact, that’s what the program does. But the location of the string, which is established when it is DIMensioned, must remain as unmoved as the tree that’s standing by the water. Of course, you must not monkey around with the first 31 bytes of it, either. This program should be SAVEd as: `SAVE "program" LINE 9910`. #### BASIC Listing ``` 9900 DATA 197,225,1,35,0,9,235 9901 DATA 33,0,64,1,0,27,237,176,201 9902 DATA 197,225,1,19,0,9,1,0,27 9903 DATA 17,0,64,237,176,201 9910 CLEAR : DIM A$(6950) 9915 RESTORE 9920 FOR F=1 TO 31 9925 READ A 9930 LET A$(F)=CHR$ A 9935 NEXT F 9940 LET store=9960: LET recall=9980 9959 STOP 9960 REM Store 9970 RANDOMIZE USR (PEEK 23627+256*PEEK 23628+6): RETURN 9980 REM Recall 9990 RANDOMIZE USR (PEEK 23627+256*PEEK 23628+22): RETURN ``` #### Machine Code Listing ``` ; --------------------------------------------------------------------------- ; Screen Store Program for TS2068 --- Basil Wentworth ; Relocatable: the routine is copied into a BASIC string, A$, and computes ; its own run-time address from A$'s location. Offsets below are relative ; to byte 1 of A$ (= offset 0). Store begins at offset $00; Recall at $10. ; --------------------------------------------------------------------------- ORG 0 STORE: PUSH BC ; BC holds the USR number POP HL ; HL now holds it LD BC,35 ADD HL,BC ; HL holds the address of A$(35) EX DE,HL ; DE now holds it [1] LD HL,16384 ; address of screen data LD BC,6912 ; number of bytes of screen data LDIR ; copy (HL) to (DE), BC bytes RET RECALL: PUSH BC ; BC holds the USR number POP HL ; HL now holds it LD BC,19 ADD HL,BC ; HL holds the address of A$(19) [2] LD BC,6912 LD DE,16384 ; as above LDIR RET ```