summaryrefslogtreecommitdiff
path: root/enums.h
blob: 955c27c6a324b8b7846021b5ebe96801ce1c6737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
enum am {
	/* Part of Base ISA. */
	IMM,  /* Immediate Data. */
	ZM,   /* Zero Matrix. */
	ZMX,  /* Zero Matrix, indexed with X. */
	ZMY,  /* Zero Matrix, indexed with Y. */
	IND,  /* Indirect. */
	INDX, /* Indexed Indirect. */
	INDY, /* Indirect Indexed. */
	ABS,  /* Absolute. */
	REL,  /* Relative to Program Counter. */
	IMPL, /* Implied. */
	/* Part of Base Extension. */
	ABSX, /* Absolute, Indexed with X. */
	ABSY, /* Absolute, Indexed with Y. */
	SPI,  /* Stack Pointer, Immediate Offset. */
	SPX,  /* Stack Pointer, Offset with X. */
	SPY,  /* Stack Pointer, Offset with Y. */
	INA,  /* Absolute Indirect. */
	INAX, /* Absolute Indexed Indirect. */
	INAY, /* Absolute Indirect Indexed. */
	EIND, /* Effective Address Register, Indirect. */
};

enum mne {
	AAB =  0,
	ABA =  1,
	ADC =  2,
	AND =  3,
	ARB =  4,
	ASR =  5,
	BCC =  6,
	BCS =  7,
	BEQ =  8,
	BNE =  9,
	BNG = 10,
	BPO = 11,
	BRA = 12,
	BRK = 13,
	BVC = 14,
	BVS = 15,
	CAB = 16,
	CLC = 17,
	CLI = 18,
	CLV = 19,
	CMP = 20,
	CPB = 21,
	CPS = 22,
	CPX = 23,
	CPY = 24,
	DAB = 25,
	DEB = 26,
	DEC = 27,
	DEX = 28,
	DEY = 29,
	DIV = 30,
	INB = 31,
	INC = 32,
	INX = 33,
	INY = 34,
	JMP = 35,
	JSR = 36,
	LDA = 37,
	LDB = 38,
	LDX = 39,
	LDY = 40,
	LLB = 41,
	LRB = 42,
	LSL = 43,
	LSR = 44,
	MAB = 45,
	MUL = 46,
	NOP = 47,
	OAB = 48,
	ORA = 49,
	PHA = 50,
	PHB = 51,
	PHP = 52,
	PHX = 53,
	PHY = 54,
	PLA = 55,
	PLB = 56,
	PLP = 57,
	PLX = 58,
	PLY = 59,
	RLB = 60,
	ROL = 61,
	ROR = 62,
	RRB = 63,
	RTI = 64,
	RTS = 65,
	SAB = 66,
	SBC = 67,
	SEC = 68,
	SEI = 69,
	STA = 70,
	STB = 71,
	STX = 72,
	STY = 73,
	TAB = 74,
	TAX = 75,
	TAY = 76,
	TBA = 77,
	TSX = 78,
	TXA = 79,
	TXS = 80,
	TXY = 81,
	TYA = 82,
	TYX = 83,
	WAI = 84,
	XAB = 85,
	XOR = 86
};

