Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/nall/snes/smp.hpp
2 views
1
#ifndef NALL_SNES_SMP_HPP
2
#define NALL_SNES_SMP_HPP
3
4
namespace nall {
5
6
struct SNESSMP {
7
enum : unsigned {
8
Implied, //
9
TVector, //0
10
Direct, //$00
11
DirectRelative, //$00,+/-$00
12
ADirect, //a,$00
13
AAbsolute, //a,$0000
14
AIX, //a,(x)
15
AIDirectX, //a,($00+x)
16
AConstant, //a,#$00
17
DirectDirect, //$00,$00
18
CAbsoluteBit, //c,$0000:0
19
Absolute, //$0000
20
P, //p
21
AbsoluteA, //$0000,a
22
Relative, //+/-$00
23
ADirectX, //a,$00+x
24
AAbsoluteX, //a,$0000+x
25
AAbsoluteY, //a,$0000+y
26
AIDirectY, //a,($00)+y
27
DirectConstant, //$00,#$00
28
IXIY, //(x),(y)
29
DirectX, //$00+x
30
A, //a
31
X, //x
32
XAbsolute, //x,$0000
33
IAbsoluteX, //($0000+x)
34
CNAbsoluteBit, //c,!$0000:0
35
XDirect, //x,$00
36
PVector, //$ff00
37
YaDirect, //ya,$00
38
XA, //x,a
39
YAbsolute, //y,$0000
40
Y, //y
41
AX, //a,x
42
YDirect, //y,$00
43
YConstant, //y,#$00
44
XSp, //x,sp
45
YaX, //ya,x
46
IXPA, //(x)+,a
47
SpX, //sp,x
48
AIXP, //a,(x)+
49
DirectA, //$00,a
50
IXA, //(x),a
51
IDirectXA, //($00+x),a
52
XConstant, //x,#$00
53
AbsoluteX, //$0000,x
54
AbsoluteBitC, //$0000:0,c
55
DirectY, //$00,y
56
AbsoluteY, //$0000,y
57
Ya, //ya
58
DirectXA, //$00+x,a
59
AbsoluteXA, //$0000+x,a
60
AbsoluteYA, //$0000+y,a
61
IDirectYA, //($00)+y,a
62
DirectYX, //$00+y,x
63
DirectYa, //$00,ya
64
DirectXY, //$00+x,y
65
AY, //a,y
66
DirectXRelative, //$00+x,+/-$00
67
XDirectY, //x,$00+y
68
YDirectX, //y,$00+x
69
YA, //y,a
70
YRelative, //y,+/-$00
71
};
72
73
struct OpcodeInfo {
74
char name[6];
75
unsigned mode;
76
};
77
78
static const OpcodeInfo opcodeInfo[256];
79
80
static unsigned getOpcodeLength(uint8_t opcode);
81
static string disassemble(uint16_t pc, uint8_t opcode, uint8_t pl, uint8_t ph);
82
static string disassemble(uint16_t pc, bool p, uint8_t opcode, uint8_t pl, uint8_t ph);
83
};
84
85
const SNESSMP::OpcodeInfo SNESSMP::opcodeInfo[256] = {
86
//0x00 - 0x0f
87
{ "nop ", Implied },
88
{ "tcall", TVector },
89
{ "set0 ", Direct },
90
{ "bbs0 ", DirectRelative },
91
92
{ "or ", ADirect },
93
{ "or ", AAbsolute },
94
{ "or ", AIX },
95
{ "or ", AIDirectX },
96
97
{ "or ", AConstant },
98
{ "or ", DirectDirect },
99
{ "or1 ", CAbsoluteBit },
100
{ "asl ", Direct },
101
102
{ "asl ", Absolute },
103
{ "push ", P },
104
{ "tset ", AbsoluteA },
105
{ "brk ", Implied },
106
107
//0x10 - 0x1f
108
{ "bpl ", Relative },
109
{ "tcall", TVector },
110
{ "clr0 ", Direct },
111
{ "bbc0 ", DirectRelative },
112
113
{ "or ", ADirectX },
114
{ "or ", AAbsoluteX },
115
{ "or ", AAbsoluteY },
116
{ "or ", AIDirectY },
117
118
{ "or ", DirectConstant },
119
{ "or ", IXIY },
120
{ "decw ", Direct },
121
{ "asl ", DirectX },
122
123
{ "asl ", A },
124
{ "dec ", X },
125
{ "cmp ", XAbsolute },
126
{ "jmp ", IAbsoluteX },
127
128
//0x20 - 0x2f
129
{ "clrp ", Implied },
130
{ "tcall", TVector },
131
{ "set1 ", Direct },
132
{ "bbs1 ", DirectRelative },
133
134
{ "and ", ADirect },
135
{ "and ", AAbsolute },
136
{ "and ", AIX },
137
{ "and ", AIDirectX },
138
139
{ "and ", AConstant },
140
{ "and ", DirectDirect },
141
{ "or1 ", CNAbsoluteBit },
142
{ "rol ", Direct },
143
144
{ "rol ", Absolute },
145
{ "push ", A },
146
{ "cbne ", DirectRelative },
147
{ "bra ", Relative },
148
149
//0x30 - 0x3f
150
{ "bmi ", Relative },
151
{ "tcall", TVector },
152
{ "clr1 ", Direct },
153
{ "bbc1 ", DirectRelative },
154
155
{ "and ", ADirectX },
156
{ "and ", AAbsoluteX },
157
{ "and ", AAbsoluteY },
158
{ "and ", AIDirectY },
159
160
{ "and ", DirectConstant },
161
{ "and ", IXIY },
162
{ "incw ", Direct },
163
{ "rol ", DirectX },
164
165
{ "rol ", A },
166
{ "inc ", X },
167
{ "cmp ", XDirect },
168
{ "call ", Absolute },
169
170
//0x40 - 0x4f
171
{ "setp ", Implied },
172
{ "tcall", TVector },
173
{ "set2 ", Direct },
174
{ "bbs2 ", DirectRelative },
175
176
{ "eor ", ADirect },
177
{ "eor ", AAbsolute },
178
{ "eor ", AIX },
179
{ "eor ", AIDirectX },
180
181
{ "eor ", AConstant },
182
{ "eor ", DirectDirect },
183
{ "and1 ", CAbsoluteBit },
184
{ "lsr ", Direct },
185
186
{ "lsr ", Absolute },
187
{ "push ", X },
188
{ "tclr ", AbsoluteA },
189
{ "pcall", PVector },
190
191
//0x50 - 0x5f
192
{ "bvc ", Relative },
193
{ "tcall", TVector },
194
{ "clr2 ", Direct },
195
{ "bbc2 ", DirectRelative },
196
197
{ "eor ", ADirectX },
198
{ "eor ", AAbsoluteX },
199
{ "eor ", AAbsoluteY },
200
{ "eor ", AIDirectY },
201
202
{ "eor ", DirectConstant },
203
{ "eor ", IXIY },
204
{ "cmpw ", YaDirect },
205
{ "lsr ", DirectX },
206
207
{ "lsr ", A },
208
{ "mov ", XA },
209
{ "cmp ", YAbsolute },
210
{ "jmp ", Absolute },
211
212
//0x60 - 0x6f
213
{ "clrc ", Implied },
214
{ "tcall", TVector },
215
{ "set3 ", Direct },
216
{ "bbs3 ", DirectRelative },
217
218
{ "cmp ", ADirect },
219
{ "cmp ", AAbsolute },
220
{ "cmp ", AIX },
221
{ "cmp ", AIDirectX },
222
223
{ "cmp ", AConstant },
224
{ "cmp ", DirectDirect },
225
{ "and1 ", CNAbsoluteBit },
226
{ "ror ", Direct },
227
228
{ "ror ", Absolute },
229
{ "push ", Y },
230
{ "dbnz ", DirectRelative },
231
{ "ret ", Implied },
232
233
//0x70 - 0x7f
234
{ "bvs ", Relative },
235
{ "tcall", TVector },
236
{ "clr3 ", Direct },
237
{ "bbc3 ", DirectRelative },
238
239
{ "cmp ", ADirectX },
240
{ "cmp ", AAbsoluteX },
241
{ "cmp ", AAbsoluteY },
242
{ "cmp ", AIDirectY },
243
244
{ "cmp ", DirectConstant },
245
{ "cmp ", IXIY },
246
{ "addw ", YaDirect },
247
{ "ror ", DirectX },
248
249
{ "ror ", A },
250
{ "mov ", AX },
251
{ "cmp ", YDirect },
252
{ "reti ", Implied },
253
254
//0x80 - 0x8f
255
{ "setc ", Implied },
256
{ "tcall", TVector },
257
{ "set4 ", Direct },
258
{ "bbs4 ", DirectRelative },
259
260
{ "adc ", ADirect },
261
{ "adc ", AAbsolute },
262
{ "adc ", AIX },
263
{ "adc ", AIDirectX },
264
265
{ "adc ", AConstant },
266
{ "adc ", DirectDirect },
267
{ "eor1 ", CAbsoluteBit },
268
{ "dec ", Direct },
269
270
{ "dec ", Absolute },
271
{ "mov ", YConstant },
272
{ "pop ", P },
273
{ "mov ", DirectConstant },
274
275
//0x90 - 0x9f
276
{ "bcc ", Relative },
277
{ "tcall", TVector },
278
{ "clr4 ", Direct },
279
{ "bbc4 ", DirectRelative },
280
281
{ "adc ", ADirectX },
282
{ "adc ", AAbsoluteX },
283
{ "adc ", AAbsoluteY },
284
{ "adc ", AIDirectY },
285
286
{ "adc ", DirectRelative },
287
{ "adc ", IXIY },
288
{ "subw ", YaDirect },
289
{ "dec ", DirectX },
290
291
{ "dec ", A },
292
{ "mov ", XSp },
293
{ "div ", YaX },
294
{ "xcn ", A },
295
296
//0xa0 - 0xaf
297
{ "ei ", Implied },
298
{ "tcall", TVector },
299
{ "set5 ", Direct },
300
{ "bbs5 ", DirectRelative },
301
302
{ "sbc ", ADirect },
303
{ "sbc ", AAbsolute },
304
{ "sbc ", AIX },
305
{ "sbc ", AIDirectX },
306
307
{ "sbc ", AConstant },
308
{ "sbc ", DirectDirect },
309
{ "mov1 ", CAbsoluteBit },
310
{ "inc ", Direct },
311
312
{ "inc ", Absolute },
313
{ "cmp ", YConstant },
314
{ "pop ", A },
315
{ "mov ", IXPA },
316
317
//0xb0 - 0xbf
318
{ "bcs ", Relative },
319
{ "tcall", TVector },
320
{ "clr5 ", Direct },
321
{ "bbc5 ", DirectRelative },
322
323
{ "sbc ", ADirectX },
324
{ "sbc ", AAbsoluteX },
325
{ "sbc ", AAbsoluteY },
326
{ "sbc ", AIDirectY },
327
328
{ "sbc ", DirectConstant },
329
{ "sbc ", IXIY },
330
{ "movw ", YaDirect },
331
{ "inc ", DirectX },
332
333
{ "inc ", A },
334
{ "mov ", SpX },
335
{ "das ", A },
336
{ "mov ", AIXP },
337
338
//0xc0 - 0xcf
339
{ "di ", Implied },
340
{ "tcall", TVector },
341
{ "set6 ", Direct },
342
{ "bbs6 ", DirectRelative },
343
344
{ "mov ", DirectA },
345
{ "mov ", AbsoluteA },
346
{ "mov ", IXA },
347
{ "mov ", IDirectXA },
348
349
{ "cmp ", XConstant },
350
{ "mov ", AbsoluteX },
351
{ "mov1 ", AbsoluteBitC },
352
{ "mov ", DirectY },
353
354
{ "mov ", AbsoluteY },
355
{ "mov ", XConstant },
356
{ "pop ", X },
357
{ "mul ", Ya },
358
359
//0xd0 - 0xdf
360
{ "bne ", Relative },
361
{ "tcall", TVector },
362
{ "clr6 ", Relative },
363
{ "bbc6 ", DirectRelative },
364
365
{ "mov ", DirectXA },
366
{ "mov ", AbsoluteXA },
367
{ "mov ", AbsoluteYA },
368
{ "mov ", IDirectYA },
369
370
{ "mov ", DirectX },
371
{ "mov ", DirectYX },
372
{ "movw ", DirectYa },
373
{ "mov ", DirectXY },
374
375
{ "dec ", Y },
376
{ "mov ", AY },
377
{ "cbne ", DirectXRelative },
378
{ "daa ", A },
379
380
//0xe0 - 0xef
381
{ "clrv ", Implied },
382
{ "tcall", TVector },
383
{ "set7 ", Direct },
384
{ "bbs7 ", DirectRelative },
385
386
{ "mov ", ADirect },
387
{ "mov ", AAbsolute },
388
{ "mov ", AIX },
389
{ "mov ", AIDirectX },
390
391
{ "mov ", AConstant },
392
{ "mov ", XAbsolute },
393
{ "not1 ", CAbsoluteBit },
394
{ "mov ", YDirect },
395
396
{ "mov ", YAbsolute },
397
{ "notc ", Implied },
398
{ "pop ", Y },
399
{ "sleep", Implied },
400
401
//0xf0 - 0xff
402
{ "beq ", Relative },
403
{ "tcall", TVector },
404
{ "clr7 ", Direct },
405
{ "bbc7 ", DirectRelative },
406
407
{ "mov ", ADirectX },
408
{ "mov ", AAbsoluteX },
409
{ "mov ", AAbsoluteY },
410
{ "mov ", AIDirectY },
411
412
{ "mov ", XDirect },
413
{ "mov ", XDirectY },
414
{ "mov ", DirectDirect },
415
{ "mov ", YDirectX },
416
417
{ "inc ", Y },
418
{ "mov ", YA },
419
{ "dbz ", YRelative },
420
{ "stop ", Implied },
421
};
422
423
inline unsigned SNESSMP::getOpcodeLength(uint8_t opcode) {
424
switch(opcodeInfo[opcode].mode) { default:
425
case Implied: return 1; //
426
case TVector: return 1; //0
427
case Direct: return 2; //$00
428
case DirectRelative: return 3; //$00,+/-$00
429
case ADirect: return 2; //a,$00
430
case AAbsolute: return 3; //a,$0000
431
case AIX: return 1; //a,(x)
432
case AIDirectX: return 2; //a,($00+x)
433
case AConstant: return 2; //a,#$00
434
case DirectDirect: return 3; //$00,$00
435
case CAbsoluteBit: return 3; //c,$0000:0
436
case Absolute: return 3; //$0000
437
case P: return 1; //p
438
case AbsoluteA: return 3; //$0000,a
439
case Relative: return 2; //+/-$00
440
case ADirectX: return 2; //a,$00+x
441
case AAbsoluteX: return 3; //a,$0000+x
442
case AAbsoluteY: return 3; //a,$0000+y
443
case AIDirectY: return 2; //a,($00)+y
444
case DirectConstant: return 3; //$00,#$00
445
case IXIY: return 1; //(x),(y)
446
case DirectX: return 2; //$00+x
447
case A: return 1; //a
448
case X: return 1; //x
449
case XAbsolute: return 3; //x,$0000
450
case IAbsoluteX: return 3; //($0000+x)
451
case CNAbsoluteBit: return 3; //c,!$0000:0
452
case XDirect: return 2; //x,$00
453
case PVector: return 2; //$ff00
454
case YaDirect: return 2; //ya,$00
455
case XA: return 1; //x,a
456
case YAbsolute: return 3; //y,$0000
457
case Y: return 1; //y
458
case AX: return 1; //a,x
459
case YDirect: return 2; //y,$00
460
case YConstant: return 2; //y,#$00
461
case XSp: return 1; //x,sp
462
case YaX: return 1; //ya,x
463
case IXPA: return 1; //(x)+,a
464
case SpX: return 1; //sp,x
465
case AIXP: return 1; //a,(x)+
466
case DirectA: return 2; //$00,a
467
case IXA: return 1; //(x),a
468
case IDirectXA: return 2; //($00+x),a
469
case XConstant: return 2; //x,#$00
470
case AbsoluteX: return 3; //$0000,x
471
case AbsoluteBitC: return 3; //$0000:0,c
472
case DirectY: return 2; //$00,y
473
case AbsoluteY: return 3; //$0000,y
474
case Ya: return 1; //ya
475
case DirectXA: return 2; //$00+x,a
476
case AbsoluteXA: return 3; //$0000+x,a
477
case AbsoluteYA: return 3; //$0000+y,a
478
case IDirectYA: return 2; //($00)+y,a
479
case DirectYX: return 2; //$00+y,x
480
case DirectYa: return 2; //$00,ya
481
case DirectXY: return 2; //$00+x,y
482
case AY: return 1; //a,y
483
case DirectXRelative: return 3; //$00+x,+/-$00
484
case XDirectY: return 2; //x,$00+y
485
case YDirectX: return 2; //y,$00+x
486
case YA: return 1; //y,a
487
case YRelative: return 2; //y,+/-$00
488
}
489
}
490
491
inline string SNESSMP::disassemble(uint16_t pc, uint8_t opcode, uint8_t pl, uint8_t ph) {
492
string name = opcodeInfo[opcode].name;
493
unsigned mode = opcodeInfo[opcode].mode;
494
unsigned pa = (ph << 8) + pl;
495
496
if(mode == Implied) return name;
497
if(mode == TVector) return { name, " ", opcode >> 4 };
498
if(mode == Direct) return { name, " $", hex<2>(pl) };
499
if(mode == DirectRelative) return { name, " $", hex<2>(pl), ",$", hex<4>(pc + 3 + (int8_t)ph) };
500
if(mode == ADirect) return { name, " a,$", hex<2>(pl) };
501
if(mode == AAbsolute) return { name, " a,$", hex<4>(pa) };
502
if(mode == AIX) return { name, "a,(x)" };
503
if(mode == AIDirectX) return { name, " a,($", hex<2>(pl), "+x)" };
504
if(mode == AConstant) return { name, " a,#$", hex<2>(pl) };
505
if(mode == DirectDirect) return { name, " $", hex<2>(ph), ",$", hex<2>(pl) };
506
if(mode == CAbsoluteBit) return { name, " c,$", hex<4>(pa & 0x1fff), ":", pa >> 13 };
507
if(mode == Absolute) return { name, " $", hex<4>(pa) };
508
if(mode == P) return { name, " p" };
509
if(mode == AbsoluteA) return { name, " $", hex<4>(pa), ",a" };
510
if(mode == Relative) return { name, " $", hex<4>(pc + 2 + (int8_t)pl) };
511
if(mode == ADirectX) return { name, " a,$", hex<2>(pl), "+x" };
512
if(mode == AAbsoluteX) return { name, " a,$", hex<4>(pa), "+x" };
513
if(mode == AAbsoluteY) return { name, " a,$", hex<4>(pa), "+y" };
514
if(mode == AIDirectY) return { name, " a,($", hex<2>(pl), ")+y" };
515
if(mode == DirectConstant) return { name, " $", hex<2>(ph), ",#$", hex<2>(pl) };
516
if(mode == IXIY) return { name, " (x),(y)" };
517
if(mode == DirectX) return { name, " $", hex<2>(pl), "+x" };
518
if(mode == A) return { name, " a" };
519
if(mode == X) return { name, " x" };
520
if(mode == XAbsolute) return { name, " x,$", hex<4>(pa) };
521
if(mode == IAbsoluteX) return { name, " ($", hex<4>(pa), "+x)" };
522
if(mode == CNAbsoluteBit) return { name, " c,!$", hex<4>(pa & 0x1fff), ":", pa >> 13 };
523
if(mode == XDirect) return { name, " x,$", hex<2>(pl) };
524
if(mode == PVector) return { name, " $ff", hex<2>(pl) };
525
if(mode == YaDirect) return { name, " ya,$", hex<2>(pl) };
526
if(mode == XA) return { name, " x,a" };
527
if(mode == YAbsolute) return { name, " y,$", hex<4>(pa) };
528
if(mode == Y) return { name, " y" };
529
if(mode == AX) return { name, " a,x" };
530
if(mode == YDirect) return { name, " y,$", hex<2>(pl) };
531
if(mode == YConstant) return { name, " y,#$", hex<2>(pl) };
532
if(mode == XSp) return { name, " x,sp" };
533
if(mode == YaX) return { name, " ya,x" };
534
if(mode == IXPA) return { name, " (x)+,a" };
535
if(mode == SpX) return { name, " sp,x" };
536
if(mode == AIXP) return { name, " a,(x)+" };
537
if(mode == DirectA) return { name, " $", hex<2>(pl), ",a" };
538
if(mode == IXA) return { name, " (x),a" };
539
if(mode == IDirectXA) return { name, " ($", hex<2>(pl), "+x),a" };
540
if(mode == XConstant) return { name, " x,#$", hex<2>(pl) };
541
if(mode == AbsoluteX) return { name, " $", hex<4>(pa), ",x" };
542
if(mode == AbsoluteBitC) return { name, " $", hex<4>(pa & 0x1fff), ":", pa >> 13, ",c" };
543
if(mode == DirectY) return { name, " $", hex<2>(pl), ",y" };
544
if(mode == AbsoluteY) return { name, " $", hex<4>(pa), ",y" };
545
if(mode == Ya) return { name, " ya" };
546
if(mode == DirectXA) return { name, " $", hex<2>(pl), "+x,a" };
547
if(mode == AbsoluteXA) return { name, " $", hex<4>(pa), "+x,a" };
548
if(mode == AbsoluteYA) return { name, " $", hex<4>(pa), "+y,a" };
549
if(mode == IDirectYA) return { name, " ($", hex<2>(pl), ")+y,a" };
550
if(mode == DirectYX) return { name, " $", hex<2>(pl), "+y,x" };
551
if(mode == DirectYa) return { name, " $", hex<2>(pl), ",ya" };
552
if(mode == DirectXY) return { name, " $", hex<2>(pl), "+x,y" };
553
if(mode == AY) return { name, " a,y" };
554
if(mode == DirectXRelative) return { name, " $", hex<2>(pl), ",$", hex<4>(pc + 3 + (int8_t)ph) };
555
if(mode == XDirectY) return { name, " x,$", hex<2>(pl), "+y" };
556
if(mode == YDirectX) return { name, " y,$", hex<2>(pl), "+x" };
557
if(mode == YA) return { name, " y,a" };
558
if(mode == YRelative) return { name, " y,$", hex<4>(pc + 2 + (int8_t)pl) };
559
560
return "";
561
}
562
563
inline string SNESSMP::disassemble(uint16_t pc, bool p, uint8_t opcode, uint8_t pl, uint8_t ph) {
564
string name = opcodeInfo[opcode].name;
565
unsigned mode = opcodeInfo[opcode].mode;
566
unsigned pdl = (p << 8) + pl;
567
unsigned pdh = (p << 8) + ph;
568
unsigned pa = (ph << 8) + pl;
569
570
if(mode == Implied) return name;
571
if(mode == TVector) return { name, " ", opcode >> 4 };
572
if(mode == Direct) return { name, " $", hex<3>(pdl) };
573
if(mode == DirectRelative) return { name, " $", hex<3>(pdl), ",$", hex<4>(pc + 3 + (int8_t)ph) };
574
if(mode == ADirect) return { name, " a,$", hex<3>(pdl) };
575
if(mode == AAbsolute) return { name, " a,$", hex<4>(pa) };
576
if(mode == AIX) return { name, "a,(x)" };
577
if(mode == AIDirectX) return { name, " a,($", hex<3>(pdl), "+x)" };
578
if(mode == AConstant) return { name, " a,#$", hex<2>(pl) };
579
if(mode == DirectDirect) return { name, " $", hex<3>(pdh), ",$", hex<3>(pdl) };
580
if(mode == CAbsoluteBit) return { name, " c,$", hex<4>(pa & 0x1fff), ":", pa >> 13 };
581
if(mode == Absolute) return { name, " $", hex<4>(pa) };
582
if(mode == P) return { name, " p" };
583
if(mode == AbsoluteA) return { name, " $", hex<4>(pa), ",a" };
584
if(mode == Relative) return { name, " $", hex<4>(pc + 2 + (int8_t)pl) };
585
if(mode == ADirectX) return { name, " a,$", hex<3>(pdl), "+x" };
586
if(mode == AAbsoluteX) return { name, " a,$", hex<4>(pa), "+x" };
587
if(mode == AAbsoluteY) return { name, " a,$", hex<4>(pa), "+y" };
588
if(mode == AIDirectY) return { name, " a,($", hex<3>(pdl), ")+y" };
589
if(mode == DirectConstant) return { name, " $", hex<3>(pdh), ",#$", hex<2>(pl) };
590
if(mode == IXIY) return { name, " (x),(y)" };
591
if(mode == DirectX) return { name, " $", hex<3>(pdl), "+x" };
592
if(mode == A) return { name, " a" };
593
if(mode == X) return { name, " x" };
594
if(mode == XAbsolute) return { name, " x,$", hex<4>(pa) };
595
if(mode == IAbsoluteX) return { name, " ($", hex<4>(pa), "+x)" };
596
if(mode == CNAbsoluteBit) return { name, " c,!$", hex<4>(pa & 0x1fff), ":", pa >> 13 };
597
if(mode == XDirect) return { name, " x,$", hex<3>(pdl) };
598
if(mode == PVector) return { name, " $ff", hex<2>(pl) };
599
if(mode == YaDirect) return { name, " ya,$", hex<3>(pdl) };
600
if(mode == XA) return { name, " x,a" };
601
if(mode == YAbsolute) return { name, " y,$", hex<4>(pa) };
602
if(mode == Y) return { name, " y" };
603
if(mode == AX) return { name, " a,x" };
604
if(mode == YDirect) return { name, " y,$", hex<3>(pdl) };
605
if(mode == YConstant) return { name, " y,#$", hex<2>(pl) };
606
if(mode == XSp) return { name, " x,sp" };
607
if(mode == YaX) return { name, " ya,x" };
608
if(mode == IXPA) return { name, " (x)+,a" };
609
if(mode == SpX) return { name, " sp,x" };
610
if(mode == AIXP) return { name, " a,(x)+" };
611
if(mode == DirectA) return { name, " $", hex<3>(pdl), ",a" };
612
if(mode == IXA) return { name, " (x),a" };
613
if(mode == IDirectXA) return { name, " ($", hex<3>(pdl), "+x),a" };
614
if(mode == XConstant) return { name, " x,#$", hex<2>(pl) };
615
if(mode == AbsoluteX) return { name, " $", hex<4>(pa), ",x" };
616
if(mode == AbsoluteBitC) return { name, " $", hex<4>(pa & 0x1fff), ":", pa >> 13, ",c" };
617
if(mode == DirectY) return { name, " $", hex<3>(pdl), ",y" };
618
if(mode == AbsoluteY) return { name, " $", hex<4>(pa), ",y" };
619
if(mode == Ya) return { name, " ya" };
620
if(mode == DirectXA) return { name, " $", hex<3>(pdl), "+x,a" };
621
if(mode == AbsoluteXA) return { name, " $", hex<4>(pa), "+x,a" };
622
if(mode == AbsoluteYA) return { name, " $", hex<4>(pa), "+y,a" };
623
if(mode == IDirectYA) return { name, " ($", hex<3>(pdl), ")+y,a" };
624
if(mode == DirectYX) return { name, " $", hex<3>(pdl), "+y,x" };
625
if(mode == DirectYa) return { name, " $", hex<3>(pdl), ",ya" };
626
if(mode == DirectXY) return { name, " $", hex<3>(pdl), "+x,y" };
627
if(mode == AY) return { name, " a,y" };
628
if(mode == DirectXRelative) return { name, " $", hex<3>(pdl), ",$", hex<4>(pc + 3 + (int8_t)ph) };
629
if(mode == XDirectY) return { name, " x,$", hex<3>(pdl), "+y" };
630
if(mode == YDirectX) return { name, " y,$", hex<3>(pdl), "+x" };
631
if(mode == YA) return { name, " y,a" };
632
if(mode == YRelative) return { name, " y,$", hex<4>(pc + 2 + (int8_t)pl) };
633
634
return "";
635
}
636
637
}
638
639
#endif
640
641