mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-03-01 17:35:32 +00:00
Add Rockwell 65C02 opcodes.
This commit is contained in:
parent
b91b43100d
commit
2802425d68
@ -1,5 +1,13 @@
|
||||
@include "6502.slaspec"
|
||||
|
||||
define token bitopbyte (8)
|
||||
bitop = (0,7)
|
||||
|
||||
action = (7,7)
|
||||
bitindex = (4,6) dec
|
||||
optype = (0,3)
|
||||
;
|
||||
|
||||
define token testopbyte (8)
|
||||
top = (0, 7)
|
||||
taaa = (5, 7)
|
||||
@ -38,6 +46,20 @@ ADDRIX: (imm16,X) is X; imm16 { addr:2 = imm16 + zext(X); tmp:2 = *:2 addr;
|
||||
resultFlags(A);
|
||||
}
|
||||
|
||||
:BBR "#"bitindex, imm8, REL is (action=0 & optype=0xF) & bitindex ; imm8 ; REL {
|
||||
local ptr:2 = imm8;
|
||||
local value:1 = *:1 ptr;
|
||||
local jump = (value & (1 << bitindex)) == 0;
|
||||
if (jump) goto REL;
|
||||
}
|
||||
|
||||
:BBS "#"bitindex, imm8, REL is (action=1 & optype=0xF) & bitindex ; imm8 ; REL {
|
||||
local ptr:2 = imm8;
|
||||
local value:1 = *:1 ptr;
|
||||
local jump = (value & (1 << bitindex)) != 0;
|
||||
if (jump) goto REL;
|
||||
}
|
||||
|
||||
:BIT "#"imm8 is op=0x89; imm8
|
||||
{
|
||||
local value:1 = imm8;
|
||||
@ -131,6 +153,13 @@ ADDRIX: (imm16,X) is X; imm16 { addr:2 = imm16 + zext(X); tmp:2 = *:2 addr;
|
||||
resultFlags(Y);
|
||||
}
|
||||
|
||||
:RMB "#"bitindex, imm8 is (action=0 & optype=7) & bitindex ; imm8 {
|
||||
local ptr:2 = imm8;
|
||||
local value:1 = *:1 ptr;
|
||||
value = value & ~(1 << bitindex);
|
||||
*:1 ptr = value;
|
||||
}
|
||||
|
||||
:SBC ZIOP is (cc=2 & aaa=7) ... & ZIOP
|
||||
{
|
||||
local op1 = ZIOP;
|
||||
@ -140,6 +169,13 @@ ADDRIX: (imm16,X) is X; imm16 { addr:2 = imm16 + zext(X); tmp:2 = *:2 addr;
|
||||
A = result;
|
||||
}
|
||||
|
||||
:SMB "#"bitindex, imm8 is (action=1 & optype=7) & bitindex ; imm8 {
|
||||
local ptr:2 = imm8;
|
||||
local value:1 = *:1 ptr;
|
||||
value = value | (1 << bitindex);
|
||||
*:1 ptr = value;
|
||||
}
|
||||
|
||||
:STA ZIOP is (cc=2 & aaa=4) ... & ZIOP
|
||||
{
|
||||
ZIOP = A;
|
||||
|
@ -2,6 +2,8 @@
|
||||
ADC, 327
|
||||
AND, 328
|
||||
ASL, 329
|
||||
BBR, 457
|
||||
BBS, 458
|
||||
BCC, 330
|
||||
BCS, 331
|
||||
BEQ, 332
|
||||
@ -43,6 +45,7 @@ PLA, 382
|
||||
PLP, 385
|
||||
PLX, 386
|
||||
PLY, 387
|
||||
RMB, 459
|
||||
ROL, 389
|
||||
ROR, 390
|
||||
RTI, 391
|
||||
@ -51,6 +54,7 @@ SBC, 395
|
||||
SEC, 397
|
||||
SED, 398
|
||||
SEI, 399
|
||||
SMB, 460
|
||||
STA, 401
|
||||
STX, 403
|
||||
STY, 404
|
||||
|
Loading…
x
Reference in New Issue
Block a user