Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 4
    You missed an important step: poking characters into the keyboard buffer (poke 198 to set the count, and 631-640 to set the actual characters). Code would typically print the code two lines from the top of the screen, followed by a "RUN [someLine]", and then poke enough returns into the buffer for all the lines and the RUN, then home the cursor and exit. Commented Jun 8, 2019 at 17:30
  • It would also have been possible, and not even very difficult, to use poke to modify a program that was running, provided that before creating any variables one would need to keep, one adjusted the end-of-program address as needed and then did a CLR. Commented Jun 8, 2019 at 17:32
  • 4
    Using POKE is explicitly excluded in the question. Commented Jun 8, 2019 at 19:35
  • @supercat I wasn't really going for a complete 'how-to' tutorial, merely trying to outline the basic (hah!) principle behind the technique. Commented Jun 9, 2019 at 19:35
  • 2
    @berendi: Outputting to the screen wouldn't achieve automatic self-modification unless one POKEs keystrokes into the buffer as mentioned. Commented Jun 9, 2019 at 22:23