[Coco] Intercepting commands like POKE?

Jim McClanahan jim30109 at gmail.com
Thu Jan 4 12:31:43 EST 2024


I think there might be a way to expand the token table in 6809 BASIC. There
wasn't an easy way in 6502 BASIC that I'm aware of. (When it was developed,
it was almost always in ROM. Even Commodore just provided a bunch of PEEKs
and POKEs to handle their advanced graphic features on the VIC-20 and
Commodore 64.) Ohio Scientific used the ! prefix for DOS commands from
their BASIC in OS-65D and I just used that same character for things I did
with other machines because I knew it worked. If you are just checking for
one character or one or two tokens, speed probably is okay. If you wanted
to add a dozen commands you'd probably be ahead to figure out if there was
a way to expand the token table. I'm not sure if adding it to the token
table automatically takes care of everything when the line is first entered
and parsed--I would tend to think it does.

I think there are extensions in Apple BASIC that use something like a $02
token to indicate a command from an alternate token table, but that is just
a vague memory and I could well be wrong. Both Apple and Commodore had
pretty good deals with Microsoft as long as they didn't have to ask for any
object code changes, so both found ways to work around the limitations for
a long time.

Thanks,
Jim W4JBM

On Thu, Jan 4, 2024 at 11:03 AM Allen Huffman <alsplace at pobox.com> wrote:

> > On Jan 4, 2024, at 9:49 AM, Jim McClanahan <jim30109 at gmail.com> wrote:
> >
> > I'm more familiar with MS's 6502 BASIC and it has been a while since I
> dug into either, but there is a routine that gets called each time BASIC is
> ready to fetch the next command down in Page Zero. (In Extended BASIC, it
> looks like it is at $009F.)
>
> I see — “This routine picks up the next input character from BASIC.”
>
> Since this is in RAM, it could be patched to go to new code that either
> does something with the token, or ignored it.
>
> I suppose this is how folks add new commands? Or does the MS tokenizer
> have some provision for extending the token table? I suppose it must, since
> Extended and Disk BASIC both add more.
>
>                 — A
>
>
>


More information about the Coco mailing list