| 1 |
|
| 2 |
m65 opcode table(s) |
| 3 |
|
| 4 |
The m65 instruction set extends the 4502 instruction set using prefix bytes. |
| 5 |
Therefore, the "normal" opcode table is the same as for the 4502 cpu (see that |
| 6 |
file), so this file only contains information about the extensions. |
| 7 |
|
| 8 |
|
| 9 |
"quad mode" allows 32-bit data operations using a virtual register called 'Q'. |
| 10 |
The mnemonics aslq/lsrq/rolq/rorq/inq/deq have five addressing modes. |
| 11 |
The mnemonics ldq/stq/cpq/adcq/sbcq/andq/eorq/orq have three addressing modes |
| 12 |
in quad mode, and a fourth when combined with long mode. |
| 13 |
The mnemonic bitq has two addressing modes. |
| 14 |
The mnemonic asrq has three addressing modes. |
| 15 |
This mode is entered after a NEG:NEG (42 42) prefix, the following opcode is |
| 16 |
then taken from this table: |
| 17 |
|
| 18 |
00 01 02 03 |
| 19 |
04 05 orq zp 06 aslq zp 07 |
| 20 |
08 09 0a aslq 0b |
| 21 |
0c 0d orq abs16 0e aslq abs16 0f |
| 22 |
10 11 12 orq (zp) 13 |
| 23 |
14 15 16 aslq zp, x 17 |
| 24 |
18 19 1a inq 1b |
| 25 |
1c 1d 1e aslq abs16, x 1f |
| 26 |
|
| 27 |
20 21 22 23 |
| 28 |
24 bitq zp 25 andq zp 26 rolq zp 27 |
| 29 |
28 29 2a rolq 2b |
| 30 |
2c bitq abs16 2d andq abs16 2e rolq abs16 2f |
| 31 |
30 31 32 andq (zp) 33 |
| 32 |
34 35 36 rolq zp, x 37 |
| 33 |
38 39 3a deq 3b |
| 34 |
3c 3d 3e rolq abs16, x 3f |
| 35 |
|
| 36 |
40 41 42 43 asrq |
| 37 |
44 asrq zp 45 eorq zp 46 lsrq zp 47 |
| 38 |
48 49 4a lsrq 4b |
| 39 |
4c 4d eorq abs16 4e lsrq abs16 4f |
| 40 |
50 51 52 eorq (zp) 53 |
| 41 |
54 asrq zp, x 55 56 lsrq zp, x 57 |
| 42 |
58 59 5a 5b |
| 43 |
5c 5d 5e lsrq abs16, x 5f |
| 44 |
|
| 45 |
60 61 62 63 |
| 46 |
64 65 adcq zp 66 rorq zp 67 |
| 47 |
68 69 6a rorq 6b |
| 48 |
6c 6d adcq abs16 6e rorq abs16 6f |
| 49 |
70 71 72 adcq (zp) 73 |
| 50 |
74 75 76 rorq zp, x 77 |
| 51 |
78 79 7a 7b |
| 52 |
7c 7d 7e rorq abs16, x 7f |
| 53 |
|
| 54 |
80 81 82 83 |
| 55 |
84 85 stq zp 86 87 |
| 56 |
88 89 8a 8b |
| 57 |
8c 8d stq abs16 8e 8f |
| 58 |
90 91 92 stq (zp) 93 |
| 59 |
94 95 96 97 |
| 60 |
98 99 9a 9b |
| 61 |
9c 9d 9e 9f |
| 62 |
|
| 63 |
a0 a1 a2 a3 |
| 64 |
a4 a5 ldq zp a6 a7 |
| 65 |
a8 a9 aa ab |
| 66 |
ac ad ldq abs16 ae af |
| 67 |
b0 b1 b2 ldq (zp), z b3 |
| 68 |
b4 b5 b6 b7 |
| 69 |
b8 b9 ba bb |
| 70 |
bc bd be bf |
| 71 |
|
| 72 |
c0 c1 c2 c3 |
| 73 |
c4 c5 cpq zp c6 deq zp c7 |
| 74 |
c8 c9 ca cb |
| 75 |
cc cd cpq abs16 ce deq abs16 cf |
| 76 |
d0 d1 d2 cpq (zp) d3 |
| 77 |
d4 d5 d6 deq zp, x d7 |
| 78 |
d8 d9 da db |
| 79 |
dc dd de deq abs16, x df |
| 80 |
|
| 81 |
e0 e1 e2 e3 |
| 82 |
e4 e5 sbcq zp e6 inq zp e7 |
| 83 |
e8 e9 ea eb |
| 84 |
ec ed sbcq abs16 ee inq abs16 ef |
| 85 |
f0 f1 f2 sbcq (zp) f3 |
| 86 |
f4 f5 f6 inq zp, x f7 |
| 87 |
f8 f9 fa fb |
| 88 |
fc fd fe inq abs16, x ff |
| 89 |
|
| 90 |
zp: 8-bit zeropage address |
| 91 |
abs16: 16-bit absolute address |
| 92 |
|
| 93 |
|
| 94 |
"long mode" adds an addressing mode using 32-bit pointers for eight existing |
| 95 |
mnemonics. This mode is entered after a NOP (ea) prefix, the following opcode |
| 96 |
should then be one of these: |
| 97 |
|
| 98 |
12 ora [zp], z 32 and [zp], z 52 eor [zp], z 72 adc [zp], z |
| 99 |
92 sta [zp], z b2 lda [zp], z d2 cmp [zp], z f2 sbc [zp], z |
| 100 |
|
| 101 |
|
| 102 |
"quad" and "long" modes can be combined to have 32-bit data access using a |
| 103 |
32-bit pointer. This adds another addressing mode for eight of the new |
| 104 |
mnemonics. This mode is entered after a NEG:NEG:NOP (42 42 ea) prefix, the |
| 105 |
following opcode should then be one of these: |
| 106 |
|
| 107 |
12 orq [zp] 32 andq [zp] 52 eorq [zp] 72 adcq [zp] |
| 108 |
92 stq [zp] b2 ldq [zp], z d2 cpq [zp] f2 sbcq [zp] |
| 109 |
|
| 110 |
|
| 111 |
Because the addressing modes are changed a bit by the prefix codes, here are |
| 112 |
some of the unsupported combinations just for comparison (these result in |
| 113 |
"Illegal combination of command and addressing mode"): |
| 114 |
lda (zp) ; 65c02 knew this, but 65ce02 added z index! |
| 115 |
lda [zp] ; long mode also expects z index! |
| 116 |
ldq #imm ; quad mode has no immediate addressing! |
| 117 |
stq (zp), z ; quad mode only uses z index for LDQ! |
| 118 |
stq [zp], z ; quad+long mode only uses z index for LDQ! |
| 119 |
ldq (zp) ; LDQ uses z index! |
| 120 |
ldq [zp] ; LDQ in long mode uses z index! |