--- title: "Memory Monitor" id: 71291 type: "computer_media" slug: "memory-monitor" url: "http://localhost/computer_media/memory-monitor/" markdown_url: "http://localhost/computer_media/memory-monitor.md" published_at: "2026-09-02T07:11:25+00:00" modified_at: "2026-09-02T07:11:26+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/09/memory-monitor.png" excerpt: "Explore RAM one byte at a time with this interactive memory inspector — navigate forward, restart, print, or stop via a simple menu system." 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/" genre: - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Memory%20Monitor%20(198x)(-)(TS2068)(US)(Program).zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2026/09/memory-monitor.png" media_type_tags: "Utility" --- # Memory Monitor Memory Monitor is a utility program that displays the contents of sequential memory addresses starting from a user-specified location. Each entry is printed in two columns across the screen, showing the address and its PEEK value, with 11-character spacing between columns. After filling the screen or pressing “A”, the user is presented with a menu to continue from the current address, restart from a new address, send a hard copy to a printer, or stop the program. The columnar layout is managed by toggling the display column variable between 0 and 22 (then 33, which resets to 0) and incrementing the row counter accordingly. *** ### Program Structure The program is organized into three logical phases: address input (line `5`), the display loop (lines `7`–`40`), and a post-screen menu (lines `50`–`95`), with a clean `STOP` at line `100` and a `SAVE` at line `110`. 1. **Initialization** — Line `5` prompts for a starting address; line `7` resets column (`d`) and row (`c`) counters; line `10` clears the screen. 2. **Display loop** — Lines `12`–`40` print address/value pairs, advance screen position, and check for a full screen or keypress. 3. **Menu** — Line `50` presents four options; lines `60`–`95` branch on the user’s choice. ### Column Layout Logic The two-column layout is driven by the variable `d`, which holds the `PRINT AT` column position. The sequence is: - Line `30`: if `d <= 22`, add 11, moving from column 0 to column 11, then to 22. - Line `31`: if `d = 33` (i.e., 22 + 11 overshot the right edge), reset `d` to 0. - Line `33`: if `d` just reset to 0, increment the row counter `c`. This gives three display columns at positions 0, 11, and 22 — each entry consuming approximately 11 characters (“AAAAA = NNN”). The check at line `30` uses `<= 22`, so `d` passes through 0, 11, and 22 before triggering the reset at 33. ### Screen-Full Detection and Early Exit Line `34` checks whether the row counter `c` has reached 22, indicating a full screen, and branches to the menu at line `50`. Line `35` provides an early exit: pressing “a” or “A” during the loop also jumps to the menu, giving the user an escape without waiting for a complete screen. ### Menu Options | Key | Action | | --- | --- | | `c` | Clear screen, reset row/column, continue from current address | | `s` | Restart from a new starting address (line `5`) | | `h` | Send screen to printer via `COPY`, then return to menu | | `a` | Jump to `STOP` at line `100` | Unrecognized input falls through to line `95`, which loops back to the menu prompt. ### Bugs and Anomalies - **Column counter creep**: Line `30` uses `<= 22`, so `d` advances from 22 to 33 before the reset at line `31`. This is functionally correct but relies on the intermediate value of 33 being a reliable sentinel — if any future edit changes the spacing, the sentinel would need updating. - **Continue option resets position but not address**: When “c” is chosen (line `60`), `c` is reset to 0 but `d` is not explicitly reset to 0. Since line `7` is not revisited, `d` retains whatever value it had when the screen filled, potentially misaligning the first row of the next screen. However, since `d` is always left at 0 when `c` reaches 22 (due to the three-column cycle), in practice this may not manifest as a visible bug. - **No upper-bound address check**: The program does not guard against `PEEK`ing addresses outside valid RAM, which could produce unexpected results at the edges of the address space. - **`SAVE "MEMORY" LINE 0`**: `LINE 0` targets a non-existent line, so the program loads without auto-running, requiring a manual `RUN`. ## Source Code ``` 5 INPUT "ENTER STARTING MEMORY ADDRESS.";a 7 LET c=0:LET d=0 10 CLS 12 GO TO 20 15 LET a=a+1 20 PRINT AT c,d;a;" = "; PEEK a 30 IF d <=22 THEN LET d=d+11 31 IF d=33 THEN LET d=0 33 IF d=0 THEN LET c=c+1 34 IF c=22 THEN GO TO 50 35 IF INKEY$="a" OR INKEY$="A" THEN GO TO 50 40 GO TO 15 50 INPUT "CONT(C)STRT(S)COPY(H)STOP(A)";b$ 60 IF b$="c" THEN CLS :LET c=0:GO TO 15 70 IF b$="s" THEN GO TO 5 80 IF b$="h" THEN COPY :GO TO 50 90 IF b$="a" THEN GO TO 100 95 GO TO 50 100 STOP 110 SAVE "MEMORY" LINE 0 ```