--- title: "OVERS 1" id: 55860 type: "computer_media" slug: "overs-1" url: "http://localhost/computer_media/overs-1/" markdown_url: "http://localhost/computer_media/overs-1.md" published_at: "2024-07-06T17:27:01+00:00" modified_at: "2026-03-30T21:44:23+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "See what happens when two characters share the same screen cell — this interactive tool visually demonstrates XOR overlay printing with instant labeled results." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Roger Valentine" slug: "roger-valentine" taxonomy: "indiv" url: "http://localhost/indiv/roger-valentine/" genre: - name: "Demo" slug: "demo" taxonomy: "genre" url: "http://localhost/type/demo/" media_contents: - id: 55879 title: "ISTUG Public Domain Library 7" type: "computer_media" url: "http://localhost/computer_media/istug-public-domain-library-7/" media_type: "Program" programmers: - name: "Roger Valentine" slug: "roger-valentine" taxonomy: "indiv" url: "http://localhost/indiv/roger-valentine/" download_url: "https://archive.org/download/timex-sinclair-software-archive/OVERS%201%20%28198x%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/07/SCR-20260329-odzj.png" related_content: - id: 20956 title: "The Timex Sinclair 2068: what can you do with it?" type: "book" url: "http://localhost/book/the-timex-sinclair-2068-what-can-you-do-with-it/" media_type_tags: "Demo" --- # OVERS 1 This program demonstrates the OVER 1 print attribute by overlaying two user-supplied characters on the same screen position using a CHR$ 8 (backspace/cursor-left) control code to reposition the cursor. The user enters any two characters; the first is printed, the cursor backs up one space, OVER 1 is engaged, and the second character is XOR-composited on top of the first. The result and the individual characters are then displayed as a labeled equation. Input validation checks both for a space (stop condition) and for exactly two characters before proceeding. From page 70 of [Roger Valentine’s The Timex Sinclair 2068](http://localhost/book/the-timex-sinclair-2068-what-can-you-do-with-it/). *** ## Program Analysis ### Program Structure The program is a short interactive loop with a title display, input, validation, and a single output line before cycling back. There is no initialization beyond the title print at line `10`. | Line | Purpose | | --- | --- | | `10` | Print title banner (uses literal embedded quotes) | | `20` | Prompt user for a two-character string | | `30` | Stop if input is a space (CHR$ 32) | | `40` | Validate input length; re-prompt if not exactly 2 | | `50` | Demonstrate OVER 1 overlay and print labeled result | | `60` | Loop back to prompt | ### The OVER 1 Demonstration Technique Line `50` is the heart of the program. It performs the following sequence in a single `PRINT` statement: 1. Print `q$(1)` — the first character, advancing the cursor one cell right. 2. Print `CHR$ 8` — move the cursor one cell left, back over the printed character. 3. Activate `OVER 1` — switch to XOR pixel-compositing mode. 4. Print `q$(2)` — the second character is XOR-overlaid onto the first in the same cell. 5. Print the remainder of the line as a plain-text label showing the two source characters. `CHR$ 8` is used instead of `TAB` or `AT` so the overlay demo fits naturally within a streaming `PRINT` statement without needing to know the current cursor column. `OVER 1` remains in effect only for the immediately following item (`q$(2)`); subsequent items in the same statement revert to normal because no explicit `OVER 0` is needed — the attribute is item-scoped within a `PRINT` statement. ### Input Validation Two guard conditions protect the main display line. Line `30` treats a lone space as a sentinel exit value via `CHR$ 32`, which avoids the user needing to type a command to quit. Line `40` rejects any input whose length differs from 2, looping back to the prompt with `GO TO 20`. Together, these ensure `q$(1)` and `q$(2)` are always safe to subscript at line `50`. ### Notable BASIC Idioms - Embedded double-quotes in the title string at line `10` are represented by doubled `""` pairs inside the string literal, which is standard Sinclair BASIC string quoting. - The `INPUT` prompt at line `20` uses the inline string form, combining the prompt and the variable assignment in one statement. - The program relies on the fact that `OVER` (and other print attributes like `INK`, `PAPER`) placed inline in a `PRINT` statement act as temporary modifiers scoped to the next printable item only. ### Bugs and Anomalies There are no functional bugs. One minor behavioral note: if the user enters exactly one character followed by pressing Enter, the `LEN` check at line `40` correctly rejects it. However, if `INPUT` is given an empty string (just Enter), `q$` will be empty, the `CHR$ 32` check will fail, and the `LEN` check will also catch it, so the loop still handles this gracefully. ## Source Code ``` 10 PRINT "EXPERIMENTS WITH "" OVER """'' 20 INPUT "Enter any 2 characters (or space to stop) ";q$ 30 IF q$=CHR$ 32 THEN STOP 40 IF LEN q$<>2 THEN GO TO 20 50 PRINT q$(1);CHR$ 8; OVER 1;q$(2);" = ";q$(1);" OVER ";q$(2) 60 GO TO 20 9998 SAVE "OVERS 1" LINE 0 ```