workaround a problem with the harmattan gcc
[drnoksnes] / fxdbg.cpp
1 /*
2  * Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3  *
4  * (c) Copyright 1996 - 2001 Gary Henderson (gary.henderson@ntlworld.com) and
5  *                           Jerremy Koot (jkoot@snes9x.com)
6  *
7  * Super FX C emulator code 
8  * (c) Copyright 1997 - 1999 Ivar (ivar@snes9x.com) and
9  *                           Gary Henderson.
10  * Super FX assembler emulator code (c) Copyright 1998 zsKnight and _Demo_.
11  *
12  * DSP1 emulator code (c) Copyright 1998 Ivar, _Demo_ and Gary Henderson.
13  * C4 asm and some C emulation code (c) Copyright 2000 zsKnight and _Demo_.
14  * C4 C code (c) Copyright 2001 Gary Henderson (gary.henderson@ntlworld.com).
15  *
16  * DOS port code contains the works of other authors. See headers in
17  * individual files.
18  *
19  * Snes9x homepage: http://www.snes9x.com
20  *
21  * Permission to use, copy, modify and distribute Snes9x in both binary and
22  * source form, for non-commercial purposes, is hereby granted without fee,
23  * providing that this license information and copyright notice appear with
24  * all copies and any derived work.
25  *
26  * This software is provided 'as-is', without any express or implied
27  * warranty. In no event shall the authors be held liable for any damages
28  * arising from the use of this software.
29  *
30  * Snes9x is freeware for PERSONAL USE only. Commercial users should
31  * seek permission of the copyright holders first. Commercial use includes
32  * charging money for Snes9x or software derived from Snes9x.
33  *
34  * The copyright holders request that bug fixes and improvements to the code
35  * should be forwarded to them so everyone can benefit from the modifications
36  * in future versions.
37  *
38  * Super NES and Super Nintendo Entertainment System are trademarks of
39  * Nintendo Co., Limited and its subsidiary companies.
40  */
41
42 #include "fxemu.h"
43 #include "fxinst.h"
44 #include <stdio.h>
45 #include <string.h>
46
47 extern const char *fx_apvMnemonicTable[];
48 extern struct FxRegs_s GSU;
49
50
51 /*
52   When printing a line from the pipe, it could look like this:
53
54   01:8006 f4 fb 86 iwt r4,#$86fb
55
56   The values are:
57   program bank: 01
58   adress: 8006
59   values at memory address 8006: f4 fb 86
60   instruction in the pipe: iwt r4,#$86fb
61
62   Note! If the instruction has more than one byte (like in 'iwt')
63   and the instruction is in a delay slot, the second and third
64   byte displayed will not be the same as those used.
65   Since the instrction is in a delay slot, the first byte
66   of the instruction will be taken from the pipe at the address
67   after the branch instruction, and the next one or two bytes
68   will be taken from the address that the branch points to.
69   This is a bit complicated, but I've taken this into account,
70   in this debug function. (See the diffrence of how the values
71   vPipe1 and vPipe2 are read, compared to the values vByte1 and
72   vByte2)
73    
74   */
75 void FxPipeString(char * pvString)
76 {
77     char *p;
78     uint32 vOpcode = (GSU.vStatusReg & 0x300) | ((uint32)PIPE);
79     const char *m = fx_apvMnemonicTable[vOpcode];
80     uint8 vPipe1,vPipe2,vByte1,vByte2;
81     uint8 vPipeBank = GSU.vPipeAdr >> 16;
82         
83     /* The next two bytes after the pipe's address */
84     vPipe1 = GSU.apvRomBank[vPipeBank][USEX16(GSU.vPipeAdr+1)];
85     vPipe2 = GSU.apvRomBank[vPipeBank][USEX16(GSU.vPipeAdr+2)];
86     
87     /* The actual next two bytes to be read */
88     vByte1 = PRGBANK(USEX16(R15));
89     vByte2 = PRGBANK(USEX16(R15+1));
90
91     /* Print ROM address of the pipe */
92     sprintf(pvString, "%02x:%04x %02x       ",
93             USEX8(vPipeBank), USEX16(GSU.vPipeAdr), USEX8(PIPE));
94     p = &pvString[strlen(pvString)];
95  
96     /* Check if it's a branch instruction */
97     if( PIPE >= 0x05 && PIPE <= 0x0f )
98     {
99         sprintf(&pvString[11], "%02x    ", USEX8(vPipe1));
100 #ifdef BRANCH_DELAY_RELATIVE
101         sprintf(p, m, USEX16(R15 + SEX8(vByte1) + 1 ) );
102 #else
103         sprintf(p, m, USEX16(R15 + SEX8(vByte1) - 1 ) );
104 #endif
105     }
106     /* Check for 'move' instruction */
107     else if( PIPE >= 0x10 && PIPE <= 0x1f && TF(B) )
108         sprintf(p, "move r%d,r%d", USEX8(PIPE & 0x0f), GSU.pvSreg - GSU.avReg);
109     /* Check for 'ibt', 'lms' or 'sms' */
110     else if( PIPE >= 0xa0 && PIPE <= 0xaf )
111     {
112         sprintf(&pvString[11], "%02x    ", USEX8(vPipe1));
113         if( (GSU.vStatusReg & 0x300) == 0x100 || (GSU.vStatusReg & 0x300) == 0x200 )
114             sprintf(p, m, USEX16(vByte1) << 1 );
115         else
116             sprintf(p, m, USEX16(vByte1) );
117     }
118     /* Check for 'moves' */
119     else if( PIPE >= 0xb0 && PIPE <= 0xbf && TF(B) )
120         sprintf(p, "moves r%d,r%d", GSU.pvDreg - GSU.avReg, USEX8(PIPE & 0x0f) );
121     /* Check for 'iwt', 'lm' or 'sm' */
122     else if( PIPE >= 0xf0 )
123     {
124         sprintf(&pvString[11], "%02x %02x ", USEX8(vPipe1), USEX8(vPipe2));
125         sprintf(p, m, USEX8(vByte1) | (USEX16(vByte2)<<8) );
126     }
127     /* Normal instruction */
128     else
129         strcpy(p, m);
130 }
131
132 const char *fx_apvMnemonicTable[] =
133 {
134     /*
135      * ALT0 Table
136      */
137     /* 00 - 0f */
138     "stop",    "nop",     "cache",    "lsr",      "rol",      "bra $%04x","blt $%04x","bge $%04x",
139     "bne $%04x","beq $%04x","bpl $%04x","bmi $%04x","bcc $%04x","bcs $%04x","bvc $%04x","bvs $%04x",
140     /* 10 - 1f */
141     "to r0",   "to r1",   "to r2",    "to r3",    "to r4",    "to r5",    "to r6",    "to r7",
142     "to r8",   "to r9",   "to r10",   "to r11",   "to r12",   "to r13",   "to r14",   "to r15",
143     /* 20 - 2f */
144     "with r0", "with r1", "with r2",  "with r3",  "with r4",  "with r5",  "with r6",  "with r7", 
145     "with r8", "with r9", "with r10", "with r11", "with r12", "with r13", "with r14", "with r15",
146     /* 30 - 3f */
147     "stw (r0)","stw (r1)","stw (r2)", "stw (r3)", "stw (r4)", "stw (r5)", "stw (r6)", "stw (r7)",
148     "stw (r8)","stw (r9)","stw (r10)","stw (r11)","loop",     "alt1",     "alt2",     "alt3",
149     /* 40 - 4f */
150     "ldw (r0)","ldw (r1)","ldw (r2)", "ldw (r3)", "ldw (r4)", "ldw (r5)", "ldw (r6)", "ldw (r7)",
151     "ldw (r8)","ldw (r9)","ldw (r10)","ldw (r11)","plot",     "swap",     "color",    "not",
152     /* 50 - 5f */
153     "add r0",  "add r1",  "add r2",   "add r3",   "add r4",   "add r5",   "add r6",   "add r7",
154     "add r8",  "add r9",  "add r10",  "add r11",  "add r12",  "add r13",  "add r14",  "add r15",
155     /* 60 - 6f */
156     "sub r0",  "sub r1",  "sub r2",   "sub r3",   "sub r4",   "sub r5",   "sub r6",   "sub r7",
157     "sub r8",  "sub r9",  "sub r10",  "sub r11",  "sub r12",  "sub r13",  "sub r14",  "sub r15",
158     /* 70 - 7f */
159     "merge",   "and r1",  "and r2",   "and r3",   "and r4",   "and r5",   "and r6",   "and r7",
160     "and r8",  "and r9",  "and r10",  "and r11",  "and r12",  "and r13",  "and r14",  "and r15",
161     /* 80 - 8f */
162     "mult r0", "mult r1", "mult r2",  "mult r3",  "mult r4",  "mult r5",  "mult r6",  "mult r7",
163     "mult r8", "mult r9", "mult r10", "mult r11", "mult r12", "mult r13", "mult r14", "mult r15",
164     /* 90 - 9f */
165     "sbk",     "link #1", "link #2",  "link #3",  "link #4",  "sex",      "asr",      "ror",
166     "jmp (r8)","jmp (r9)","jmp (r10)","jmp (r11)","jmp (r12)","jmp (r13)","lob",      "fmult",
167     /* a0 - af */
168     "ibt r0,#$%02x",  "ibt r1,#$%02x",  "ibt r2,#$%02x",   "ibt r3,#$%02x",
169     "ibt r4,#$%02x",  "ibt r5,#$%02x",  "ibt r6,#$%02x",   "ibt r7,#$%02x",
170     "ibt r8,#$%02x",  "ibt r9,#$%02x",  "ibt r10,#$%02x",  "ibt r11,#$%02x",
171     "ibt r12,#$%02x", "ibt r13,#$%02x", "ibt r14,#$%02x",  "ibt r15,#$%02x",
172     /* b0 - bf */
173     "from r0", "from r1", "from r2",  "from r3",  "from r4",  "from r5",  "from r6",  "from r7",
174     "from r8", "from r9", "from r10", "from r11", "from r12", "from r13", "from r14", "from r15",
175     /* c0 - cf */
176     "hib",     "or r1",   "or r2",    "or r3",    "or r4",    "or r5",    "or r6",    "or r7",
177     "or r8",   "or r9",   "or r10",   "or r11",   "or r12",   "or r13",   "or r14",   "or r15",
178     /* d0 - df */
179     "inc r0",  "inc r1",  "inc r2",   "inc r3",   "inc r4",   "inc r5",   "inc r6",   "inc r7",
180     "inc r8",  "inc r9",  "inc r10",  "inc r11",  "inc r12",  "inc r13",  "inc r14",  "getc",
181     /* e0 - ef */
182     "dec r0",  "dec r1",  "dec r2",   "dec r3",   "dec r4",   "dec r5",   "dec r6",   "dec r7",
183     "dec r8",  "dec r9",  "dec r10",  "dec r11",  "dec r12",  "dec r13",  "dec r14",  "getb",
184     /* f0 - ff */
185     "iwt r0,#$%04x",  "iwt r1,#$%04x",  "iwt r2,#$%04x",   "iwt r3,#$%04x",
186     "iwt r4,#$%04x",  "iwt r5,#$%04x",  "iwt r6,#$%04x",   "iwt r7,#$%04x",
187     "iwt r8,#$%04x",  "iwt r9,#$%04x",  "iwt r10,#$%04x",  "iwt r11,#$%04x",
188     "iwt r12,#$%04x", "iwt r13,#$%04x", "iwt r14,#$%04x",  "iwt r15,#$%04x",
189
190     /*
191      * ALT1 Table
192      */
193
194     /* 00 - 0f */
195     "stop",    "nop",     "cache",    "lsr",      "rol",      "bra $%04x","blt $%04x","bge $%04x",
196     "bne $%04x","beq $%04x","bpl $%04x","bmi $%04x","bcc $%04x","bcs $%04x","bvc $%04x","bvs $%04x",
197     /* 10 - 1f */
198     "to r0",   "to r1",   "to r2",    "to r3",    "to r4",    "to r5",    "to r6",    "to r7",
199     "to r8",   "to r9",   "to r10",   "to r11",   "to r12",   "to r13",   "to r14",   "to r15",
200     /* 20 - 2f */
201     "with r0", "with r1", "with r2",  "with r3",  "with r4",  "with r5",  "with r6",  "with r7", 
202     "with r8", "with r9", "with r10", "with r11", "with r12", "with r13", "with r14", "with r15",
203     /* 30 - 3f */
204     "stb (r0)","stb (r1)","stb (r2)", "stb (r3)", "stb (r4)", "stb (r5)", "stb (r6)", "stb (r7)",
205     "stb (r8)","stb (r9)","stb (r10)","stb (r11)","loop",     "alt1",     "alt2",     "alt3",
206     /* 40 - 4f */
207     "ldb (r0)","ldb (r1)","ldb (r2)", "ldb (r3)", "ldb (r4)", "ldb (r5)", "ldb (r6)", "ldb (r7)",
208     "ldb (r8)","ldb (r9)","ldb (r10)","ldb (r11)","rpix",     "swap",     "cmode",    "not",
209     /* 50 - 5f */
210     "adc r0",  "adc r1",  "adc r2",   "adc r3",   "adc r4",   "adc r5",   "adc r6",   "adc r7",
211     "adc r8",  "adc r9",  "adc r10",  "adc r11",  "adc r12",  "adc r13",  "adc r14",  "adc r15",
212     /* 60 - 6f */
213     "sbc r0",  "sbc r1",  "sbc r2",   "sbc r3",   "sbc r4",   "sbc r5",   "sbc r6",   "sbc r7",
214     "sbc r8",  "sbc r9",  "sbc r10",  "sbc r11",  "sbc r12",  "sbc r13",  "sbc r14",  "sbc r15",
215     /* 70 - 7f */
216     "merge",   "bic r1",  "bic r2",   "bic r3",   "bic r4",   "bic r5",   "bic r6",   "bic r7",
217     "bic r8",  "bic r9",  "bic r10",  "bic r11",  "bic r12",  "bic r13",  "bic r14",  "bic r15",
218     /* 80 - 8f */
219     "umult r0","umult r1","umult r2", "umult r3", "umult r4", "umult r5", "umult r6", "umult r7",
220     "umult r8","umult r9","umult r10","umult r11","umult r12","umult r13","umult r14","umult r15",
221     /* 90 - 9f */
222     "sbk",     "link #1", "link #2",  "link #3",  "link #4",  "sex",      "div2",     "ror",
223     "ljmp (r8)","ljmp (r9)","ljmp (r10)","ljmp (r11)", "ljmp (r12)", "ljmp (r13)", "lob", "lmult",
224     /* a0 - af */
225     "lms r0,($%04x)",  "lms r1,($%04x)",  "lms r2,($%04x)",   "lms r3,($%04x)",
226     "lms r4,($%04x)",  "lms r5,($%04x)",  "lms r6,($%04x)",   "lms r7,($%04x)",
227     "lms r8,($%04x)",  "lms r9,($%04x)",  "lms r10,($%04x)",  "lms r11,($%04x)",
228     "lms r12,($%04x)", "lms r13,($%04x)", "lms r14,($%04x)",  "lms r15,($%04x)",
229     /* b0 - bf */
230     "from r0", "from r1", "from r2",  "from r3",  "from r4",  "from r5",  "from r6",  "from r7",
231     "from r8", "from r9", "from r10", "from r11", "from r12", "from r13", "from r14", "from r15",
232     /* c0 - cf */
233     "hib",     "xor r1",  "xor r2",   "xor r3",   "xor r4",   "xor r5",   "xor r6",   "xor r7",
234     "xor r8",  "xor r9",  "xor r10",  "xor r11",  "xor r12",  "xor r13",  "xor r14",  "xor r15",
235     /* d0 - df */
236     "inc r0",  "inc r1",  "inc r2",   "inc r3",   "inc r4",   "inc r5",   "inc r6",   "inc r7",
237     "inc r8",  "inc r9",  "inc r10",  "inc r11",  "inc r12",  "inc r13",  "inc r14",  "getc",
238     /* e0 - ef */
239     "dec r0",  "dec r1",  "dec r2",   "dec r3",   "dec r4",   "dec r5",   "dec r6",   "dec r7",
240     "dec r8",  "dec r9",  "dec r10",  "dec r11",  "dec r12",  "dec r13",  "dec r14",  "getbh",
241     /* f0 - ff */
242     "lm r0,($%04x)",   "lm r1,($%04x)",   "lm r2,($%04x)",    "lm r3,($%04x)",
243     "lm r4,($%04x)",   "lm r5,($%04x)",   "lm r6,($%04x)",    "lm r7,($%04x)",
244     "lm r8,($%04x)",   "lm r9,($%04x)",   "lm r10,($%04x)",   "lm r11,($%04x)",
245     "lm r12,($%04x)",  "lm r13,($%04x)",  "lm r14,($%04x)",   "lm r15,($%04x)",
246
247     /*
248      * ALT2 Table
249      */
250
251     /* 00 - 0f */
252     "stop",    "nop",     "cache",    "lsr",      "rol",      "bra $%04x","blt $%04x","bge $%04x",
253     "bne $%04x","beq $%04x","bpl $%04x","bmi $%04x","bcc $%04x","bcs $%04x","bvc $%04x","bvs $%04x",
254     /* 10 - 1f */
255     "to r0",   "to r1",   "to r2",    "to r3",    "to r4",    "to r5",    "to r6",    "to r7",
256     "to r8",   "to r9",   "to r10",   "to r11",   "to r12",   "to r13",   "to r14",   "to r15",
257     /* 20 - 2f */
258     "with r0", "with r1", "with r2",  "with r3",  "with r4",  "with r5",  "with r6",  "with r7", 
259     "with r8", "with r9", "with r10", "with r11", "with r12", "with r13", "with r14", "with r15",
260     /* 30 - 3f */
261     "stw (r0)","stw (r1)","stw (r2)", "stw (r3)", "stw (r4)", "stw (r5)", "stw (r6)", "stw (r7)",
262     "stw (r8)","stw (r9)","stw (r10)","stw (r11)","loop",     "alt1",     "alt2",     "alt3",
263     /* 40 - 4f */
264     "ldw (r0)","ldw (r1)","ldw (r2)", "ldw (r3)", "ldw (r4)", "ldw (r5)", "ldw (r6)", "ldw (r7)",
265     "ldw (r8)","ldw (r9)","ldw (r10)","ldw (r11)","plot",     "swap",     "color",    "not",
266     /* 50 - 5f */
267     "add #0",  "add #1",  "add #2",   "add #3",   "add #4",   "add #5",   "add #6",   "add #7",
268     "add #8",  "add #9",  "add #10",  "add #11",  "add #12",  "add #13",  "add #14",  "add #15",
269     /* 60 - 6f */
270     "sub #0",  "sub #1",  "sub #2",   "sub #3",   "sub #4",   "sub #5",   "sub #6",   "sub #7",
271     "sub #8",  "sub #9",  "sub #10",  "sub #11",  "sub #12",  "sub #13",  "sub #14",  "sub #15",
272     /* 70 - 7f */
273     "merge",   "and #1",  "and #2",   "and #3",   "and #4",   "and #5",   "and #6",   "and #7",
274     "and #8",  "and #9",  "and #10",  "and #11",  "and #12",  "and #13",  "and #14",  "and #15",
275     /* 80 - 8f */
276     "mult #0", "mult #1", "mult #2",  "mult #3",  "mult #4",  "mult #5",  "mult #6",  "mult #7",
277     "mult #8", "mult #9", "mult #10", "mult #11", "mult #12", "mult #13", "mult #14", "mult #15",
278     /* 90 - 9f */
279     "sbk",     "link #1", "link #2",  "link #3",  "link #4",  "sex",      "asr",      "ror",
280     "jmp (r8)","jmp (r9)","jmp (r10)","jmp (r11)","jmp (r12)","jmp (r13)","lob",      "fmult",
281     /* a0 - af */
282     "sms ($%04x),r0",  "sms ($%04x),r1",  "sms ($%04x),r2",   "sms ($%04x),r3",
283     "sms ($%04x),r4",  "sms ($%04x),r5",  "sms ($%04x),r6",   "sms ($%04x),r7",
284     "sms ($%04x),r8",  "sms ($%04x),r9",  "sms ($%04x),r10",  "sms ($%04x),r11",
285     "sms ($%04x),r12", "sms ($%04x),r13", "sms ($%04x),r14",  "sms ($%04x),r15",
286     /* b0 - bf */
287     "from r0", "from r1", "from r2",  "from r3",  "from r4",  "from r5",  "from r6",  "from r7",
288     "from r8", "from r9", "from r10", "from r11", "from r12", "from r13", "from r14", "from r15",
289     /* c0 - cf */
290     "hib",     "or #1",   "or #2",    "or #3",    "or #4",    "or #5",    "or #6",    "or #7",
291     "or #8",   "or #9",   "or #10",   "or #11",   "or #12",   "or #13",   "or #14",   "or #15",
292     /* d0 - df */
293     "inc r0",  "inc r1",  "inc r2",   "inc r3",   "inc r4",   "inc r5",   "inc r6",   "inc r7",
294     "inc r8",  "inc r9",  "inc r10",  "inc r11",  "inc r12",  "inc r13",  "inc r14",  "ramb",
295     /* e0 - ef */
296     "dec r0",  "dec r1",  "dec r2",   "dec r3",   "dec r4",   "dec r5",   "dec r6",   "dec r7",
297     "dec r8",  "dec r9",  "dec r10",  "dec r11",  "dec r12",  "dec r13",  "dec r14",  "getbl",
298     /* f0 - ff */
299     "sm ($%04x),r0",   "sm ($%04x),r1",   "sm ($%04x),r2",    "sm ($%04x),r3",
300     "sm ($%04x),r4",   "sm ($%04x),r5",   "sm ($%04x),r6",    "sm ($%04x),r7",
301     "sm ($%04x),r8",   "sm ($%04x),r9",   "sm ($%04x),r10",   "sm ($%04x),r11",
302     "sm ($%04x),r12",  "sm ($%04x),r13",  "sm ($%04x),r14",   "sm ($%04x),r15",
303
304     /*
305      * ALT3 Table
306      */
307
308     /* 00 - 0f */
309     "stop",    "nop",     "cache",    "lsr",      "rol",      "bra $%04x","blt $%04x","bge $%04x",
310     "bne $%04x","beq $%04x","bpl $%04x","bmi $%04x","bcc $%04x","bcs $%04x","bvc $%04x","bvs $%04x",
311     /* 10 - 1f */
312     "to r0",   "to r1",   "to r2",    "to r3",    "to r4",    "to r5",    "to r6",    "to r7",
313     "to r8",   "to r9",   "to r10",   "to r11",   "to r12",   "to r13",   "to r14",   "to r15",
314     /* 20 - 2f */
315     "with r0", "with r1", "with r2",  "with r3",  "with r4",  "with r5",  "with r6",  "with r7", 
316     "with r8", "with r9", "with r10", "with r11", "with r12", "with r13", "with r14", "with r15",
317     /* 30 - 3f */
318     "stb (r0)","stb (r1)","stb (r2)", "stb (r3)", "stb (r4)", "stb (r5)", "stb (r6)", "stb (r7)",
319     "stb (r8)","stb (r9)","stb (r10)","stb (r11)","loop",     "alt1",     "alt2",     "alt3",
320     /* 40 - 4f */
321     "ldb (r0)","ldb (r1)","ldb (r2)", "ldb (r3)", "ldb (r4)", "ldb (r5)", "ldb (r6)", "ldb (r7)",
322     "ldb (r8)","ldb (r9)","ldb (r10)","ldb (r11)","rpix",     "swap",     "cmode",    "not",
323     /* 50 - 5f */
324     "adc #0",  "adc #1",  "adc #2",   "adc #3",   "adc #4",   "adc #5",   "adc #6",   "adc #7",
325     "adc #8",  "adc #9",  "adc #10",  "adc #11",  "adc #12",  "adc #13",  "adc #14",  "adc #15",
326     /* 60 - 6f */
327     "cmp r0",  "cmp r1",  "cmp r2",   "cmp r3",   "cmp r4",   "cmp r5",   "cmp r6",   "cmp r7",
328     "cmp r8",  "cmp r9",  "cmp r10",  "cmp r11",  "cmp r12",  "cmp r13",  "cmp r14",  "cmp r15",
329     /* 70 - 7f */
330     "merge",   "bic #1",  "bic #2",   "bic #3",   "bic #4",   "bic #5",   "bic #6",   "bic #7",
331     "bic #8",  "bic #9",  "bic #10",  "bic #11",  "bic #12",  "bic #13",  "bic #14",  "bic #15",
332     /* 80 - 8f */
333     "umult #0","umult #1","umult #2", "umult #3", "umult #4", "umult #5", "umult #6", "umult #7",
334     "umult #8","umult #9","umult #10","umult #11","umult #12","umult #13","umult #14","umult #15",
335     /* 90 - 9f */
336     "sbk",     "link #1", "link #2",  "link #3",  "link #4",  "sex",      "div2",     "ror",
337     "ljmp (r8)","ljmp (r9)","ljmp (r10)","ljmp (r11)", "ljmp (r12)", "ljmp (r13)", "lob", "lmult",
338     /* a0 - af */
339     "lms r0,($%04x)",  "lms r1,($%04x)",  "lms r2,($%04x)",   "lms r3,($%04x)",
340     "lms r4,($%04x)",  "lms r5,($%04x)",  "lms r6,($%04x)",   "lms r7,($%04x)",
341     "lms r8,($%04x)",  "lms r9,($%04x)",  "lms r10,($%04x)",  "lms r11,($%04x)",
342     "lms r12,($%04x)", "lms r13,($%04x)", "lms r14,($%04x)",  "lms r15,($%04x)",
343     /* b0 - bf */
344     "from r0", "from r1", "from r2",  "from r3",  "from r4",  "from r5",  "from r6",  "from r7",
345     "from r8", "from r9", "from r10", "from r11", "from r12", "from r13", "from r14", "from r15",
346     /* c0 - cf */
347     "hib",     "xor #1",  "xor #2",   "xor #3",   "xor #4",   "xor #5",   "xor #6",   "xor #7",
348     "xor #8",  "xor #9",  "xor #10",  "xor #11",  "xor #12",  "xor #13",  "xor #14",  "xor #15",
349     /* d0 - df */
350     "inc r0",  "inc r1",  "inc r2",   "inc r3",   "inc r4",   "inc r5",   "inc r6",   "inc r7",
351     "inc r8",  "inc r9",  "inc r10",  "inc r11",  "inc r12",  "inc r13",  "inc r14",  "romb",
352     /* e0 - ef */
353     "dec r0",  "dec r1",  "dec r2",   "dec r3",   "dec r4",   "dec r5",   "dec r6",   "dec r7",
354     "dec r8",  "dec r9",  "dec r10",  "dec r11",  "dec r12",  "dec r13",  "dec r14",  "getbs",
355     /* f0 - ff */
356     "lm r0,($%04x)",   "lm r1,($%04x)",   "lm r2,($%04x)",    "lm r3,($%04x)",
357     "lm r4,($%04x)",   "lm r5,($%04x)",   "lm r6,($%04x)",    "lm r7,($%04x)",
358     "lm r8,($%04x)",   "lm r9,($%04x)",   "lm r10,($%04x)",   "lm r11,($%04x)",
359     "lm r12,($%04x)",  "lm r13,($%04x)",  "lm r14,($%04x)",   "lm r15,($%04x)",
360 };