MCEDIT

This file is part of CATS Library Tape 3, and Long Island Sinclair Timex (LIST) User Group Library Tape #2.2. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 2068

MCEDIT is a simple machine code editor that allows the user to inspect and modify memory contents one byte at a time, starting from a user-specified address up to address 65367. For each address, it displays the current byte value and prompts the user to enter a new value or press Enter to leave it unchanged. If a new value is entered, it is converted with VAL and POKEd into memory, then the same address is redisplayed so the change can be confirmed before advancing. The upper bound of 65367 is likely chosen to stay within the usable RAM area below system variables or the display file on the target system.


Program Analysis

Program Structure

The program is a minimal five-line utility with a straightforward linear flow. It collects a starting address, then iterates through memory from that address to a fixed upper limit, displaying and optionally modifying each byte.

LinePurpose
2–4REM header comments identifying the program as MCEDIT
10Prompts the user for the starting address, stored in A
20Begins a FOR loop from A to 65367
30Displays the current address I and its byte value via PEEK I
40Prompts for a replacement value; POKEs if non-empty, then re-displays
50Advances to the next address

Key BASIC Idioms

  • IF C$<>"" THEN POKE I,VAL C$: GO TO 30 — A single-line conditional that handles the edit-or-skip decision. An empty Enter press causes execution to fall through to NEXT I, advancing to the next address.
  • The GO TO 30 after a successful POKE causes the same address to be redisplayed, providing immediate confirmation of the written value before moving on.
  • VAL C$ converts the user’s string input to a numeric byte value, supporting decimal entry.
  • TAB 7 in the PRINT statement provides simple column alignment between the address and byte value.

Notable Techniques

The upper loop bound of 65367 is a specific value rather than 65535, suggesting it was chosen deliberately to avoid overwriting critical system areas near the top of the 64K address space. The editor is non-destructive by default: pressing Enter without typing anything skips the current byte entirely, making it safe to browse memory without accidental modification.

Bugs and Anomalies

  • No input validation is performed on C$. Entering a value greater than 255 or a non-numeric string will cause a BASIC error when VAL C$ or POKE is evaluated.
  • The starting address A is not validated, so entering a value greater than 65367 will cause the FOR loop to execute zero iterations and the program will terminate immediately.
  • There is no way to move backwards to a previous address; the editor is strictly forward-only.

Content

Appears On

Balance your checkbook, decode cryptograms, or trace your BASIC program's execution path — Tape 3 is where serious productivity meets hands-on programming. Highlights include a word processor, a flat-file database, machine code loaders, and a complete darkroom formulary.
A focused supplement to the LIST library — play 3D Tic-Tac-Toe with three difficulty levels, design smooth curves with an interactive Bézier tool, and inspect or load machine code byte by byte.

Related Products

Related Articles

Related Content

Image Gallery

Source Code

    2 REM **************************
    3 REM MCEDIT
    4 REM **************************
   10 INPUT "ENTER START ADDR OF CHNGS: ";A
   20 FOR I=A TO 65367
   30 PRINT I;TAB 7;PEEK I
   40 INPUT "ENTER CHANGE ELSE C/R";C$: IF C$<>"" THEN POKE I,VAL C$: GO TO 30
   50 NEXT I

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top