Date : Thu, 10 Jun 1993 13:34:08 BST
From : ajcd@...
Subject: m/c optimisations
From: I Stephenson <ian@...>
>Performance isn't so bad as we can write the interpretter as
>.loop
>LDX pc
>INC pc
>JSR (table,x) \I think this is a bad instruction!
>JMP loop
JSR (table,X) is indeed a non-existant instruction. On the 65C02 there is a
JMP (abs,X) instruction, so you could write
...
JSR dispatch
...
.dispatch JMP (table,X)
On the 6502, you have to do something like:
.dispatch LDA low,X
STA addr
LDA high,X
STA addr
JMP (addr)
a.