top | item 42396870

(no title)

ataylor284_ | 1 year ago

One of the great things about C64 BASIC and similar MS BASIC derivatives is it's extensibility. It defines a bunch of pointers, including $0033 this article uses, that control the memory layout. Manipulating them carefully allows you to free up blocks of memory that BASIC won't trash. Or deliberately "trash" for hacks like this.

On top of that, a handful of key internal BASIC routines are called indirectly through pointers. BASIC itself is in ROM and more or less immutable, but by redirecting those pointers you can have it call out to new code in RAM.

discuss

order

erwincoumans|1 year ago

You can copy C64 Basic to its underlying RAM (starting at $A000) and disable the ROM. Then it is mutable. https://www.lemon64.com/forum/viewtopic.php?t=69655

fastjack42|1 year ago

That was our favourite trick. Copying BASIC ROM to the RAM below and then changing "ERROR" to "TERROR". My 13 year old self was always amused by:

?SYNTAX TERROR