| 9120e874 Andy McCall |
1 |
; ******************************************************************************************* |
| 2 |
; ******************************************************************************************* |
| 3 |
; |
| 4 |
; File: 65c02.opcodes |
| 5 |
; Date: 3rd September 2019 |
| 6 |
; Purpose: Descriptor file, extra 65C02 opcodes |
| 7 |
; Author: Paul Robson ([email protected]) |
| 8 |
; |
| 9 |
; ******************************************************************************************* |
| 10 |
; ******************************************************************************************* |
| 11 |
|
| 12 |
adc ind0 5 $72 |
| 13 |
and ind0 5 $32 |
| 14 |
cmp ind0 5 $d2 |
| 15 |
eor ind0 5 $52 |
| 16 |
lda ind0 5 $b2 |
| 17 |
ora ind0 5 $12 |
| 18 |
sbc ind0 5 $f2 |
| 19 |
sta ind0 5 $92 |
| 20 |
|
| 21 |
bit immm 2 $89 |
| 22 |
bit zpx 4 $34 |
| 23 |
bit absx 4 $3c |
| 24 |
|
| 25 |
dec acc 2 $3a |
| 26 |
inc acc 2 $1a |
| 27 |
|
| 28 |
jmp ainx 6 $7c |
| 29 |
|
| 30 |
bra rel 3 $80 |
| 31 |
|
| 32 |
phx imp 3 $da |
| 33 |
phy imp 3 $5a |
| 34 |
plx imp 4 $fa |
| 35 |
ply imp 4 $7a |
| 36 |
|
| 37 |
stz zp 3 $64 |
| 38 |
stz zpx 4 $74 |
| 39 |
stz abso 4 $9c |
| 40 |
stz absx 5 $9e |
| 41 |
|
| 42 |
trb zp 5 $14 |
| 43 |
trb abso 6 $1c |
| 44 |
tsb zp 5 $04 |
| 45 |
tsb abso 6 $0c |
| 46 |
|
| 47 |
bbr0 zprel 5 $0f |
| 48 |
bbr1 zprel 5 $1f |
| 49 |
bbr2 zprel 5 $2f |
| 50 |
bbr3 zprel 5 $3f |
| 51 |
bbr4 zprel 5 $4f |
| 52 |
bbr5 zprel 5 $5f |
| 53 |
bbr6 zprel 5 $6f |
| 54 |
bbr7 zprel 5 $7f |
| 55 |
|
| 56 |
bbs0 zprel 5 $8f |
| 57 |
bbs1 zprel 5 $9f |
| 58 |
bbs2 zprel 5 $af |
| 59 |
bbs3 zprel 5 $bf |
| 60 |
bbs4 zprel 5 $cf |
| 61 |
bbs5 zprel 5 $df |
| 62 |
bbs6 zprel 5 $ef |
| 63 |
bbs7 zprel 5 $ff |
| 64 |
|
| 65 |
rmb0 zp 5 $07 |
| 66 |
rmb1 zp 5 $17 |
| 67 |
rmb2 zp 5 $27 |
| 68 |
rmb3 zp 5 $37 |
| 69 |
rmb4 zp 5 $47 |
| 70 |
rmb5 zp 5 $57 |
| 71 |
rmb6 zp 5 $67 |
| 72 |
rmb7 zp 5 $77 |
| 73 |
|
| 74 |
smb0 zp 5 $87 |
| 75 |
smb1 zp 5 $97 |
| 76 |
smb2 zp 5 $a7 |
| 77 |
smb3 zp 5 $b7 |
| 78 |
smb4 zp 5 $c7 |
| 79 |
smb5 zp 5 $d7 |
| 80 |
smb6 zp 5 $e7 |
| 81 |
smb7 zp 5 $f7 |
| 82 |
|
| 83 |
wai imp 3 $cb |
| 84 |
|
| 85 |
dbg imp 1 $DB |
| 86 |
|
| 87 |
; $5C is 8 cycles, per both the WDC W65C02S datasheet opcode matrix and the |
| 88 |
; 6502.org 65C02 opcode list. SingleStepTests says 4, so processor_tests |
| 89 |
; reports $5C as diverging on cycles. That divergence is deliberate and |
| 90 |
; recorded in the baseline: do not "fix" it to 4 to make the test green. |
| 91 |
nop abso 8 $5c |
| 92 |
nop abso 4 $dc |
| 93 |
nop abso 4 $fc |
| 94 |
|
| 95 |
; The 65C02 retimed these relative to the NMOS part, so they override the |
| 96 |
; entries in 6502.opcodes rather than adding to them. |
| 97 |
; |
| 98 |
; JMP (abs) costs a cycle more: the NMOS page-wrap bug is fixed here, and the |
| 99 |
; correction costs the extra read. |
| 100 |
jmp ind 6 $6c |
| 101 |
; |
| 102 |
; The read-modify-write absolute,X instructions cost one less, and take the |
| 103 |
; extra cycle only when indexing crosses a page. The NMOS part always paid it. |
| 104 |
; The instructions set penaltyop only when running as a 65C02, so the 65816 |
| 105 |
; keeps its own flat timing. |
| 106 |
asl absx 6 $1e |
| 107 |
rol absx 6 $3e |
| 108 |
lsr absx 6 $5e |
| 109 |
ror absx 6 $7e |
| 110 |
|
| 111 |
nop imm8 2 $02 |
| 112 |
nop imm8 2 $22 |
| 113 |
nop imm8 2 $42 |
| 114 |
nop imm8 3 $44 |
| 115 |
nop imm8 4 $54 |
| 116 |
nop imm8 2 $62 |
| 117 |
nop imm8 2 $82 |
| 118 |
nop imm8 2 $c2 |
| 119 |
nop imm8 4 $d4 |
| 120 |
nop imm8 2 $e2 |
| 121 |
nop imm8 4 $f4 |