??? 09/20/07 16:09 Modified: 09/20/07 16:13 Read: times |
#144832 - I can\'t find my old, (t)rusty 65C02 cheatsheet... Responding to: ???'s previous message |
Richard Erlacher said:
Back in the days of microprocessors, I used a 65C02 to do this in terminals and link encryptors. From there, I loaded an index (probably X) with the port content and used a JMP @TABLE,X which is somewhat more convenient than using the accumulator, since you could then pass a parameter, if necessary, in A without disturbing anything. ... but looked it up elsewhere, and there is no indexed indirect jump; just an absolute indirect - JMP (16-bit address). The usual trick was to place the table at a 256-byte boundary and load only the low byte of the address-holding position. But, it had a load of various indirect/indexed movs, and it was really fun to use lookup tables for a variety of things. JW PS. Yes, I did use a jump-table based state machine exactly in the way as Richard described. |