|
|
|
|
|
by joneholland
1003 days ago
|
|
The 6502 has variable length encoding, each opcode is associated with a half dozen addressing modes that determine what to do with the following bytes. In my implementation I usually store a dictionary entry with two function pointers. One for the opcode itself, and one for the addressing mode. Call the address mode to configure state correctly, then call the opcode to actually perform the work. This is a lot cleaner than nested ifs. |
|