enum base_isa {
	CPS_IMP = 0x00, /* Clear Processor Status. */
	ADC_IMM = 0x01, /* ADd with Carry. */
	AAB_IMP = 0x02, /* Add Accumulator with carry by B register. */
	ADC_AB  = 0x04, /* ADC Absolute. */
	LDA_IN  = 0x05, /* LDA Indirect */
	ADC_Z   = 0x06, /* ADC Zero Matrix. */
	CLC_IMP = 0x08, /* CLear Carry flag. */
	DEX_IMP = 0x09, /* DEcrement X register. */
	DEC_IMP = 0x0A, /* DECrement accumulator. */
	DEC_AB  = 0x0C, /* DEC Absolute. */
	DEC_Z   = 0x0D, /* DEC Zero Matrix. */
	JMP_AB  = 0x10, /* JMP Absolute. */
	SBC_IMM = 0x11, /* SuBtract with Carry. */
	SAB_IMP = 0x12, /* Subtract Accumulator with carry by B register. */
	SBC_AB  = 0x14, /* SBC Absolute. */
	STA_IN  = 0x15, /* STA Indirect */
	SBC_Z   = 0x16, /* SBC Zero Matrix. */
	SEC_IMP = 0x18, /* SEt Carry flag. */
	INX_IMP = 0x19, /* INcrement X register. */
	INC_IMP = 0x1A, /* INCrement accumulator. */
	INC_AB  = 0x1C, /* INC Absolute. */
	INC_Z   = 0x1D, /* INC Zero Matrix. */
	JSR_AB  = 0x20, /* JSR Absolute. */
	AND_IMM = 0x21, /* bitwise AND with accumulator. */
	ABA_IMP = 0x22, /* bitwise And with Accumulator, and B register. */
	AND_AB  = 0x24, /* AND Absolute. */
	CMP_IN  = 0x25, /* CMP Indirect */
	AND_Z   = 0x26, /* AND Zero Matrix. */
	CLI_IMP = 0x28, /* CLear Interupt flag. */
	DEY_IMP = 0x29, /* DEcrement Y register. */
	CPB_IMM = 0x2A, /* ComPare B register. */
	CPB_AB  = 0x2C, /* CPB Absolute. */
	CPB_Z   = 0x2D, /* CPB Zero Matrix. */
	JMP_Z   = 0x30, /* JuMP to memory location. */
	ORA_IMM = 0x31, /* bitwise OR with Accumulator. */
	OAB_IMP = 0x32, /* bitwise Or with Accumulator, and B register. */
	ORA_AB  = 0x34, /* ORA Absolute. */
	LDB_IN  = 0x35, /* LDB Indirect */
	ORA_Z   = 0x36, /* ORA Zero Matrix. */
	SEI_IMP = 0x38, /* SEt Interupt flag. */
	INY_IMP = 0x39, /* INcrement Y register. */
	CPX_IMM = 0x3A, /* ComPare X register. */
	CPX_AB  = 0x3C, /* CPX Absolute. */
	CPY_Z   = 0x3D, /* CPY Zero Matrix. */
	JSR_Z   = 0x40, /* Jump to SubRoutine. */
	XOR_IMM = 0x41, /* bitwise XOR with accumulator. */
	XAB_IMP = 0x42, /* bitwise Xor with Accumulator, and B register. */
	XOR_AB  = 0x44, /* XOR Absolute. */
	STB_IN  = 0x45, /* STB Indirect */
	XOR_Z   = 0x46, /* XOR Zero Matrix. */
	CLV_IMP = 0x48, /* CLear oVerflow flag. */
	CPY_IMM = 0x4A, /* ComPare Y register. */
	CPY_AB  = 0x4C, /* CPY Absolute. */
	CPX_Z   = 0x4D, /* CPX Zero Matrix. */
	BPO_REL = 0x50, /* Branch if POsitive. */
	LSL_IMM = 0x51, /* Logical Shift Left. */
	LLB_IMP = 0x52, /* Logical shift Left accumulator by B. */
	LSL_AB  = 0x54, /* LSL Absolute. */
	CPB_IN  = 0x55, /* CPB Indirect */
	LSL_Z   = 0x56, /* LSL Zero Matrix. */
	WAI_IMP = 0x58, /* WAit for Interrupt. */
	PHP_IMP = 0x59, /* PusH Processor status to stack. */
	TAB_IMP = 0x5A, /* Transfer Accumulator to B.  */
	LDA_IY  = 0x5C, /* LDA Indirect Indexed. */
	LDA_IX  = 0x5D, /* LDA Indexed Indirect. */
	BNG_REL = 0x60, /* Branch if NeGative. */
	LSR_IMM = 0x61, /* Logical Shift Right. */
	LRB_IMP = 0x62, /* Logical shift Right accumulator by B. */
	LSR_AB  = 0x64, /* LSR Absolute. */
	LDY_IN  = 0x65, /* LDY Indirect */
	LSR_Z   = 0x66, /* LSR Zero Matrix. */
	BRK_IMP = 0x68, /* BReaK. */
	PLP_IMP = 0x69, /* PuLl Processor status from stack. */
	TBA_IMP = 0x6A, /* Transfer B to Accumulator.  */
	STA_IY  = 0x6C, /* STA Indirect Indexed. */
	STA_IX  = 0x6D, /* STA Indexed Indirect. */
	BCS_REL = 0x70, /* Branch if Carry Set. */
	ROL_IMM = 0x71, /* ROtate Left. */
	RLB_IMP = 0x72, /* Rotate Left accumulator by B. */
	ROL_AB  = 0x74, /* ROL Absolute. */
	STY_IN  = 0x75, /* STY Indirect */
	ROL_Z   = 0x76, /* ROL Zero Matrix. */
	LDA_ZY  = 0x78, /* LDA Zero Marrix, Indexed with Y. */
	PHA_IMP = 0x79, /* PusH Accumulator to stack. */
	TAY_IMP = 0x7A, /* Transfer Accumulator to Y. */
	CMP_IY  = 0x7C, /* CMP Indirect Indexed. */
	CMP_IX  = 0x7D, /* CMP Indexed Indirect. */
	BCC_REL = 0x80, /* Branch if Carry Clear. */
	ROR_IMM = 0x81, /* ROtate Right. */
	RRB_IMP = 0x82, /* Rotate Right accumulator by B. */
	ROR_AB  = 0x84, /* ROR Absolute. */
	LDX_IN  = 0x85, /* LDX Indirect */
	ROR_Z   = 0x86, /* ROR Zero Matrix. */
	STA_ZY  = 0x88, /* STA Zero Marrix, Indexed with Y. */
	PLA_IMP = 0x89, /* PuLl Accumulator from stack. */
	TYA_IMP = 0x8A, /* Transfer Y to Accumulator. */
	LDB_IY  = 0x8C, /* LDB Indirect Indexed. */
	LDB_IX  = 0x8D, /* LDB Indexed Indirect. */
	BEQ_REL = 0x90, /* Branch if EQual. */
	MUL_IMM = 0x91, /* MULtiply accumulator. */
	MAB_IMP = 0x92, /* Multiply Accumulator by B. */
	MUL_AB  = 0x94, /* MUL Absolute. */
	STX_IN  = 0x95, /* STX Indirect */
	MUL_Z   = 0x96, /* MUL Zero Matrix. */
	LDB_ZY  = 0x98, /* LDB Zero Marrix, Indexed with Y. */
	PHB_IMP = 0x99, /* PusH B register to stack. */
	TAX_IMP = 0x9A, /* Transfer Accumulator to X. */
	STB_IY  = 0x9C, /* STB Indirect Indexed. */
	STB_IX  = 0x9D, /* STB Indexed Indirect. */
	BNE_REL = 0xA0, /* Branch if Not Equal. */
	DIV_IMM = 0xA1, /* DIVide with accumulator. */
	DAB_IMP = 0xA2, /* Divide Accumulator by B. */
	DIV_AB  = 0xA4, /* DIV Absolute. */
	JSR_IN  = 0xA5, /* JSR Indirect */
	DIV_Z   = 0xA6, /* DIV Zero Matrix. */
	STB_ZY  = 0xA8, /* STB Zero Marrix, Indexed with Y. */
	PLB_IMP = 0xA9, /* PuLl B register to stack. */
	TXA_IMP = 0xAA, /* Transfer X to Accumulator. */
	CPB_IY  = 0xAC, /* CPB Indirect Indexed. */
	CPB_IX  = 0xAD, /* CPB Indexed Indirect. */
	BVS_REL = 0xB0, /* Branch if oVerflow Set. */
	CMP_IMM = 0xB1, /* CoMPare accumulator. */
	CAB_IMP = 0xB2, /* Compare Accumulator, and B. */
	CMP_AB  = 0xB4, /* CMP Absolute. */
	JMP_IN  = 0xB5, /* JMP Indirect */
	CMP_Z   = 0xB6, /* CMP Zero Matrix. */
	LDA_ZX  = 0xB8, /* LDA Zero Marrix, Indexed with X. */
	LDX_IMM = 0xB9, /* LoaD X register. */
	TYX_IMP = 0xBA, /* Transfer Y to X. */
	LDX_AB  = 0xBC, /* LDX Absolute. */
	LDX_Z   = 0xBD, /* LDX Zero Matrix. */
	BVC_REL = 0xC0, /* Branch if oVerflow Clear. */
	LDA_IMM = 0xC1, /* LoaD Accumulator. */
	DEB_IMP = 0xC2, /* Decrement B register. */
	LDA_AB  = 0xC4, /* LDA Absolute. */
	LDA_Z   = 0xC6, /* LDA Zero Matrix. */
	STA_ZX  = 0xC8, /* STA Zero Marrix, Indexed with X. */
	PHY_IMP = 0xC9, /* PusH Y register to stack. */
	TXY_IMP = 0xCA, /* Transfer X to Y. */
	STA_AB  = 0xCC, /* STA Absolute. */
	STA_Z   = 0xCD, /* STore Accumulator. */
	BRA_REL = 0xD0, /* BRanch Always. */
	LDB_IMM = 0xD1, /* LoaD B register. */
	INB_IMP = 0xD2, /* Increment B register. */
	LDB_AB  = 0xD4, /* LDB Absolute. */
	LDB_Z   = 0xD6, /* LDB Zero Matrix. */
	LDB_ZX  = 0xD8, /* LDB Zero Marrix, Indexed with X. */
	PLY_IMP = 0xD9, /* PuLl Y register from stack. */
	TSX_IMP = 0xDA, /* Transfer Stack pointer to X. */
	STB_AB  = 0xDC, /* STB Absolute. */
	STB_Z   = 0xDD, /* STore B register. */
	RTS_IMP = 0xE0, /* ReTurn from Subroutine. */
	LDY_IMM = 0xE1, /* LoaD Y register. */
	LDY_AB  = 0xE4, /* LDY Absolute. */
	LDY_Z   = 0xE6, /* LDY Zero Matrix. */
	STB_ZX  = 0xE8, /* STB Zero Marrix, Indexed with X. */
	PHX_IMP = 0xE9, /* PusH X register to stack. */
	NOP_IMP = 0xEA, /* No OPeration. */
	STY_AB  = 0xEC, /* STY Absolute. */
	STY_Z   = 0xED, /* STore Y register. */
	RTI_IMP = 0xF0, /* ReTurn from Interrupt. */
	ASR_IMM = 0xF1, /* Arithmetic Shift Right. */
	ARB_IMP = 0xF2, /* Arithmetic shift Right accumulator by B. */
	ASR_AB  = 0xF4, /* ASR Absolute. */
	ASR_Z   = 0xF6, /* ASR Zero Matrix. */
	PLX_IMP = 0xF9, /* PuLl X register from stack. */
	TXS_IMM = 0xFA, /* Transfer X to Stack pointer. */
	STX_AB  = 0xFC, /* STX Absolute. */
	STX_Z   = 0xFD  /* STore X register. */
};

