(1) Tokenize the new keywords while parsing a BASIC input line (vector @ $0304)
(2) Detokenize the new keywords during LIST ($0306)
(3) Execute the code associated with each new keyword ($0308)
So, I'm looking at the ROM listing, working on Step 1. I figured I could look for my own keywords first and create my own tokens ($D0 and up), then pass execution along to the original $0304 vector ($C57C). As a quick-and-dirty* proof-of-concept, I redirected $0304 to this.
Code: Select all
ldx $7a
@1 lda $0200,x
cmp #"Z"
bne @2
lda #$d0
sta $0200,x
@2 inx
bpl @1
jmp $c57c
It seems like I'll need to completely re-implement the tokenization routine, rather than simply patch into it. Is this a correct assessment?
I thought there was a section in one of the Compute! Nth Book of VIC books, but I didn't find it. Maybe I misremember, and I should look at the Books of C64...
Once I get this part figured out, I'll probably use this same topic for the other two steps as I work through my BASIC extension.
________________
* For example, don't care about quotes here