Rizin
unix-like reverse engineering framework and cli tools
snes_op_table.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2013 condret <condret@runas-racer.com>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
4
#ifndef SNES_OP_TABLE_H
5
#define SNES_OP_TABLE_H
6
7
#include <
rz_types.h
>
8
9
enum
{
10
SNES_OP_8BIT
= 1,
11
SNES_OP_16BIT
,
12
SNES_OP_24BIT
,
13
SNES_OP_32BIT
,
14
SNES_OP_IMM_M
,
// 8- or 16-bit immediate depending on M flag
15
SNES_OP_IMM_X
// 8- or 16-bit immediate depending on X flag
16
};
17
18
typedef
struct
{
19
const
char
*
name
;
20
ut8
len
;
21
ut8
flags
;
22
}
snes_op_t
;
23
24
static
int
snes_op_get_size
(
int
M_flag,
int
X_flag,
snes_op_t
*
op
) {
25
26
switch
(
op
->len) {
27
case
SNES_OP_IMM_M
:
return
M_flag ?
SNES_OP_16BIT
:
SNES_OP_24BIT
;
28
case
SNES_OP_IMM_X
:
return
X_flag ?
SNES_OP_16BIT
:
SNES_OP_24BIT
;
29
default
:
return
op
->len;
30
}
31
}
32
33
static
snes_op_t
snes_op
[] = {
34
{
"brk 0x%02x"
,
SNES_OP_16BIT
},
35
{
"ora (0x%02x,x)"
,
SNES_OP_16BIT
},
36
{
"cop 0x%02x"
,
SNES_OP_16BIT
},
37
{
"ora 0x%02x,s"
,
SNES_OP_16BIT
},
38
{
"tsb 0x%02x"
,
SNES_OP_16BIT
},
39
{
"ora 0x%02x"
,
SNES_OP_16BIT
},
40
{
"asl 0x%02x"
,
SNES_OP_16BIT
},
41
{
"ora [0x%02x]"
,
SNES_OP_16BIT
},
42
{
"php"
,
SNES_OP_8BIT
},
43
{
"ora"
,
SNES_OP_IMM_M
},
44
{
"asl a"
,
SNES_OP_8BIT
},
45
{
"phd"
,
SNES_OP_8BIT
},
46
{
"tsb 0x%04x"
,
SNES_OP_24BIT
},
47
{
"ora 0x%04x"
,
SNES_OP_24BIT
},
48
{
"asl 0x%04x"
,
SNES_OP_24BIT
},
49
{
"ora 0x%06x"
,
SNES_OP_32BIT
},
50
{
"bpl 0x%04x"
,
SNES_OP_16BIT
},
51
{
"ora (0x%02x),y"
,
SNES_OP_16BIT
},
52
{
"ora (0x%02x)"
,
SNES_OP_16BIT
},
53
{
"ora (0x%02x,s),y"
,
SNES_OP_16BIT
},
54
{
"trb 0x%02x"
,
SNES_OP_16BIT
},
55
{
"ora 0x%02x,x"
,
SNES_OP_16BIT
},
56
{
"asl 0x%02x,x"
,
SNES_OP_16BIT
},
57
{
"ora [0x%02x],y"
,
SNES_OP_16BIT
},
58
{
"clc"
,
SNES_OP_8BIT
},
59
{
"ora 0x%04x,y"
,
SNES_OP_24BIT
},
60
{
"inc a"
,
SNES_OP_8BIT
},
61
{
"tas"
,
SNES_OP_8BIT
},
62
{
"trb 0x%04x"
,
SNES_OP_24BIT
},
63
{
"ora 0x%04x,x"
,
SNES_OP_24BIT
},
64
{
"asl 0x%04x,x"
,
SNES_OP_24BIT
},
65
{
"ora 0x%06x,x"
,
SNES_OP_32BIT
},
66
{
"jsr 0x%04x"
,
SNES_OP_24BIT
},
67
{
"and (0x%02x,x)"
,
SNES_OP_16BIT
},
68
{
"jsr 0x%06x"
,
SNES_OP_32BIT
},
69
{
"and 0x%02x,s"
,
SNES_OP_16BIT
},
70
{
"bit 0x%02x"
,
SNES_OP_16BIT
},
71
{
"and 0x%02x"
,
SNES_OP_16BIT
},
72
{
"rol 0x%02x"
,
SNES_OP_16BIT
},
73
{
"and [0x%02x]"
,
SNES_OP_16BIT
},
74
{
"plp"
,
SNES_OP_8BIT
},
75
{
"and"
,
SNES_OP_IMM_M
},
76
{
"rol a"
,
SNES_OP_8BIT
},
77
{
"pld"
,
SNES_OP_8BIT
},
78
{
"bit 0x%04x"
,
SNES_OP_24BIT
},
79
{
"and 0x%04x"
,
SNES_OP_24BIT
},
80
{
"rol 0x%04x"
,
SNES_OP_24BIT
},
81
{
"and 0x%06x"
,
SNES_OP_32BIT
},
82
{
"bmi 0x%04x"
,
SNES_OP_16BIT
},
83
{
"and (0x%02x),y"
,
SNES_OP_16BIT
},
84
{
"and (0x%02x)"
,
SNES_OP_16BIT
},
85
{
"and (0x%02x,s),y"
,
SNES_OP_16BIT
},
86
{
"bit 0x%02x,x"
,
SNES_OP_16BIT
},
87
{
"and 0x%02x,x"
,
SNES_OP_16BIT
},
88
{
"rol 0x%02x,x"
,
SNES_OP_16BIT
},
89
{
"and [0x%02x],y"
,
SNES_OP_16BIT
},
90
{
"sec"
,
SNES_OP_8BIT
},
91
{
"and 0x%04x,y"
,
SNES_OP_24BIT
},
92
{
"dec a"
,
SNES_OP_8BIT
},
93
{
"tsa"
,
SNES_OP_8BIT
},
94
{
"bit 0x%04x,x"
,
SNES_OP_24BIT
},
95
{
"and 0x%04x,x"
,
SNES_OP_24BIT
},
96
{
"rol 0x%04x,x"
,
SNES_OP_24BIT
},
97
{
"and 0x%06x,x"
,
SNES_OP_32BIT
},
98
{
"rti"
,
SNES_OP_8BIT
},
99
{
"eor (0x%02x,x)"
,
SNES_OP_16BIT
},
100
{
"wdm 0x%02X"
,
SNES_OP_16BIT
},
101
{
"eor 0x%02x,s"
,
SNES_OP_16BIT
},
102
{
"mvp 0x%02x,0x%02x"
,
SNES_OP_24BIT
},
103
{
"eor 0x%02x"
,
SNES_OP_16BIT
},
104
{
"lsr 0x%02x"
,
SNES_OP_16BIT
},
105
{
"eor [0x%02x]"
,
SNES_OP_16BIT
},
106
{
"pha"
,
SNES_OP_8BIT
},
107
{
"eor"
,
SNES_OP_IMM_M
},
108
{
"lsr a"
,
SNES_OP_8BIT
},
109
{
"phk"
,
SNES_OP_8BIT
},
110
{
"jmp 0x%04x"
,
SNES_OP_24BIT
},
111
{
"eor 0x%04x"
,
SNES_OP_24BIT
},
112
{
"lsr 0x%04x"
,
SNES_OP_24BIT
},
113
{
"eor 0x%06x"
,
SNES_OP_32BIT
},
114
{
"bvc 0x%04x"
,
SNES_OP_16BIT
},
115
{
"eor (0x%02x),y"
,
SNES_OP_16BIT
},
116
{
"eor (0x%02x)"
,
SNES_OP_16BIT
},
117
{
"eor (0x%02x,s),y"
,
SNES_OP_16BIT
},
118
{
"mvn 0x%02x,0x%02x"
,
SNES_OP_16BIT
},
119
{
"eor 0x%02x,x"
,
SNES_OP_16BIT
},
120
{
"lsr 0x%02x,x"
,
SNES_OP_16BIT
},
121
{
"eor [0x%02x],y"
,
SNES_OP_16BIT
},
122
{
"cli"
,
SNES_OP_8BIT
},
123
{
"eor 0x%04x,y"
,
SNES_OP_24BIT
},
124
{
"phy"
,
SNES_OP_8BIT
},
125
{
"tad"
,
SNES_OP_8BIT
},
126
{
"jmp 0x%06x"
,
SNES_OP_32BIT
},
127
{
"eor 0x%04x,x"
,
SNES_OP_24BIT
},
128
{
"lsr 0x%04x,x"
,
SNES_OP_24BIT
},
129
{
"eor 0x%06x,x"
,
SNES_OP_32BIT
},
130
{
"rts"
,
SNES_OP_8BIT
},
131
{
"adc (0x%02x,x)"
,
SNES_OP_16BIT
},
132
{
"per 0x%04x"
,
SNES_OP_24BIT
},
133
{
"adc 0x%02x,s"
,
SNES_OP_16BIT
},
134
{
"stz 0x%02x"
,
SNES_OP_16BIT
},
135
{
"adc 0x%02x"
,
SNES_OP_16BIT
},
136
{
"ror 0x%02x"
,
SNES_OP_16BIT
},
137
{
"adc [0x%02x]"
,
SNES_OP_16BIT
},
138
{
"pla"
,
SNES_OP_8BIT
},
139
{
"adc"
,
SNES_OP_IMM_M
},
140
{
"ror a"
,
SNES_OP_8BIT
},
141
{
"rtl"
,
SNES_OP_8BIT
},
142
{
"jmp (0x%04x)"
,
SNES_OP_24BIT
},
143
{
"adc 0x%04x"
,
SNES_OP_24BIT
},
144
{
"ror 0x%04x"
,
SNES_OP_24BIT
},
145
{
"adc 0x%06x"
,
SNES_OP_32BIT
},
146
{
"bvs 0x%04x"
,
SNES_OP_16BIT
},
147
{
"adc (0x%02x),y"
,
SNES_OP_16BIT
},
148
{
"adc (0x%02x)"
,
SNES_OP_16BIT
},
149
{
"adc (0x%02x,s),y"
,
SNES_OP_16BIT
},
150
{
"stz 0x%02x,x"
,
SNES_OP_16BIT
},
151
{
"adc 0x%02x,x"
,
SNES_OP_16BIT
},
152
{
"ror 0x%02x,x"
,
SNES_OP_16BIT
},
153
{
"adc [0x%02x],y"
,
SNES_OP_16BIT
},
154
{
"sei"
,
SNES_OP_8BIT
},
155
{
"adc 0x%04x,y"
,
SNES_OP_24BIT
},
156
{
"ply"
,
SNES_OP_8BIT
},
157
{
"tda"
,
SNES_OP_8BIT
},
158
{
"jmp (0x%04x,x)"
,
SNES_OP_24BIT
},
159
{
"adc 0x%04x,x"
,
SNES_OP_24BIT
},
160
{
"ror 0x%04x,x"
,
SNES_OP_24BIT
},
161
{
"adc 0x%06x,x"
,
SNES_OP_32BIT
},
162
{
"bra 0x%06x"
,
SNES_OP_16BIT
},
163
{
"sta (0x%02x,x)"
,
SNES_OP_16BIT
},
164
{
"brl 0x%06x"
,
SNES_OP_24BIT
},
165
{
"sta 0x%02x,s"
,
SNES_OP_16BIT
},
166
{
"sty 0x%02x"
,
SNES_OP_16BIT
},
167
{
"sta 0x%02x"
,
SNES_OP_16BIT
},
168
{
"stx 0x%02x"
,
SNES_OP_16BIT
},
169
{
"sta [0x%02x]"
,
SNES_OP_16BIT
},
170
{
"dey"
,
SNES_OP_8BIT
},
171
{
"bit"
,
SNES_OP_IMM_M
},
172
{
"txa"
,
SNES_OP_8BIT
},
173
{
"phb"
,
SNES_OP_8BIT
},
174
{
"sty 0x%04x"
,
SNES_OP_24BIT
},
175
{
"sta 0x%04x"
,
SNES_OP_24BIT
},
176
{
"stx 0x%04x"
,
SNES_OP_24BIT
},
177
{
"sta 0x%06x"
,
SNES_OP_32BIT
},
178
{
"bcc 0x%04x"
,
SNES_OP_16BIT
},
179
{
"sta (0x%02x),y"
,
SNES_OP_16BIT
},
180
{
"sta (0x%02x)"
,
SNES_OP_16BIT
},
181
{
"sta (0x%02x,s),y"
,
SNES_OP_16BIT
},
182
{
"sty 0x%02x,x"
,
SNES_OP_16BIT
},
183
{
"sta 0x%02x,x"
,
SNES_OP_16BIT
},
184
{
"stx 0x%02x,y"
,
SNES_OP_16BIT
},
185
{
"sta [0x%02x],y"
,
SNES_OP_16BIT
},
186
{
"tya"
,
SNES_OP_8BIT
},
187
{
"sta 0x%04x,y"
,
SNES_OP_24BIT
},
188
{
"txs"
,
SNES_OP_8BIT
},
189
{
"txy"
,
SNES_OP_8BIT
},
190
{
"stz 0x%04x"
,
SNES_OP_24BIT
},
191
{
"sta 0x%04x,x"
,
SNES_OP_24BIT
},
192
{
"stz 0x%04x,x"
,
SNES_OP_24BIT
},
193
{
"sta 0x%06x,x"
,
SNES_OP_32BIT
},
194
{
"ldy"
,
SNES_OP_IMM_X
},
195
{
"lda (0x%02x,x)"
,
SNES_OP_16BIT
},
196
{
"ldx"
,
SNES_OP_IMM_X
},
197
{
"lda 0x%02x,s"
,
SNES_OP_16BIT
},
198
{
"ldy 0x%02x"
,
SNES_OP_16BIT
},
199
{
"lda 0x%02x"
,
SNES_OP_16BIT
},
200
{
"ldx 0x%02x"
,
SNES_OP_16BIT
},
201
{
"lda [0x%02x]"
,
SNES_OP_16BIT
},
202
{
"tay"
,
SNES_OP_8BIT
},
203
{
"lda"
,
SNES_OP_IMM_M
},
204
{
"tax"
,
SNES_OP_8BIT
},
205
{
"plb"
,
SNES_OP_8BIT
},
206
{
"ldy 0x%04x"
,
SNES_OP_24BIT
},
207
{
"lda 0x%04x"
,
SNES_OP_24BIT
},
208
{
"ldx 0x%04x"
,
SNES_OP_24BIT
},
209
{
"lda 0x%06x"
,
SNES_OP_32BIT
},
210
{
"bcs 0x%04x"
,
SNES_OP_16BIT
},
211
{
"lda (0x%02x),y"
,
SNES_OP_16BIT
},
212
{
"lda (0x%02x)"
,
SNES_OP_16BIT
},
213
{
"lda (0x%02x,s),y"
,
SNES_OP_16BIT
},
214
{
"ldy 0x%02x,x"
,
SNES_OP_16BIT
},
215
{
"lda 0x%02x,x"
,
SNES_OP_16BIT
},
216
{
"ldx 0x%02x,y"
,
SNES_OP_16BIT
},
217
{
"lda [0x%02x],y"
,
SNES_OP_16BIT
},
218
{
"clv"
,
SNES_OP_8BIT
},
219
{
"lda 0x%04x,y"
,
SNES_OP_24BIT
},
220
{
"tsx"
,
SNES_OP_8BIT
},
221
{
"tyx"
,
SNES_OP_8BIT
},
222
{
"ldy 0x%04x,x"
,
SNES_OP_24BIT
},
223
{
"lda 0x%04x,x"
,
SNES_OP_24BIT
},
224
{
"ldx 0x%04x,y"
,
SNES_OP_24BIT
},
225
{
"lda 0x%06x,x"
,
SNES_OP_32BIT
},
226
{
"cpy"
,
SNES_OP_IMM_X
},
227
{
"cmp (0x%02x,x)"
,
SNES_OP_16BIT
},
228
{
"rep #0x%02x"
,
SNES_OP_16BIT
},
229
{
"cmp 0x%02x,s"
,
SNES_OP_16BIT
},
230
{
"cpy 0x%02x"
,
SNES_OP_16BIT
},
231
{
"cmp 0x%02x"
,
SNES_OP_16BIT
},
232
{
"dec 0x%02x"
,
SNES_OP_16BIT
},
233
{
"cmp [0x%02x]"
,
SNES_OP_16BIT
},
234
{
"iny"
,
SNES_OP_8BIT
},
235
{
"cmp"
,
SNES_OP_IMM_M
},
236
{
"dex"
,
SNES_OP_8BIT
},
237
{
"wai"
,
SNES_OP_8BIT
},
238
{
"cpy 0x%04x"
,
SNES_OP_24BIT
},
239
{
"cmp 0x%04x"
,
SNES_OP_24BIT
},
240
{
"dec 0x%04x"
,
SNES_OP_24BIT
},
241
{
"cmp 0x%06x"
,
SNES_OP_32BIT
},
242
{
"bne 0x%04x"
,
SNES_OP_16BIT
},
243
{
"cmp (0x%02x),y"
,
SNES_OP_16BIT
},
244
{
"cmp (0x%02x)"
,
SNES_OP_16BIT
},
245
{
"cmp (0x%02x,s),y"
,
SNES_OP_16BIT
},
246
{
"pei (0x%02x)"
,
SNES_OP_16BIT
},
247
{
"cmp 0x%02x,x"
,
SNES_OP_16BIT
},
248
{
"dec 0x%02x,x"
,
SNES_OP_16BIT
},
249
{
"cmp [0x%02x],y"
,
SNES_OP_16BIT
},
250
{
"cld"
,
SNES_OP_8BIT
},
251
{
"cmp 0x%04x,y"
,
SNES_OP_24BIT
},
252
{
"phx"
,
SNES_OP_8BIT
},
253
{
"stp"
,
SNES_OP_8BIT
},
254
{
"jmp [0x%04x]"
,
SNES_OP_24BIT
},
255
{
"cmp 0x%04x,x"
,
SNES_OP_24BIT
},
256
{
"dec 0x%04x,x"
,
SNES_OP_24BIT
},
257
{
"cmp 0x%06x,x"
,
SNES_OP_32BIT
},
258
{
"cpx"
,
SNES_OP_IMM_X
},
259
{
"sbc (0x%02x,x)"
,
SNES_OP_16BIT
},
260
{
"sep #0x%02x"
,
SNES_OP_16BIT
},
261
{
"sbc 0x%02x,s"
,
SNES_OP_16BIT
},
262
{
"cpx 0x%02x"
,
SNES_OP_16BIT
},
263
{
"sbc 0x%02x"
,
SNES_OP_16BIT
},
264
{
"inc 0x%02x"
,
SNES_OP_16BIT
},
265
{
"sbc [0x%02x]"
,
SNES_OP_16BIT
},
266
{
"inx"
,
SNES_OP_8BIT
},
267
{
"sbc"
,
SNES_OP_IMM_M
},
268
{
"nop"
,
SNES_OP_8BIT
},
269
{
"swa"
,
SNES_OP_8BIT
},
270
{
"cpx 0x%04x"
,
SNES_OP_24BIT
},
271
{
"sbc 0x%04x"
,
SNES_OP_24BIT
},
272
{
"inc 0x%04x"
,
SNES_OP_24BIT
},
273
{
"sbc 0x%06x"
,
SNES_OP_32BIT
},
274
{
"beq 0x%04x"
,
SNES_OP_16BIT
},
275
{
"sbc (0x%02x),y"
,
SNES_OP_16BIT
},
276
{
"sbc (0x%02x)"
,
SNES_OP_16BIT
},
277
{
"sbc (0x%02x,s),y"
,
SNES_OP_16BIT
},
278
{
"pea 0x%04x"
,
SNES_OP_24BIT
},
279
{
"sbc 0x%02x,x"
,
SNES_OP_16BIT
},
280
{
"inc 0x%02x,x"
,
SNES_OP_16BIT
},
281
{
"sbc [0x%02x],y"
,
SNES_OP_16BIT
},
282
{
"sed"
,
SNES_OP_8BIT
},
283
{
"sbc 0x%04x,y"
,
SNES_OP_24BIT
},
284
{
"plx"
,
SNES_OP_8BIT
},
285
{
"xce"
,
SNES_OP_8BIT
},
286
{
"jsr (0x%04x,x)"
,
SNES_OP_24BIT
},
287
{
"sbc 0x%04x,x"
,
SNES_OP_24BIT
},
288
{
"inc 0x%04x,x"
,
SNES_OP_24BIT
},
289
{
"sbc 0x%06x,x"
,
SNES_OP_32BIT
}
290
};
291
292
#endif
ut8
uint8_t ut8
Definition:
lh5801.h:11
rz_types.h
SNES_OP_IMM_M
@ SNES_OP_IMM_M
Definition:
snes_op_table.h:14
SNES_OP_24BIT
@ SNES_OP_24BIT
Definition:
snes_op_table.h:12
SNES_OP_IMM_X
@ SNES_OP_IMM_X
Definition:
snes_op_table.h:15
SNES_OP_32BIT
@ SNES_OP_32BIT
Definition:
snes_op_table.h:13
SNES_OP_16BIT
@ SNES_OP_16BIT
Definition:
snes_op_table.h:11
SNES_OP_8BIT
@ SNES_OP_8BIT
Definition:
snes_op_table.h:10
snes_op
static snes_op_t snes_op[]
Definition:
snes_op_table.h:33
snes_op_get_size
static int snes_op_get_size(int M_flag, int X_flag, snes_op_t *op)
Definition:
snes_op_table.h:24
snes_op_t
Definition:
snes_op_table.h:18
snes_op_t::len
ut8 len
Definition:
snes_op_table.h:20
snes_op_t::flags
ut8 flags
Definition:
snes_op_table.h:21
snes_op_t::name
const char * name
Definition:
snes_op_table.h:19
op
Definition:
dis.c:32
librz
asm
arch
snes
snes_op_table.h
Generated by
1.9.1