There are not enough one-byte codes to support all the combinations of mnemonics and addressing modes. A number of ways exist with which to handle this problem, but I have opted here to use a prefix byte to extend addressing modes because it will fit with my future plans of adding 16- and 32-bit support (and more!). Few of the empty codes from the original 65c02 opcode matrix were taken here and were taken only to accommodate this prefixing scheme.
The "f3" prefix byte flips the "directness" of an addressing mode. Direct modes become indirect. The following
Code: Select all
adc $2400 ; 6d 00 24
Code: Select all
adc ($2400) ; f3 6d 00 24
If the original addressing mode uses an index register, X or Y, the new addressing mode uses the other index register.
Code: Select all
adc $24, x ; 75 24
Code: Select all
adc $24, y ; e3 75 24
Code: Select all
adc $24 ; 65 24
adc $fe ; 65 fe
Code: Select all
adc pc + $24 ; e3 65 24
adc pc - 2 ; e3 65 fe (signed offset relative to program counter)
Code: Select all
adc $24, x ; 75 24
Code: Select all
adc ($24, y) ; d3 75 24
Code: Select all
adc $24 ; 65 24
adc $fe ; 65 fe
Code: Select all
adc sp + $24 ; d3 65 24
adc sp - 2 ; d3 65 fe (signed offset relative to stack pointer)
The first spreadsheet is based of of Neil Parker's very helpful table here: http://www.llx.com/~nparker/a2/opcodes.html