snes_utils 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,470 @@
1
+ module SnesUtils
2
+ module Spc700
3
+ class Definitions
4
+ HEX_DIGIT = '[0-9a-f]'
5
+ BIT = "([0-7])"
6
+ HEX8 = "\\$?(#{HEX_DIGIT}{1,2})"
7
+ HEX16 = "\\$?(#{HEX_DIGIT}{3,4})"
8
+
9
+ SINGLE_OPERAND_INSTRUCTIONS = [:abs, :abspxa, :abspya, :absa, :absx, :absy, :absix, :dpixacc, :dpiyacc, :accabs, :accabsx, :accabsy, :accimp, :accdpix, :accdpiy, :accdp, :accdpx, :dp, :dppx, :dppxa, :dppxy, :dppyx, :dpa, :dpx, :dpy, :dpya, :dp0, :dp1, :dp2, :dp3, :dp4, :dp5, :dp6, :dp7, :rel, :upage, :xabs, :ximm, :xdp, :xdpy, :yabs, :yimm, :ydp, :ydpx, :yrel, :yadp]
10
+ DOUBLE_OPERAND_INSTRUCTIONS = [:cnmb, :cmb, :dpxrel, :dpimm, :dprel, :dp0rel, :dp1rel, :dp2rel, :dp3rel, :dp4rel, :dp5rel, :dp6rel, :dp7rel, :ddds, :mb, :mbc]
11
+ REL_INSTRUCTIONS = [:dpxrel, :dprel, :dp0rel, :dp1rel, :dp2rel, :dp3rel, :dp4rel, :dp5rel, :dp6rel, :dp7rel, :rel, :yrel]
12
+ BIT_INSTRUCTIONS = [:cnmb, :cmb, :mb, :mbc]
13
+
14
+ MODES_REGEXES = {
15
+ imp: /^$/,
16
+ abs: /^#{HEX16}$/i, # !a
17
+ abspxa: /^#{HEX16}\+x,a$/i, # !a+X, A
18
+ abspya: /^#{HEX16}\+y,a$/i, # !a+Y, A
19
+ absa: /^#{HEX16},a$/i, # !a, A
20
+ absx: /^#{HEX16},x$/i, # !a, X
21
+ absy: /^#{HEX16},y$/i, # !a, Y
22
+ idxpacc: /^\(x\)\+,a$/i, # (X)+, A
23
+ idxidy: /^\(x\),\(y\)$/i, # (X), (Y)
24
+ idxacc: /^\(x\),a$/i, # (X), A
25
+ t0: /^0$/i, # 0
26
+ t1: /^1$/i, # 1
27
+ t2: /^2$/i, # 2
28
+ t3: /^3$/i, # 3
29
+ t4: /^4$/i, # 4
30
+ t5: /^5$/i, # 5
31
+ t6: /^6$/i, # 6
32
+ t7: /^7$/i, # 7
33
+ t8: /^8$/i, # 8
34
+ t9: /^9$/i, # 9
35
+ t10: /^10$/i, # 10
36
+ t11: /^11$/i, # 11
37
+ t12: /^12$/i, # 12
38
+ t13: /^13$/i, # 13
39
+ t14: /^14$/i, # 14
40
+ t15: /^15$/i, # 15
41
+ absix: /^\[#{HEX16}\+x\]$/i, # [!a+X]
42
+ dpixacc: /^\[#{HEX8}\+x\],a$/i, # [d+X], A
43
+ dpiyacc: /^\[#{HEX8}\]\+y,a$/i, # [d]+Y, A
44
+ acc: /^a$/i, # A
45
+ accabs: /^a,#{HEX16}$/i, # A, !a
46
+ accabsx: /^a,#{HEX16}\+x$/i, # A, !a+X
47
+ accabsy: /^a,#{HEX16}\+y$/i, # A, !a+Y
48
+ accimp: /^a,##{HEX8}$/i, # A, #i
49
+ accidx: /^a,\(x\)$/i, # A, (X)
50
+ accidxp: /^a,\(x\)\+$/i, # A, (X)+
51
+ accdpix: /^a,\[#{HEX8}\+x\]$/i, # A, [d+X]
52
+ accdpiy: /^a,\[#{HEX8}\]\+y$/i, # A, [d]+Y
53
+ accdp: /^a,#{HEX8}$/i, # A, d
54
+ accdpx: /^a,#{HEX8}\+x$/i, # A, d+X
55
+ accx: /^a,x$/i, # A, X
56
+ accy: /^a,y$/i, # A, Y
57
+ cnmb: /^c,\/#{HEX16}\.#{BIT}$/i, # C, /m.b
58
+ cmb: /^c,#{HEX16}\.#{BIT}$/i, # C, m.b
59
+ dp: /^#{HEX8}$/i, # d
60
+ dppx: /^#{HEX8}\+x$/i, # d+X
61
+ dppxa: /^#{HEX8}\+x,a$/i, # d+X, A
62
+ dpxrel: /^#{HEX8}\+x,#{HEX16}$/i, # d+X, r
63
+ dppxy: /^#{HEX8}\+x,y$/i, # d+X, Y
64
+ dppyx: /^#{HEX8}\+y,x$/i, # d+Y, X
65
+ dpimm: /^#{HEX8},##{HEX8}$/i, # d, #i
66
+ dpa: /^#{HEX8},a$/i, # d, A
67
+ dprel: /^#{HEX8},#{HEX16}$/i, # d, r
68
+ dpx: /^#{HEX8},x$/i, # d, X
69
+ dpy: /^#{HEX8},y$/i, # d, Y
70
+ dpya: /^#{HEX8},ya$/i, # d, YA
71
+ dp0: /^#{HEX8}\.0$/i, # d.0
72
+ dp0rel: /^#{HEX8}\.0,#{HEX16}$/i, # d.0, r
73
+ dp1: /^#{HEX8}\.1$/i, # d.1
74
+ dp1rel: /^#{HEX8}\.1,#{HEX16}$/i, # d.1, r
75
+ dp2: /^#{HEX8}\.2$/i, # d.2
76
+ dp2rel: /^#{HEX8}\.2,#{HEX16}$/i, # d.2, r
77
+ dp3: /^#{HEX8}\.3$/i, # d.3
78
+ dp3rel: /^#{HEX8}\.3,#{HEX16}$/i, # d.3, r
79
+ dp4: /^#{HEX8}\.4$/i, # d.4
80
+ dp4rel: /^#{HEX8}\.4,#{HEX16}$/i, # d.4, r
81
+ dp5: /^#{HEX8}\.5$/i, # d.5
82
+ dp5rel: /^#{HEX8}\.5,#{HEX16}$/i, # d.5, r
83
+ dp6: /^#{HEX8}\.6$/i, # d.6
84
+ dp6rel: /^#{HEX8}\.6,#{HEX16}$/i, # d.6, r
85
+ dp7: /^#{HEX8}\.7$/i, # d.7
86
+ dp7rel: /^#{HEX8}\.7,#{HEX16}$/i, # d.7, r
87
+ ddds: /^#{HEX8}<d>,#{HEX8}<s>$/i, # d<d>, d<s>
88
+ mb: /^#{HEX16}\.#{BIT}$/i, # m.b
89
+ mbc: /^#{HEX16}\.#{BIT},c$/i, # m.b, C
90
+ psw: /^psw$/i, # PSW
91
+ rel: /^#{HEX16}$/i, # r
92
+ spx: /^sp,x$/i, # SP, X
93
+ upage: /^#{HEX8}$/i, # u
94
+ x: /^x$/i, # X
95
+ xabs: /^x,#{HEX16}$/i, # X, !a
96
+ ximm: /^x,##{HEX8}$/i, # X, #i
97
+ xa: /^x,a$/i, # X, A
98
+ xdp: /^x,#{HEX8}$/i, # X, d
99
+ xdpy: /^x,#{HEX8}\+y$/i, # X, d+Y
100
+ xsp: /^x,sp$/i, # X, SP
101
+ y: /^y$/i, # Y
102
+ yabs: /^y,#{HEX16}$/i, # Y, !a
103
+ yimm: /^y,##{HEX8}$/i, # Y, #i
104
+ yacc: /^y,a$/i, # Y, A
105
+ ydp: /^y,#{HEX8}$/i, # Y, d
106
+ ydpx: /^y,#{HEX8}\+x$/i, # Y, d+X
107
+ yrel: /^y,#{HEX16}$/i, # Y, r
108
+ ya: /^ya$/i, # YA
109
+ yadp: /^ya,#{HEX8}$/i, # YA, d
110
+ yax: /^ya,x$/i # YA, X
111
+ }
112
+
113
+ MODES_FORMATS = {
114
+ imp: "%s",
115
+ abs: "%-5s !%04X",
116
+ abspxa: "%-5s !%04X+X,A",
117
+ abspya: "%-5s !%04X+Y,A",
118
+ absa: "%-5s !%04X,A",
119
+ absx: "%-5s !%04X,X",
120
+ absy: "%-5s !%04X,Y",
121
+ idxpacc: "%-5s (X)+,A",
122
+ idxidy: "%-5s (X),(Y)",
123
+ idxacc: "%-5s (X),A",
124
+ t0: "%-5s 0",
125
+ t1: "%-5s 1",
126
+ t2: "%-5s 2",
127
+ t3: "%-5s 3",
128
+ t4: "%-5s 4",
129
+ t5: "%-5s 5",
130
+ t6: "%-5s 6",
131
+ t7: "%-5s 7",
132
+ t8: "%-5s 8",
133
+ t9: "%-5s 9",
134
+ t10: "%-5s 10",
135
+ t11: "%-5s 11",
136
+ t12: "%-5s 12",
137
+ t13: "%-5s 13",
138
+ t14: "%-5s 14",
139
+ t15: "%-5s 15",
140
+ absix: "%-5s [!%04X+X]",
141
+ dpixacc: "%-5s [%02X+X],A",
142
+ dpiyacc: "%-5s [%02X]+Y,A",
143
+ acc: "%-5s A",
144
+ accabs: "%-5s A,!%04X",
145
+ accabsx: "%-5s A,!%04X+X",
146
+ accabsy: "%-5s A,!%04X+Y",
147
+ accimp: "%-5s A,#%02X",
148
+ accidx: "%-5s A,(X)",
149
+ accidxp: "%-5s A,(X)+",
150
+ accdpix: "%-5s A,[%02X+X]",
151
+ accdpiy: "%-5s A,[%02X]+Y",
152
+ accdp: "%-5s A,%02X",
153
+ accdpx: "%-5s A,%02X+X",
154
+ accx: "%-5s A,X",
155
+ accy: "%-5s A,Y",
156
+ cnmb: "%-5s C,/%04X.%X",
157
+ cmb: "%-5s C,%04X.%X",
158
+ dp: "%-5s %02X",
159
+ dppx: "%-5s %02X+X",
160
+ dppxa: "%-5s %02X+X,A",
161
+ dpxrel: "%-5s %02X+X,%04X {%s}",
162
+ dppxy: "%-5s %02X+X,Y",
163
+ dppyx: "%-5s %02X+Y,X",
164
+ dpimm: "%-5s %02X,#%02X",
165
+ dpa: "%-5s %02X,A",
166
+ dprel: "%-5s %02X,%04X {%s}",
167
+ dpx: "%-5s %02X,X",
168
+ dpy: "%-5s %02X,Y",
169
+ dpya: "%-5s %02X,YA",
170
+ dp0: "%-5s %02X.0",
171
+ dp0rel: "%-5s %02X.0,%04X {%s}",
172
+ dp1: "%-5s %02X.1",
173
+ dp1rel: "%-5s %02X.1,%04X {%s}",
174
+ dp2: "%-5s %02X.2",
175
+ dp2rel: "%-5s %02X.2,%04X {%s}",
176
+ dp3: "%-5s %02X.3",
177
+ dp3rel: "%-5s %02X.3,%04X {%s}",
178
+ dp4: "%-5s %02X.4",
179
+ dp4rel: "%-5s %02X.4,%04X {%s}",
180
+ dp5: "%-5s %02X.5",
181
+ dp5rel: "%-5s %02X.5,%04X {%s}",
182
+ dp6: "%-5s %02X.6",
183
+ dp6rel: "%-5s %02X.6,%04X {%s}",
184
+ dp7: "%-5s %02X.7",
185
+ dp7rel: "%-5s %02X.7,%04X {%s}",
186
+ ddds: "%-5s %02X<d>,%02X<s>",
187
+ mb: "%-5s %04X.%X",
188
+ mbc: "%-5s %04X.%X,C",
189
+ psw: "%-5s PSW",
190
+ rel: "%-5s %04X {%s}",
191
+ spx: "%-5s SP,X",
192
+ upage: "%-5s %02X",
193
+ x: "%-5s X",
194
+ xabs: "%-5s X,!%04X",
195
+ ximm: "%-5s X,#%02X",
196
+ xa: "%-5s X,A",
197
+ xdp: "%-5s X,%02X",
198
+ xdpy: "%-5s X,%02X+Y",
199
+ xsp: "%-5s X,SP",
200
+ y: "%-5s Y",
201
+ yabs: "%-5s Y,!%04X",
202
+ yimm: "%-5s Y,#%02X",
203
+ yacc: "%-5s Y,A",
204
+ ydp: "%-5s Y,%02X",
205
+ ydpx: "%-5s Y,%02X+X",
206
+ yrel: "%-5s Y,%04X {%s}",
207
+ ya: "%-5s YA",
208
+ yadp: "%-5s YA,%02X",
209
+ yax: "%-5s YA,X"
210
+ }
211
+
212
+ OPCODES_DATA = [{ opcode: 0x99, mnemonic: "ADC", mode: :idxidy, length: 1},
213
+ { opcode: 0x88, mnemonic: "ADC", mode: :accimp, length: 2},
214
+ { opcode: 0x86, mnemonic: "ADC", mode: :accidx, length: 1},
215
+ { opcode: 0x97, mnemonic: "ADC", mode: :accdpiy, length: 2},
216
+ { opcode: 0x87, mnemonic: "ADC", mode: :accdpix, length: 2},
217
+ { opcode: 0x84, mnemonic: "ADC", mode: :accdp, length: 2},
218
+ { opcode: 0x94, mnemonic: "ADC", mode: :accdpx, length: 2},
219
+ { opcode: 0x85, mnemonic: "ADC", mode: :accabs, length: 3},
220
+ { opcode: 0x95, mnemonic: "ADC", mode: :accabsx, length: 3},
221
+ { opcode: 0x96, mnemonic: "ADC", mode: :accabsy, length: 3},
222
+ { opcode: 0x89, mnemonic: "ADC", mode: :ddds, length: 3},
223
+ { opcode: 0x98, mnemonic: "ADC", mode: :dpimm, length: 3},
224
+ { opcode: 0x7A, mnemonic: "ADDW", mode: :yadp, length: 2},
225
+ { opcode: 0x39, mnemonic: "AND", mode: :idxidy, length: 1},
226
+ { opcode: 0x28, mnemonic: "AND", mode: :accimp, length: 2},
227
+ { opcode: 0x26, mnemonic: "AND", mode: :accidx, length: 1},
228
+ { opcode: 0x37, mnemonic: "AND", mode: :accdpiy, length: 2},
229
+ { opcode: 0x27, mnemonic: "AND", mode: :accdpix, length: 2},
230
+ { opcode: 0x24, mnemonic: "AND", mode: :accdp, length: 2},
231
+ { opcode: 0x34, mnemonic: "AND", mode: :accdpx, length: 2},
232
+ { opcode: 0x25, mnemonic: "AND", mode: :accabs, length: 3},
233
+ { opcode: 0x35, mnemonic: "AND", mode: :accabsx, length: 3},
234
+ { opcode: 0x36, mnemonic: "AND", mode: :accabsy, length: 3},
235
+ { opcode: 0x29, mnemonic: "AND", mode: :ddds, length: 3},
236
+ { opcode: 0x38, mnemonic: "AND", mode: :dpimm, length: 3},
237
+ { opcode: 0x6A, mnemonic: "AND1", mode: :cnmb, length: 3},
238
+ { opcode: 0x4A, mnemonic: "AND1", mode: :cmb, length: 3},
239
+ { opcode: 0x1C, mnemonic: "ASL", mode: :acc, length: 1},
240
+ { opcode: 0x0B, mnemonic: "ASL", mode: :dp, length: 2},
241
+ { opcode: 0x1B, mnemonic: "ASL", mode: :dppx, length: 2},
242
+ { opcode: 0x0C, mnemonic: "ASL", mode: :abs, length: 3},
243
+ { opcode: 0x13, mnemonic: "BBC", mode: :dp0rel, length: 3},
244
+ { opcode: 0x33, mnemonic: "BBC", mode: :dp1rel, length: 3},
245
+ { opcode: 0x53, mnemonic: "BBC", mode: :dp2rel, length: 3},
246
+ { opcode: 0x73, mnemonic: "BBC", mode: :dp3rel, length: 3},
247
+ { opcode: 0x93, mnemonic: "BBC", mode: :dp4rel, length: 3},
248
+ { opcode: 0xB3, mnemonic: "BBC", mode: :dp5rel, length: 3},
249
+ { opcode: 0xD3, mnemonic: "BBC", mode: :dp6rel, length: 3},
250
+ { opcode: 0xF3, mnemonic: "BBC", mode: :dp7rel, length: 3},
251
+ { opcode: 0x03, mnemonic: "BBS", mode: :dp0rel, length: 3},
252
+ { opcode: 0x23, mnemonic: "BBS", mode: :dp1rel, length: 3},
253
+ { opcode: 0x43, mnemonic: "BBS", mode: :dp2rel, length: 3},
254
+ { opcode: 0x63, mnemonic: "BBS", mode: :dp3rel, length: 3},
255
+ { opcode: 0x83, mnemonic: "BBS", mode: :dp4rel, length: 3},
256
+ { opcode: 0xA3, mnemonic: "BBS", mode: :dp5rel, length: 3},
257
+ { opcode: 0xC3, mnemonic: "BBS", mode: :dp6rel, length: 3},
258
+ { opcode: 0xE3, mnemonic: "BBS", mode: :dp7rel, length: 3},
259
+ { opcode: 0x90, mnemonic: "BCC", mode: :rel, length: 2},
260
+ { opcode: 0xB0, mnemonic: "BCS", mode: :rel, length: 2},
261
+ { opcode: 0xF0, mnemonic: "BEQ", mode: :rel, length: 2},
262
+ { opcode: 0x30, mnemonic: "BMI", mode: :rel, length: 2},
263
+ { opcode: 0xD0, mnemonic: "BNE", mode: :rel, length: 2},
264
+ { opcode: 0x10, mnemonic: "BPL", mode: :rel, length: 2},
265
+ { opcode: 0x50, mnemonic: "BVC", mode: :rel, length: 2},
266
+ { opcode: 0x70, mnemonic: "BVS", mode: :rel, length: 2},
267
+ { opcode: 0x2F, mnemonic: "BRA", mode: :rel, length: 2},
268
+ { opcode: 0x0F, mnemonic: "BRK", mode: :imp, length: 1},
269
+ { opcode: 0x3F, mnemonic: "CALL", mode: :abs, length: 3},
270
+ { opcode: 0xDE, mnemonic: "CBNE", mode: :dpxrel, length: 3},
271
+ { opcode: 0x2E, mnemonic: "CBNE", mode: :dprel, length: 3},
272
+ { opcode: 0x12, mnemonic: "CLR1", mode: :dp0, length: 2},
273
+ { opcode: 0x32, mnemonic: "CLR1", mode: :dp1, length: 2},
274
+ { opcode: 0x52, mnemonic: "CLR1", mode: :dp2, length: 2},
275
+ { opcode: 0x72, mnemonic: "CLR1", mode: :dp3, length: 2},
276
+ { opcode: 0x92, mnemonic: "CLR1", mode: :dp4, length: 2},
277
+ { opcode: 0xB2, mnemonic: "CLR1", mode: :dp5, length: 2},
278
+ { opcode: 0xD2, mnemonic: "CLR1", mode: :dp6, length: 2},
279
+ { opcode: 0xF2, mnemonic: "CLR1", mode: :dp7, length: 2},
280
+ { opcode: 0x60, mnemonic: "CLRC", mode: :imp, length: 1},
281
+ { opcode: 0x20, mnemonic: "CLRP", mode: :imp, length: 1},
282
+ { opcode: 0xE0, mnemonic: "CLRV", mode: :imp, length: 1},
283
+ { opcode: 0x79, mnemonic: "CMP", mode: :idxidy, length: 1},
284
+ { opcode: 0x68, mnemonic: "CMP", mode: :accimp, length: 2},
285
+ { opcode: 0x66, mnemonic: "CMP", mode: :accidx, length: 1},
286
+ { opcode: 0x77, mnemonic: "CMP", mode: :accdpiy, length: 2},
287
+ { opcode: 0x67, mnemonic: "CMP", mode: :accdpix, length: 2},
288
+ { opcode: 0x64, mnemonic: "CMP", mode: :accdp, length: 2},
289
+ { opcode: 0x74, mnemonic: "CMP", mode: :accdpx, length: 2},
290
+ { opcode: 0x65, mnemonic: "CMP", mode: :accabs, length: 3},
291
+ { opcode: 0x75, mnemonic: "CMP", mode: :accabsx, length: 3},
292
+ { opcode: 0x76, mnemonic: "CMP", mode: :accabsy, length: 3},
293
+ { opcode: 0xC8, mnemonic: "CMP", mode: :ximm, length: 2},
294
+ { opcode: 0x3E, mnemonic: "CMP", mode: :xdp, length: 2},
295
+ { opcode: 0x1E, mnemonic: "CMP", mode: :xabs, length: 3},
296
+ { opcode: 0xAD, mnemonic: "CMP", mode: :yimm, length: 2},
297
+ { opcode: 0x7E, mnemonic: "CMP", mode: :ydp, length: 2},
298
+ { opcode: 0x5E, mnemonic: "CMP", mode: :yabs, length: 3},
299
+ { opcode: 0x69, mnemonic: "CMP", mode: :ddds, length: 3},
300
+ { opcode: 0x78, mnemonic: "CMP", mode: :dpimm, length: 3},
301
+ { opcode: 0x5A, mnemonic: "CMPW", mode: :yadp, length: 2},
302
+ { opcode: 0xDF, mnemonic: "DAA", mode: :acc, length: 1},
303
+ { opcode: 0xBE, mnemonic: "DAS", mode: :acc, length: 1},
304
+ { opcode: 0xFE, mnemonic: "DBNZ", mode: :yrel, length: 2},
305
+ { opcode: 0x6E, mnemonic: "DBNZ", mode: :dprel, length: 3},
306
+ { opcode: 0x9C, mnemonic: "DEC", mode: :acc, length: 1},
307
+ { opcode: 0x1D, mnemonic: "DEC", mode: :x, length: 1},
308
+ { opcode: 0xDC, mnemonic: "DEC", mode: :y, length: 1},
309
+ { opcode: 0x8B, mnemonic: "DEC", mode: :dp, length: 2},
310
+ { opcode: 0x9B, mnemonic: "DEC", mode: :dppx, length: 2},
311
+ { opcode: 0x8C, mnemonic: "DEC", mode: :abs, length: 3},
312
+ { opcode: 0x1A, mnemonic: "DECW", mode: :dp, length: 2},
313
+ { opcode: 0xC0, mnemonic: "DI", mode: :imp, length: 1},
314
+ { opcode: 0x9E, mnemonic: "DIV", mode: :yax, length: 1},
315
+ { opcode: 0xA0, mnemonic: "EI", mode: :imp, length: 1},
316
+ { opcode: 0x59, mnemonic: "EOR", mode: :idxidy, length: 1},
317
+ { opcode: 0x48, mnemonic: "EOR", mode: :accimp, length: 2},
318
+ { opcode: 0x46, mnemonic: "EOR", mode: :accidx, length: 1},
319
+ { opcode: 0x57, mnemonic: "EOR", mode: :accdpiy, length: 2},
320
+ { opcode: 0x47, mnemonic: "EOR", mode: :accdpix, length: 2},
321
+ { opcode: 0x44, mnemonic: "EOR", mode: :accdp, length: 2},
322
+ { opcode: 0x54, mnemonic: "EOR", mode: :accdpx, length: 2},
323
+ { opcode: 0x45, mnemonic: "EOR", mode: :accabs, length: 3},
324
+ { opcode: 0x55, mnemonic: "EOR", mode: :accabsx, length: 3},
325
+ { opcode: 0x56, mnemonic: "EOR", mode: :accabsy, length: 3},
326
+ { opcode: 0x49, mnemonic: "EOR", mode: :ddds, length: 3},
327
+ { opcode: 0x58, mnemonic: "EOR", mode: :dpimm, length: 3},
328
+ { opcode: 0x8A, mnemonic: "EOR1", mode: :cmb, length: 3},
329
+ { opcode: 0xBC, mnemonic: "INC", mode: :acc, length: 1},
330
+ { opcode: 0x3D, mnemonic: "INC", mode: :x, length: 1},
331
+ { opcode: 0xFC, mnemonic: "INC", mode: :y, length: 1},
332
+ { opcode: 0xAB, mnemonic: "INC", mode: :dp, length: 2},
333
+ { opcode: 0xBB, mnemonic: "INC", mode: :dppx, length: 2},
334
+ { opcode: 0xAC, mnemonic: "INC", mode: :abs, length: 3},
335
+ { opcode: 0x3A, mnemonic: "INCW", mode: :dp, length: 2},
336
+ { opcode: 0x1F, mnemonic: "JMP", mode: :absix, length: 3},
337
+ { opcode: 0x5F, mnemonic: "JMP", mode: :abs, length: 3},
338
+ { opcode: 0x5C, mnemonic: "LSR", mode: :acc, length: 1},
339
+ { opcode: 0x4B, mnemonic: "LSR", mode: :dp, length: 2},
340
+ { opcode: 0x5B, mnemonic: "LSR", mode: :dppx, length: 2},
341
+ { opcode: 0x4C, mnemonic: "LSR", mode: :abs, length: 3},
342
+ { opcode: 0xAF, mnemonic: "MOV", mode: :idxpacc, length: 1},
343
+ { opcode: 0xC6, mnemonic: "MOV", mode: :idxacc, length: 1},
344
+ { opcode: 0xD7, mnemonic: "MOV", mode: :dpiyacc, length: 2},
345
+ { opcode: 0xC7, mnemonic: "MOV", mode: :dpixacc, length: 2},
346
+ { opcode: 0xE8, mnemonic: "MOV", mode: :accimp, length: 2},
347
+ { opcode: 0xE6, mnemonic: "MOV", mode: :accidx, length: 1},
348
+ { opcode: 0xBF, mnemonic: "MOV", mode: :accidxp, length: 1},
349
+ { opcode: 0xF7, mnemonic: "MOV", mode: :accdpiy, length: 2},
350
+ { opcode: 0xE7, mnemonic: "MOV", mode: :accdpix, length: 2},
351
+ { opcode: 0x7D, mnemonic: "MOV", mode: :accx, length: 1},
352
+ { opcode: 0xDD, mnemonic: "MOV", mode: :accy, length: 1},
353
+ { opcode: 0xE4, mnemonic: "MOV", mode: :accdp, length: 2},
354
+ { opcode: 0xF4, mnemonic: "MOV", mode: :accdpx, length: 2},
355
+ { opcode: 0xE5, mnemonic: "MOV", mode: :accabs, length: 3},
356
+ { opcode: 0xF5, mnemonic: "MOV", mode: :accabsx, length: 3},
357
+ { opcode: 0xF6, mnemonic: "MOV", mode: :accabsy, length: 3},
358
+ { opcode: 0xBD, mnemonic: "MOV", mode: :spx, length: 1},
359
+ { opcode: 0xCD, mnemonic: "MOV", mode: :ximm, length: 2},
360
+ { opcode: 0x5D, mnemonic: "MOV", mode: :xa, length: 1},
361
+ { opcode: 0x9D, mnemonic: "MOV", mode: :xsp, length: 1},
362
+ { opcode: 0xF8, mnemonic: "MOV", mode: :xdp, length: 2},
363
+ { opcode: 0xF9, mnemonic: "MOV", mode: :xdpy, length: 2},
364
+ { opcode: 0xE9, mnemonic: "MOV", mode: :xabs, length: 3},
365
+ { opcode: 0x8D, mnemonic: "MOV", mode: :yimm, length: 2},
366
+ { opcode: 0xFD, mnemonic: "MOV", mode: :yacc, length: 1},
367
+ { opcode: 0xEB, mnemonic: "MOV", mode: :ydp, length: 2},
368
+ { opcode: 0xFB, mnemonic: "MOV", mode: :ydpx, length: 2},
369
+ { opcode: 0xEC, mnemonic: "MOV", mode: :yabs, length: 3},
370
+ { opcode: 0xFA, mnemonic: "MOV", mode: :ddds, length: 3},
371
+ { opcode: 0xD4, mnemonic: "MOV", mode: :dppxa, length: 2},
372
+ { opcode: 0xDB, mnemonic: "MOV", mode: :dppxy, length: 2},
373
+ { opcode: 0xD9, mnemonic: "MOV", mode: :dppyx, length: 2},
374
+ { opcode: 0x8F, mnemonic: "MOV", mode: :dpimm, length: 3},
375
+ { opcode: 0xC4, mnemonic: "MOV", mode: :dpa, length: 2},
376
+ { opcode: 0xD8, mnemonic: "MOV", mode: :dpx, length: 2},
377
+ { opcode: 0xCB, mnemonic: "MOV", mode: :dpy, length: 2},
378
+ { opcode: 0xD5, mnemonic: "MOV", mode: :abspxa, length: 3},
379
+ { opcode: 0xD6, mnemonic: "MOV", mode: :abspya, length: 3},
380
+ { opcode: 0xC5, mnemonic: "MOV", mode: :absa, length: 3},
381
+ { opcode: 0xC9, mnemonic: "MOV", mode: :absx, length: 3},
382
+ { opcode: 0xCC, mnemonic: "MOV", mode: :absy, length: 3},
383
+ { opcode: 0xAA, mnemonic: "MOV1", mode: :cmb, length: 3},
384
+ { opcode: 0xCA, mnemonic: "MOV1", mode: :mbc, length: 3},
385
+ { opcode: 0xBA, mnemonic: "MOVW", mode: :yadp, length: 2},
386
+ { opcode: 0xDA, mnemonic: "MOVW", mode: :dpya, length: 2},
387
+ { opcode: 0xCF, mnemonic: "MUL", mode: :ya, length: 1},
388
+ { opcode: 0x00, mnemonic: "NOP", mode: :imp, length: 1},
389
+ { opcode: 0xEA, mnemonic: "NOT1", mode: :mb, length: 3},
390
+ { opcode: 0xED, mnemonic: "NOTC", mode: :imp, length: 1},
391
+ { opcode: 0x19, mnemonic: "OR", mode: :idxidy, length: 1},
392
+ { opcode: 0x08, mnemonic: "OR", mode: :accimp, length: 2},
393
+ { opcode: 0x06, mnemonic: "OR", mode: :accidx, length: 1},
394
+ { opcode: 0x17, mnemonic: "OR", mode: :accdpiy, length: 2},
395
+ { opcode: 0x07, mnemonic: "OR", mode: :accdpix, length: 2},
396
+ { opcode: 0x04, mnemonic: "OR", mode: :accdp, length: 2},
397
+ { opcode: 0x14, mnemonic: "OR", mode: :accdpx, length: 2},
398
+ { opcode: 0x05, mnemonic: "OR", mode: :accabs, length: 3},
399
+ { opcode: 0x15, mnemonic: "OR", mode: :accabsx, length: 3},
400
+ { opcode: 0x16, mnemonic: "OR", mode: :accabsy, length: 3},
401
+ { opcode: 0x09, mnemonic: "OR", mode: :ddds, length: 3},
402
+ { opcode: 0x18, mnemonic: "OR", mode: :dpimm, length: 3},
403
+ { opcode: 0x2A, mnemonic: "OR1", mode: :cnmb, length: 3},
404
+ { opcode: 0x0A, mnemonic: "OR1", mode: :cmb, length: 3},
405
+ { opcode: 0x4F, mnemonic: "PCALL", mode: :upage, length: 2},
406
+ { opcode: 0xAE, mnemonic: "POP", mode: :acc, length: 1},
407
+ { opcode: 0x8E, mnemonic: "POP", mode: :psw, length: 1},
408
+ { opcode: 0xCE, mnemonic: "POP", mode: :x, length: 1},
409
+ { opcode: 0xEE, mnemonic: "POP", mode: :y, length: 1},
410
+ { opcode: 0x2D, mnemonic: "PUSH", mode: :acc, length: 1},
411
+ { opcode: 0x0D, mnemonic: "PUSH", mode: :psw, length: 1},
412
+ { opcode: 0x4D, mnemonic: "PUSH", mode: :x, length: 1},
413
+ { opcode: 0x6D, mnemonic: "PUSH", mode: :y, length: 1},
414
+ { opcode: 0x6F, mnemonic: "RET", mode: :imp, length: 1},
415
+ { opcode: 0x7F, mnemonic: "RETI", mode: :imp, length: 1},
416
+ { opcode: 0x3C, mnemonic: "ROL", mode: :acc, length: 1},
417
+ { opcode: 0x2B, mnemonic: "ROL", mode: :dp, length: 2},
418
+ { opcode: 0x3B, mnemonic: "ROL", mode: :dppx, length: 2},
419
+ { opcode: 0x2C, mnemonic: "ROL", mode: :abs, length: 3},
420
+ { opcode: 0x7C, mnemonic: "ROR", mode: :acc, length: 1},
421
+ { opcode: 0x6B, mnemonic: "ROR", mode: :dp, length: 2},
422
+ { opcode: 0x7B, mnemonic: "ROR", mode: :dppx, length: 2},
423
+ { opcode: 0x6C, mnemonic: "ROR", mode: :abs, length: 3},
424
+ { opcode: 0xB9, mnemonic: "SBC", mode: :idxidy, length: 1},
425
+ { opcode: 0xA8, mnemonic: "SBC", mode: :accimp, length: 2},
426
+ { opcode: 0xA6, mnemonic: "SBC", mode: :accidx, length: 1},
427
+ { opcode: 0xB7, mnemonic: "SBC", mode: :accdpiy, length: 2},
428
+ { opcode: 0xA7, mnemonic: "SBC", mode: :accdpix, length: 2},
429
+ { opcode: 0xA4, mnemonic: "SBC", mode: :accdp, length: 2},
430
+ { opcode: 0xB4, mnemonic: "SBC", mode: :accdpx, length: 2},
431
+ { opcode: 0xA5, mnemonic: "SBC", mode: :accabs, length: 3},
432
+ { opcode: 0xB5, mnemonic: "SBC", mode: :accabsx, length: 3},
433
+ { opcode: 0xB6, mnemonic: "SBC", mode: :accabsy, length: 3},
434
+ { opcode: 0xA9, mnemonic: "SBC", mode: :ddds, length: 3},
435
+ { opcode: 0xB8, mnemonic: "SBC", mode: :dpimm, length: 3},
436
+ { opcode: 0x02, mnemonic: "SET1", mode: :dp0, length: 2},
437
+ { opcode: 0x22, mnemonic: "SET1", mode: :dp1, length: 2},
438
+ { opcode: 0x42, mnemonic: "SET1", mode: :dp2, length: 2},
439
+ { opcode: 0x62, mnemonic: "SET1", mode: :dp3, length: 2},
440
+ { opcode: 0x82, mnemonic: "SET1", mode: :dp4, length: 2},
441
+ { opcode: 0xA2, mnemonic: "SET1", mode: :dp5, length: 2},
442
+ { opcode: 0xC2, mnemonic: "SET1", mode: :dp6, length: 2},
443
+ { opcode: 0xE2, mnemonic: "SET1", mode: :dp7, length: 2},
444
+ { opcode: 0x80, mnemonic: "SETC", mode: :imp, length: 1},
445
+ { opcode: 0x40, mnemonic: "SETP", mode: :imp, length: 1},
446
+ { opcode: 0xEF, mnemonic: "SLEEP", mode: :imp, length: 1},
447
+ { opcode: 0xFF, mnemonic: "STOP", mode: :imp, length: 1},
448
+ { opcode: 0x9A, mnemonic: "SUBW", mode: :yadp, length: 2},
449
+ { opcode: 0x01, mnemonic: "TCALL", mode: :t0, length: 1},
450
+ { opcode: 0x11, mnemonic: "TCALL", mode: :t1, length: 1},
451
+ { opcode: 0x21, mnemonic: "TCALL", mode: :t2, length: 1},
452
+ { opcode: 0x31, mnemonic: "TCALL", mode: :t3, length: 1},
453
+ { opcode: 0x41, mnemonic: "TCALL", mode: :t4, length: 1},
454
+ { opcode: 0x51, mnemonic: "TCALL", mode: :t5, length: 1},
455
+ { opcode: 0x61, mnemonic: "TCALL", mode: :t6, length: 1},
456
+ { opcode: 0x71, mnemonic: "TCALL", mode: :t7, length: 1},
457
+ { opcode: 0x81, mnemonic: "TCALL", mode: :t8, length: 1},
458
+ { opcode: 0x91, mnemonic: "TCALL", mode: :t9, length: 1},
459
+ { opcode: 0xA1, mnemonic: "TCALL", mode: :t10, length: 1},
460
+ { opcode: 0xB1, mnemonic: "TCALL", mode: :t11, length: 1},
461
+ { opcode: 0xC1, mnemonic: "TCALL", mode: :t12, length: 1},
462
+ { opcode: 0xD1, mnemonic: "TCALL", mode: :t13, length: 1},
463
+ { opcode: 0xE1, mnemonic: "TCALL", mode: :t14, length: 1},
464
+ { opcode: 0xF1, mnemonic: "TCALL", mode: :t15, length: 1},
465
+ { opcode: 0x4E, mnemonic: "TCLR1", mode: :abs, length: 3},
466
+ { opcode: 0x0E, mnemonic: "TSET1", mode: :abs, length: 3},
467
+ { opcode: 0x9F, mnemonic: "XCN", mode: :acc, length: 1}].freeze
468
+ end
469
+ end
470
+ end