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.
| Line | Purpose |
|---|---|
2–4 | REM header comments identifying the program as MCEDIT |
10 | Prompts the user for the starting address, stored in A |
20 | Begins a FOR loop from A to 65367 |
30 | Displays the current address I and its byte value via PEEK I |
40 | Prompts for a replacement value; POKEs if non-empty, then re-displays |
50 | Advances 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 toNEXT I, advancing to the next address.- The
GO TO 30after 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 7in 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 whenVAL C$orPOKEis evaluated. - The starting address
Ais not validated, so entering a value greater than 65367 will cause theFORloop 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
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.
