[Coco] Intercepting commands like POKE?
Ciaran Anscomb
cocomalt at 6809.org.uk
Thu Jan 4 16:26:49 EST 2024
Allen Huffman wrote:
> > On Jan 4, 2024, at 2:10 PM, Ciaran Anscomb via Coco
> > <coco at maltedmedia.com> wrote:
> >
> > Bit wasteful but you could also copy/modify the dispatch table and
> > modify the commands stub to point to your copy...
>
> Copy what is there in to ram, modify the RAM table to jmp to the RAM
> copy, and modify?
Indeed.
So [$0123] (in stub 0) points to the dispatch table - in cb 1.3 that's
$AB67. There are 36 dispatch addresses, so 72 bytes - copy them somewhere
and adjust $0123 to point there instead and I guess you can then intercept
what you want? PRINT is the 8th entry, POKE is the 19th.
I mean I've not tried any of this, but it should work. In theory $120
is supposed to hold the number of tokens in the dispatch table, but the
value there seems way too high. Maybe Dragon BASIC does this a little
differently...
..ciaran
More information about the Coco
mailing list