enum base_ext {
	ADC_E   = 0x01, /* ADC E Indirect. */
	LEA_ZX  = 0x02, /* LEA Zero Matrix, indexed with X. */
	LEA_SX  = 0x03, /* LEA Stack Pointer, offset with X. */
	ADD     = 0x04, /* ADD without carry. */
	LLM     = 0x05, /* Logical shift Left, on Memory. */
	PHE     = 0x08, /* PusH Effective address register to stack. */
	CPB_E   = 0x09, /* CPB E Indirect. */
	DEC_E   = 0x0C, /* DEC E Indirect. */
	JMP_E   = 0x10, /* JMP E Indirect. */
	SBC_E   = 0x11, /* SBC E Indirect. */
	LEA_ZY  = 0x12, /* LEA Zero Matrix, indexed with Y. */
	LEA_SY  = 0x13, /* LEA Stack Pointer, offset with Y. */
	ADD_E   = 0x14, /* ADD E Indirect. */
	LLM_Z   = 0x15, /* LLM Zero Matrix. */
	CPY_E   = 0x19, /* CPY E Indirect. */
	INC_E   = 0x1C, /* INC E Indirect. */
	JSR_E   = 0x20, /* JSR E Indirect. */
	AND_E   = 0x21, /* AND E Indirect. */
	PEA_ZX  = 0x22, /* PEA Zero Matrix, indexed with X. */
	PEA_SX  = 0x23, /* PEA Stack Pointer, offset with X. */
	SUB     = 0x24, /* SUBtract without carry. */
	LLM_E   = 0x25, /* LLM E Indirect. */
	PLE     = 0x28, /* PuLl Effective address register from stack. */
	CPX_E   = 0x29, /* CPX E Indirect. */
	DEE     = 0x2C, /* DEcrement Effective address register. */
	BPO_E   = 0x30, /* BPO E Indirect. */
	ORA_E   = 0x31, /* ORA E Indirect. */
	PEA_ZY  = 0x32, /* PEA Zero Matrix, indexed with Y. */
	PEA_SY  = 0x33, /* PEA Stack Pointer, offset with Y. */
	SUB_E   = 0x34, /* SUB E Indirect. */
	LRM     = 0x35, /* Logical shift Right, on Memory. */
	CPE     = 0x39, /* ComPare Effective address register. */
	INE     = 0x3C, /* INcrement Effective address register. */
	BNG_E   = 0x40, /* BNG E Indirect. */
	XOR_E   = 0x41, /* XOR E Indirect. */
	LEA_AX  = 0x42, /* LEA Absolute, indexed with X. */
	LEA_SI  = 0x43, /* LEA Stack Pointer, Immediate offset. */
	ADE     = 0x44, /* ADd Effective address register. */
	LRM_Z   = 0x45, /* LRM Zero Matrix. */
	CPE_AB  = 0x49, /* CPE Absolute. */
	DES     = 0x4C, /* DEcrement Stack pointer. */
	BCS_E   = 0x50, /* BCS E Indirect. */
	LSL_E   = 0x51, /* LSL E Indirect. */
	LEA_AY  = 0x52, /* LEA Absolute, indexed with Y. */
	LEA_RE  = 0x53, /* LEA Relative. */
	ADE_A   = 0x54, /* ADE with Accumulator. */
	LRM_E   = 0x55, /* LRM E Indirect. */
	CPE_Z   = 0x59, /* CPE Zero Matrix. */
	INS     = 0x5C, /* INcrement Stack pointer. */
	BCC_E   = 0x60, /* BCC E Indirect. */
	LSR_E   = 0x61, /* LSR E Indirect. */
	PEA_AX  = 0x62, /* PEA Absolute, indexed with X. */
	PEA_SI  = 0x63, /* PEA Stack Pointer, Immediate offset. */
	SBE     = 0x64, /* SuBtract Effective address register. */
	RLM     = 0x65, /* Rotate Left, on Memory. */
	ICE     = 0x69, /* Interlocked Compare, and Exchange. */
	BEQ_E   = 0x70, /* BEQ E Indirect. */
	ROL_E   = 0x71, /* ROL E Indirect. */
	PEA_AY  = 0x72, /* PEA Absolute, indexed with Y. */
	PEA_RE  = 0x73, /* PEA Relative. */
	RLM_Z   = 0x75, /* RLM Zero Matrix. */
	ICE_Z   = 0x79, /* ICE Zero Matrix. */
	STE     = 0x7C, /* STore Effective address register. */
	BNE_E   = 0x80, /* BNE E Indirect. */
	ROR_E   = 0x81, /* ROR E Indirect. */
	LEA_IX  = 0x82, /* LEA Indexed Indirect. */
	LEA_IN  = 0x83, /* LEA Indirect. */
	ADS     = 0x84, /* ADd Stack pointer. */
	RLM_E   = 0x85, /* RLM E Indirect. */
	ICE_E   = 0x89, /* ICE E Indirect. */
	STE_Z   = 0x8C, /* STE Zero Matrix. */
	BVS_E   = 0x90, /* BVS E Indirect. */
	MUL_E   = 0x91, /* MUL E Indirect. */
	LEA_IY  = 0x92, /* LEA Indirect Indexed. */
	LEA_AI  = 0x93, /* LEA Absolute Indirect. */
	ADS_A   = 0x94, /* ADS with Accumulator. */
	RRM     = 0x95, /* Rotate Right, on Memory. */
	STZ     = 0x9C, /* STore Zero. */
	BVC_E   = 0xA0, /* BVC E Indirect. */
	DIV_E   = 0xA1, /* DIV E Indirect. */
	PEA_IX  = 0xA2, /* PEA Indexed Indirect. */
	PEA_IN  = 0xA3, /* PEA Indirect. */
	SBS     = 0xA4, /* SuBtract Stack pointer. */
	RRM_ZM  = 0xA5, /* RRM Zero Matrix. */
	STZ_ZM  = 0xAC, /* STZ Zero Matrix. */
	CMP_E   = 0xB1, /* CMP E Indirect. */
	PEA_IY  = 0xB2, /* PEA Indirect Indexed. */
	PEA_AI  = 0xB3, /* PEA Absolute Indirect. */
	SBS_A   = 0xB4, /* SBS with Accumulator. */
	RRM_E   = 0xB5, /* RRM E Indirect. */
	LDX_E   = 0xB9, /* LDX E Indirect. */
	STZ_E   = 0xBC, /* STZ E Indirect. */
	LDA_E   = 0xC1, /* LDA E Indirect. */
	LEA_AIX = 0xC2, /* LEA Absolute Indexed Indirect. */
	LEA_Z   = 0xC3, /* LEA Zero Matrix. */
	NOT     = 0xC4, /* bitwise NOT with accumulator. */
	ARM     = 0xC5, /* Arithmetic shift Right, on Memory. */
	LDE     = 0xC9, /* LoaD Effective address register. */
	STA_E   = 0xCC, /* STA E Indirect. */
	LDB_E   = 0xD1, /* LDB E Indirect. */
	LEA_AIY = 0xD2, /* LEA Absolute Indirect Indexed. */
	LEA     = 0xD3, /* Load Effective Address. */
	NOT_AB  = 0xD4, /* NOT Absolute. */
	ARM_Z   = 0xD5, /* ARM Zero Matrix. */
	LDE_AB  = 0xD9, /* LDE Absolute. */
	STB_E   = 0xDC, /* STB E Indirect. */
	LDY_E   = 0xE1, /* LDY E Indirect. */
	PEA_AIX = 0xE2, /* PEA Absolute Indexed Indirect. */
	PEA_Z   = 0xE3, /* PEA Zero Matrix. */
	NOT_Z   = 0xE4, /* NOT Zero Matrix. */
	ARM_E   = 0xE5, /* ARM E Indirect. */
	LDE_Z   = 0xE9, /* LDE Zero Matrix. */
	STY_E   = 0xEC, /* STY E Indirect. */
	ASR_E   = 0xF1, /* ASR E Indirect. */
	PEA_AIY = 0xF2, /* PEA Absolute Indirect Indexed. */
	PEA     = 0xF3, /* Push Effective Address. */
	NOT_E   = 0xF4, /* NOT E Indirect. */
	STX_E   = 0xFC, /* STX E Indirect. */
};