merge from gcc
[binutils.git] / opcodes / w65-opc.h
blob6515f65a6f69a748267dbfba4c1838c6bb9902f7
1 /* Instruction opcode header for WDC 65816
2 (generated by the program sim/w65/gencode -a)
4 Copyright 2001, 2002 Free Software Foundation, Inc.
6 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
24 #define ADDR_IMMTOA 1 /* #a */
25 #define ADDR_IMMCOP 2 /* #c */
26 #define ADDR_IMMTOI 3 /* #i */
27 #define ADDR_ACC 4 /* A */
28 #define ADDR_PC_REL 5 /* r */
29 #define ADDR_PC_REL_LONG 6 /* rl */
30 #define ADDR_IMPLIED 7 /* i */
31 #define ADDR_STACK 8 /* s */
32 #define ADDR_DIR 9 /* d */
33 #define ADDR_DIR_IDX_X 10 /* d,x */
34 #define ADDR_DIR_IDX_Y 11 /* d,y */
35 #define ADDR_DIR_IND 12 /* (d) */
36 #define ADDR_DIR_IDX_IND_X 13 /* (d,x) */
37 #define ADDR_DIR_IND_IDX_Y 14 /* (d),y */
38 #define ADDR_DIR_IND_LONG 15 /* [d] */
39 #define ADDR_DIR_IND_IDX_Y_LONG 16 /* [d],y */
40 #define ADDR_ABS 17 /* a */
41 #define ADDR_ABS_IDX_X 18 /* a,x */
42 #define ADDR_ABS_IDX_Y 19 /* a,y */
43 #define ADDR_ABS_LONG 20 /* al */
44 #define ADDR_ABS_IND_LONG 21 /* [a] */
45 #define ADDR_ABS_LONG_IDX_X 22 /* al,x */
46 #define ADDR_STACK_REL 23 /* d,s */
47 #define ADDR_STACK_REL_INDX_IDX 24 /* (d,s),y */
48 #define ADDR_ABS_IND 25 /* (a) */
49 #define ADDR_ABS_IND_IDX 26 /* (a,x) */
50 #define ADDR_BLOCK_MOVE 27 /* xyz */
51 struct opinfo {
52 int val;
53 int code;
54 char *name;
55 int amode;
57 const struct opinfo optable[257]={
58 #define O_adc 1
59 #define O_and 2
60 #define O_asl 3
61 #define O_bcc 4
62 #define O_bcs 5
63 #define O_beq 6
64 #define O_bit 7
65 #define O_bmi 8
66 #define O_bne 9
67 #define O_bpl 10
68 #define O_bra 11
69 #define O_brk 12
70 #define O_brl 13
71 #define O_bvc 14
72 #define O_bvs 15
73 #define O_clc 16
74 #define O_cld 17
75 #define O_cli 18
76 #define O_clv 19
77 #define O_cmp 20
78 #define O_cop 21
79 #define O_cpx 22
80 #define O_cpy 23
81 #define O_dec 24
82 #define O_dex 25
83 #define O_dey 26
84 #define O_eor 27
85 #define O_inc 28
86 #define O_inx 29
87 #define O_iny 30
88 #define O_jmp 31
89 #define O_jsr 32
90 #define O_lda 33
91 #define O_ldx 34
92 #define O_ldy 35
93 #define O_lsr 36
94 #define O_mvn 37
95 #define O_mvp 38
96 #define O_nop 39
97 #define O_ora 40
98 #define O_pea 41
99 #define O_pei 42
100 #define O_per 43
101 #define O_pha 44
102 #define O_phb 45
103 #define O_phd 46
104 #define O_phk 47
105 #define O_php 48
106 #define O_phx 49
107 #define O_phy 50
108 #define O_pla 51
109 #define O_plb 52
110 #define O_pld 53
111 #define O_plp 54
112 #define O_plx 55
113 #define O_ply 56
114 #define O_rep 57
115 #define O_rol 58
116 #define O_ror 59
117 #define O_rti 60
118 #define O_rtl 61
119 #define O_rts 62
120 #define O_sbc 63
121 #define O_sec 64
122 #define O_sed 65
123 #define O_sei 66
124 #define O_sep 67
125 #define O_sta 68
126 #define O_stp 69
127 #define O_stx 70
128 #define O_sty 71
129 #define O_stz 72
130 #define O_tax 73
131 #define O_tay 74
132 #define O_tcd 75
133 #define O_tcs 76
134 #define O_tdc 77
135 #define O_trb 78
136 #define O_tsb 79
137 #define O_tsc 80
138 #define O_tsx 81
139 #define O_txa 82
140 #define O_txs 83
141 #define O_txy 84
142 #define O_tya 85
143 #define O_tyx 86
144 #define O_wai 87
145 #define O_wdm 88
146 #define O_xba 89
147 #define O_xce 90
148 #ifdef DEFINE_TABLE
149 {0x69, O_adc, "adc", ADDR_IMMTOA},
150 {0x72, O_adc, "adc", ADDR_DIR_IND},
151 {0x71, O_adc, "adc", ADDR_DIR_IND_IDX_Y},
152 {0x73, O_adc, "adc", ADDR_STACK_REL_INDX_IDX},
153 {0x61, O_adc, "adc", ADDR_DIR_IDX_IND_X},
154 {0x67, O_adc, "adc", ADDR_DIR_IND_LONG},
155 {0x77, O_adc, "adc", ADDR_DIR_IND_IDX_Y_LONG},
156 {0x6D, O_adc, "adc", ADDR_ABS},
157 {0x7D, O_adc, "adc", ADDR_ABS_IDX_X},
158 {0x79, O_adc, "adc", ADDR_ABS_IDX_Y},
159 {0x6F, O_adc, "adc", ADDR_ABS_LONG},
160 {0x7F, O_adc, "adc", ADDR_ABS_LONG_IDX_X},
161 {0x65, O_adc, "adc", ADDR_DIR},
162 {0x63, O_adc, "adc", ADDR_STACK_REL},
163 {0x75, O_adc, "adc", ADDR_DIR_IDX_X},
164 {0x29, O_and, "and", ADDR_IMMTOA},
165 {0x32, O_and, "and", ADDR_DIR_IND},
166 {0x31, O_and, "and", ADDR_DIR_IND_IDX_Y},
167 {0x33, O_and, "and", ADDR_STACK_REL_INDX_IDX},
168 {0x21, O_and, "and", ADDR_DIR_IDX_IND_X},
169 {0x27, O_and, "and", ADDR_DIR_IND_LONG},
170 {0x37, O_and, "and", ADDR_DIR_IND_IDX_Y_LONG},
171 {0x2D, O_and, "and", ADDR_ABS},
172 {0x3D, O_and, "and", ADDR_ABS_IDX_X},
173 {0x39, O_and, "and", ADDR_ABS_IDX_Y},
174 {0x2F, O_and, "and", ADDR_ABS_LONG},
175 {0x3F, O_and, "and", ADDR_ABS_LONG_IDX_X},
176 {0x25, O_and, "and", ADDR_DIR},
177 {0x23, O_and, "and", ADDR_STACK_REL},
178 {0x35, O_and, "and", ADDR_DIR_IDX_X},
179 {0x0A, O_asl, "asl", ADDR_ACC},
180 {0x0E, O_asl, "asl", ADDR_ABS},
181 {0x1E, O_asl, "asl", ADDR_ABS_IDX_X},
182 {0x06, O_asl, "asl", ADDR_DIR},
183 {0x16, O_asl, "asl", ADDR_DIR_IDX_X},
184 {0x90, O_bcc, "bcc", ADDR_PC_REL},
185 {0xB0, O_bcs, "bcs", ADDR_PC_REL},
186 {0xF0, O_beq, "beq", ADDR_PC_REL},
187 {0x89, O_bit, "bit", ADDR_IMMTOA},
188 {0x24, O_bit, "bit", ADDR_DIR_IND},
189 {0x34, O_bit, "bit", ADDR_DIR_IDX_IND_X},
190 {0x2C, O_bit, "bit", ADDR_ABS},
191 {0x3C, O_bit, "bit", ADDR_ABS_IDX_X},
192 {0x30, O_bmi, "bmi", ADDR_PC_REL},
193 {0xD0, O_bne, "bne", ADDR_PC_REL},
194 {0x10, O_bpl, "bpl", ADDR_PC_REL},
195 {0x80, O_bra, "bra", ADDR_PC_REL},
196 {0x00, O_brk, "brk", ADDR_STACK},
197 {0x82, O_brl, "brl", ADDR_PC_REL_LONG},
198 {0x50, O_bvc, "bvc", ADDR_PC_REL},
199 {0x70, O_bvs, "bvs", ADDR_PC_REL},
200 {0x18, O_clc, "clc", ADDR_IMPLIED},
201 {0xD8, O_cld, "cld", ADDR_IMPLIED},
202 {0x58, O_cli, "cli", ADDR_IMPLIED},
203 {0xB8, O_clv, "clv", ADDR_IMPLIED},
204 {0xC9, O_cmp, "cmp", ADDR_IMMTOA},
205 {0xD2, O_cmp, "cmp", ADDR_DIR_IND},
206 {0xD1, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y},
207 {0xD3, O_cmp, "cmp", ADDR_STACK_REL_INDX_IDX},
208 {0xC1, O_cmp, "cmp", ADDR_DIR_IDX_IND_X},
209 {0xC7, O_cmp, "cmp", ADDR_DIR_IND_LONG},
210 {0xD7, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y_LONG},
211 {0xCD, O_cmp, "cmp", ADDR_ABS},
212 {0xDD, O_cmp, "cmp", ADDR_ABS_IDX_X},
213 {0xD9, O_cmp, "cmp", ADDR_ABS_IDX_Y},
214 {0xCF, O_cmp, "cmp", ADDR_ABS_LONG},
215 {0xDF, O_cmp, "cmp", ADDR_ABS_LONG_IDX_X},
216 {0xC5, O_cmp, "cmp", ADDR_DIR},
217 {0xC3, O_cmp, "cmp", ADDR_STACK_REL},
218 {0xD5, O_cmp, "cmp", ADDR_DIR_IDX_X},
219 {0x02, O_cop, "cop", ADDR_IMMCOP},
220 {0xE0, O_cpx, "cpx", ADDR_IMMTOI},
221 {0xEC, O_cpx, "cpx", ADDR_ABS},
222 {0xE4, O_cpx, "cpx", ADDR_DIR},
223 {0xC0, O_cpy, "cpy", ADDR_IMMTOI},
224 {0xCC, O_cpy, "cpy", ADDR_ABS},
225 {0xC4, O_cpy, "cpy", ADDR_DIR},
226 {0x3A, O_dec, "dec", ADDR_ACC},
227 {0xCE, O_dec, "dec", ADDR_ABS},
228 {0xDE, O_dec, "dec", ADDR_ABS_IDX_X},
229 {0xC6, O_dec, "dec", ADDR_DIR},
230 {0xD6, O_dec, "dec", ADDR_DIR_IDX_X},
231 {0xCA, O_dex, "dex", ADDR_IMPLIED},
232 {0x88, O_dey, "dey", ADDR_IMPLIED},
233 {0x49, O_eor, "eor", ADDR_IMMTOA},
234 {0x52, O_eor, "eor", ADDR_DIR_IND},
235 {0x51, O_eor, "eor", ADDR_DIR_IND_IDX_Y},
236 {0x53, O_eor, "eor", ADDR_STACK_REL_INDX_IDX},
237 {0x41, O_eor, "eor", ADDR_DIR_IDX_IND_X},
238 {0x47, O_eor, "eor", ADDR_DIR_IND_LONG},
239 {0x57, O_eor, "eor", ADDR_DIR_IND_IDX_Y_LONG},
240 {0x4D, O_eor, "eor", ADDR_ABS},
241 {0x5D, O_eor, "eor", ADDR_ABS_IDX_X},
242 {0x59, O_eor, "eor", ADDR_ABS_IDX_Y},
243 {0x4F, O_eor, "eor", ADDR_ABS_LONG},
244 {0x5F, O_eor, "eor", ADDR_ABS_LONG_IDX_X},
245 {0x45, O_eor, "eor", ADDR_DIR},
246 {0x43, O_eor, "eor", ADDR_STACK_REL},
247 {0x55, O_eor, "eor", ADDR_DIR_IDX_X},
248 {0x1A, O_inc, "inc", ADDR_ACC},
249 {0xEE, O_inc, "inc", ADDR_ABS},
250 {0xFE, O_inc, "inc", ADDR_ABS_IDX_X},
251 {0xE6, O_inc, "inc", ADDR_DIR},
252 {0xF6, O_inc, "inc", ADDR_DIR_IDX_X},
253 {0xE8, O_inx, "inx", ADDR_IMPLIED},
254 {0xC8, O_iny, "iny", ADDR_IMPLIED},
255 {0x6C, O_jmp, "jmp", ADDR_ABS_IND},
256 {0x7C, O_jmp, "jmp", ADDR_ABS_IND_IDX},
257 {0xDC, O_jmp, "jmp", ADDR_ABS_IND_LONG},
258 {0x4C, O_jmp, "jmp", ADDR_ABS},
259 {0x5C, O_jmp, "jmp", ADDR_ABS_LONG},
260 {0xFC, O_jsr, "jsr", ADDR_ABS_IND_IDX},
261 {0x20, O_jsr, "jsr", ADDR_ABS},
262 {0x22, O_jsr, "jsr", ADDR_ABS_LONG},
263 {0xA9, O_lda, "lda", ADDR_IMMTOA},
264 {0xB2, O_lda, "lda", ADDR_DIR_IND},
265 {0xB1, O_lda, "lda", ADDR_DIR_IND_IDX_Y},
266 {0xB3, O_lda, "lda", ADDR_STACK_REL_INDX_IDX},
267 {0xA1, O_lda, "lda", ADDR_DIR_IDX_IND_X},
268 {0xA7, O_lda, "lda", ADDR_DIR_IND_LONG},
269 {0xB7, O_lda, "lda", ADDR_DIR_IND_IDX_Y_LONG},
270 {0xAD, O_lda, "lda", ADDR_ABS},
271 {0xBD, O_lda, "lda", ADDR_ABS_IDX_X},
272 {0xB9, O_lda, "lda", ADDR_ABS_IDX_Y},
273 {0xAF, O_lda, "lda", ADDR_ABS_LONG},
274 {0xBF, O_lda, "lda", ADDR_ABS_LONG_IDX_X},
275 {0xA5, O_lda, "lda", ADDR_DIR},
276 {0xA3, O_lda, "lda", ADDR_STACK_REL},
277 {0xB5, O_lda, "lda", ADDR_DIR_IDX_X},
278 {0xA2, O_ldx, "ldx", ADDR_IMMTOI},
279 {0xAE, O_ldx, "ldx", ADDR_ABS},
280 {0xBE, O_ldx, "ldx", ADDR_ABS_IDX_Y},
281 {0xA6, O_ldx, "ldx", ADDR_DIR},
282 {0xB6, O_ldx, "ldx", ADDR_DIR_IDX_Y},
283 {0xA0, O_ldy, "ldy", ADDR_IMMTOI},
284 {0xAC, O_ldy, "ldy", ADDR_ABS},
285 {0xBC, O_ldy, "ldy", ADDR_ABS_IDX_X},
286 {0xA4, O_ldy, "ldy", ADDR_DIR},
287 {0xB4, O_ldy, "ldy", ADDR_DIR_IDX_X},
288 {0x4A, O_lsr, "lsr", ADDR_ACC},
289 {0x4E, O_lsr, "lsr", ADDR_ABS},
290 {0x5E, O_lsr, "lsr", ADDR_ABS_IDX_X},
291 {0x46, O_lsr, "lsr", ADDR_DIR},
292 {0x56, O_lsr, "lsr", ADDR_DIR_IDX_X},
293 {0x54, O_mvn, "mvn", ADDR_BLOCK_MOVE},
294 {0x44, O_mvp, "mvp", ADDR_BLOCK_MOVE},
295 {0xEA, O_nop, "nop", ADDR_IMPLIED},
296 {0x09, O_ora, "ora", ADDR_IMMTOA},
297 {0x12, O_ora, "ora", ADDR_DIR_IND},
298 {0x11, O_ora, "ora", ADDR_DIR_IND_IDX_Y},
299 {0x13, O_ora, "ora", ADDR_STACK_REL_INDX_IDX},
300 {0x01, O_ora, "ora", ADDR_DIR_IDX_IND_X},
301 {0x07, O_ora, "ora", ADDR_DIR_IND_LONG},
302 {0x17, O_ora, "ora", ADDR_DIR_IND_IDX_Y_LONG},
303 {0x0D, O_ora, "ora", ADDR_ABS},
304 {0x1D, O_ora, "ora", ADDR_ABS_IDX_X},
305 {0x19, O_ora, "ora", ADDR_ABS_IDX_Y},
306 {0x0F, O_ora, "ora", ADDR_ABS_LONG},
307 {0x1F, O_ora, "ora", ADDR_ABS_LONG_IDX_X},
308 {0x05, O_ora, "ora", ADDR_DIR},
309 {0x03, O_ora, "ora", ADDR_STACK_REL},
310 {0x15, O_ora, "ora", ADDR_DIR_IDX_X},
311 {0xF4, O_pea, "pea", ADDR_ABS},
312 {0xD4, O_pei, "pei", ADDR_DIR},
313 {0x62, O_per, "per", ADDR_PC_REL_LONG},
314 {0x48, O_pha, "pha", ADDR_STACK},
315 {0x8B, O_phb, "phb", ADDR_STACK},
316 {0x0B, O_phd, "phd", ADDR_STACK},
317 {0x4B, O_phk, "phk", ADDR_STACK},
318 {0x08, O_php, "php", ADDR_STACK},
319 {0xDA, O_phx, "phx", ADDR_STACK},
320 {0x5A, O_phy, "phy", ADDR_STACK},
321 {0x68, O_pla, "pla", ADDR_STACK},
322 {0xAB, O_plb, "plb", ADDR_STACK},
323 {0x2B, O_pld, "pld", ADDR_STACK},
324 {0x28, O_plp, "plp", ADDR_STACK},
325 {0xFA, O_plx, "plx", ADDR_STACK},
326 {0x7A, O_ply, "ply", ADDR_STACK},
327 {0xC2, O_rep, "rep", ADDR_IMMCOP},
328 {0x2A, O_rol, "rol", ADDR_ACC},
329 {0x2E, O_rol, "rol", ADDR_ABS},
330 {0x3E, O_rol, "rol", ADDR_ABS_IDX_X},
331 {0x26, O_rol, "rol", ADDR_DIR},
332 {0x36, O_rol, "rol", ADDR_DIR_IDX_X},
333 {0x6A, O_ror, "ror", ADDR_ACC},
334 {0x6E, O_ror, "ror", ADDR_ABS},
335 {0x7E, O_ror, "ror", ADDR_ABS_IDX_X},
336 {0x66, O_ror, "ror", ADDR_DIR},
337 {0x76, O_ror, "ror", ADDR_DIR_IDX_X},
338 {0x40, O_rti, "rti", ADDR_STACK},
339 {0x6B, O_rtl, "rtl", ADDR_STACK},
340 {0x60, O_rts, "rts", ADDR_STACK},
341 {0xE9, O_sbc, "sbc", ADDR_IMMTOA},
342 {0xF2, O_sbc, "sbc", ADDR_DIR_IND},
343 {0xF1, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y},
344 {0xF3, O_sbc, "sbc", ADDR_STACK_REL_INDX_IDX},
345 {0xE1, O_sbc, "sbc", ADDR_DIR_IDX_IND_X},
346 {0xE7, O_sbc, "sbc", ADDR_DIR_IND_LONG},
347 {0xF7, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y_LONG},
348 {0xED, O_sbc, "sbc", ADDR_ABS},
349 {0xFD, O_sbc, "sbc", ADDR_ABS_IDX_X},
350 {0xF9, O_sbc, "sbc", ADDR_ABS_IDX_Y},
351 {0xEF, O_sbc, "sbc", ADDR_ABS_LONG},
352 {0xFF, O_sbc, "sbc", ADDR_ABS_LONG_IDX_X},
353 {0xE5, O_sbc, "sbc", ADDR_DIR},
354 {0xE3, O_sbc, "sbc", ADDR_STACK_REL},
355 {0xF5, O_sbc, "sbc", ADDR_DIR_IDX_X},
356 {0x38, O_sec, "sec", ADDR_IMPLIED},
357 {0xF8, O_sed, "sed", ADDR_IMPLIED},
358 {0x78, O_sei, "sei", ADDR_IMPLIED},
359 {0xE2, O_sep, "sep", ADDR_IMMCOP},
360 {0x92, O_sta, "sta", ADDR_DIR_IND},
361 {0x91, O_sta, "sta", ADDR_DIR_IND_IDX_Y},
362 {0x93, O_sta, "sta", ADDR_STACK_REL_INDX_IDX},
363 {0x81, O_sta, "sta", ADDR_DIR_IDX_IND_X},
364 {0x87, O_sta, "sta", ADDR_DIR_IND_LONG},
365 {0x97, O_sta, "sta", ADDR_DIR_IND_IDX_Y_LONG},
366 {0x8D, O_sta, "sta", ADDR_ABS},
367 {0x9D, O_sta, "sta", ADDR_ABS_IDX_X},
368 {0x99, O_sta, "sta", ADDR_ABS_IDX_Y},
369 {0x8F, O_sta, "sta", ADDR_ABS_LONG},
370 {0x9F, O_sta, "sta", ADDR_ABS_LONG_IDX_X},
371 {0x85, O_sta, "sta", ADDR_DIR},
372 {0x83, O_sta, "sta", ADDR_STACK_REL},
373 {0x95, O_sta, "sta", ADDR_DIR_IDX_X},
374 {0xDB, O_stp, "stp", ADDR_IMPLIED},
375 {0x8E, O_stx, "stx", ADDR_ABS},
376 {0x86, O_stx, "stx", ADDR_DIR},
377 {0x96, O_stx, "stx", ADDR_DIR_IDX_X},
378 {0x8C, O_sty, "sty", ADDR_ABS},
379 {0x84, O_sty, "sty", ADDR_DIR},
380 {0x94, O_sty, "sty", ADDR_DIR_IDX_X},
381 {0x9C, O_stz, "stz", ADDR_ABS},
382 {0x9E, O_stz, "stz", ADDR_ABS_IDX_X},
383 {0x64, O_stz, "stz", ADDR_DIR},
384 {0x74, O_stz, "stz", ADDR_DIR_IDX_X},
385 {0xAA, O_tax, "tax", ADDR_IMPLIED},
386 {0xA8, O_tay, "tay", ADDR_IMPLIED},
387 {0x5B, O_tcd, "tcd", ADDR_IMPLIED},
388 {0x1B, O_tcs, "tcs", ADDR_IMPLIED},
389 {0x7B, O_tdc, "tdc", ADDR_IMPLIED},
390 {0x1C, O_trb, "trb", ADDR_ABS},
391 {0x14, O_trb, "trb", ADDR_DIR},
392 {0x0C, O_tsb, "tsb", ADDR_ABS},
393 {0x04, O_tsb, "tsb", ADDR_DIR},
394 {0x3B, O_tsc, "tsc", ADDR_IMPLIED},
395 {0xBA, O_tsx, "tsx", ADDR_IMPLIED},
396 {0x8A, O_txa, "txa", ADDR_IMPLIED},
397 {0x9A, O_txs, "txs", ADDR_IMPLIED},
398 {0x9B, O_txy, "txy", ADDR_IMPLIED},
399 {0x98, O_tya, "tya", ADDR_IMPLIED},
400 {0xBB, O_tyx, "tyx", ADDR_IMPLIED},
401 {0xCB, O_wai, "wai", ADDR_IMPLIED},
402 {0x42, O_wdm, "wdm", ADDR_IMPLIED},
403 {0xEB, O_xba, "xba", ADDR_IMPLIED},
404 {0xFB, O_xce, "xce", ADDR_IMPLIED},
405 { 0, 0, NULL, 0 }
407 #endif
408 #define DISASM()\
409 case ADDR_IMMTOA:\
410 args[0] = M==0 ? asR_W65_ABS16 : asR_W65_ABS8;\
411 print_operand (0, " #$0", args);\
412 size += M==0 ? 2:1;\
413 break;\
414 case ADDR_IMMCOP:\
415 args[0] = asR_W65_ABS8;\
416 print_operand (0, " #$0", args);\
417 size += 1;\
418 break;\
419 case ADDR_IMMTOI:\
420 args[0] = X==0 ? asR_W65_ABS16 : asR_W65_ABS8;\
421 print_operand (0, " #$0", args);\
422 size += X==0 ? 2:1;\
423 break;\
424 case ADDR_ACC:\
425 print_operand (0, " a", 0);\
426 size += 0;\
427 break;\
428 case ADDR_PC_REL:\
429 args[0] = asR_W65_PCR8;\
430 print_operand (0, " $0", args);\
431 size += 1;\
432 break;\
433 case ADDR_PC_REL_LONG:\
434 args[0] = asR_W65_PCR16;\
435 print_operand (0, " $0", args);\
436 size += 2;\
437 break;\
438 case ADDR_IMPLIED:\
439 size += 0;\
440 break;\
441 case ADDR_STACK:\
442 size += 0;\
443 break;\
444 case ADDR_DIR:\
445 args[0] = asR_W65_ABS8;\
446 print_operand (1, " <$0", args);\
447 size += 1;\
448 break;\
449 case ADDR_DIR_IDX_X:\
450 args[0] = asR_W65_ABS8;\
451 print_operand (1, " <$0,x", args);\
452 size += 1;\
453 break;\
454 case ADDR_DIR_IDX_Y:\
455 args[0] = asR_W65_ABS8;\
456 print_operand (1, " <$0,y", args);\
457 size += 1;\
458 break;\
459 case ADDR_DIR_IND:\
460 args[0] = asR_W65_ABS8;\
461 print_operand (1, " (<$0)", args);\
462 size += 1;\
463 break;\
464 case ADDR_DIR_IDX_IND_X:\
465 args[0] = asR_W65_ABS8;\
466 print_operand (1, " (<$0,x)", args);\
467 size += 1;\
468 break;\
469 case ADDR_DIR_IND_IDX_Y:\
470 args[0] = asR_W65_ABS8;\
471 print_operand (1, " (<$0),y", args);\
472 size += 1;\
473 break;\
474 case ADDR_DIR_IND_LONG:\
475 args[0] = asR_W65_ABS8;\
476 print_operand (1, " [$0]", args);\
477 size += 1;\
478 break;\
479 case ADDR_DIR_IND_IDX_Y_LONG:\
480 args[0] = asR_W65_ABS8;\
481 print_operand (1, " [$0],y", args);\
482 size += 1;\
483 break;\
484 case ADDR_ABS:\
485 args[0] = asR_W65_ABS16;\
486 print_operand (1, " !$0", args);\
487 size += 2;\
488 break;\
489 case ADDR_ABS_IDX_X:\
490 args[0] = asR_W65_ABS16;\
491 print_operand (1, " !$0,x", args);\
492 size += 2;\
493 break;\
494 case ADDR_ABS_IDX_Y:\
495 args[0] = asR_W65_ABS16;\
496 print_operand (1, " !$0,y", args);\
497 size += 2;\
498 break;\
499 case ADDR_ABS_LONG:\
500 args[0] = asR_W65_ABS24;\
501 print_operand (1, " >$0", args);\
502 size += 3;\
503 break;\
504 case ADDR_ABS_IND_LONG:\
505 args[0] = asR_W65_ABS16;\
506 print_operand (1, " [>$0]", args);\
507 size += 2;\
508 break;\
509 case ADDR_ABS_LONG_IDX_X:\
510 args[0] = asR_W65_ABS24;\
511 print_operand (1, " >$0,x", args);\
512 size += 3;\
513 break;\
514 case ADDR_STACK_REL:\
515 args[0] = asR_W65_ABS8;\
516 print_operand (0, " $0,s", args);\
517 size += 1;\
518 break;\
519 case ADDR_STACK_REL_INDX_IDX:\
520 args[0] = asR_W65_ABS8;\
521 print_operand (0, " ($0,s),y", args);\
522 size += 1;\
523 break;\
524 case ADDR_ABS_IND:\
525 args[0] = asR_W65_ABS16;\
526 print_operand (1, " ($0)", args);\
527 size += 2;\
528 break;\
529 case ADDR_ABS_IND_IDX:\
530 args[0] = asR_W65_ABS16;\
531 print_operand (1, " ($0,x)", args);\
532 size += 2;\
533 break;\
534 case ADDR_BLOCK_MOVE:\
535 args[0] = (asR_W65_ABS16 >>8) &0xff;\
536 args[1] = ( asR_W65_ABS16 & 0xff);\
537 print_operand (0," $0,$1",args);\
538 size += 2;\
539 break;\
541 #define GETINFO(size,type,pcrel)\
542 case ADDR_IMMTOA: size = M==0 ? 2:1;type=M==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\
543 case ADDR_IMMCOP: size = 1;type=R_W65_ABS8;pcrel=0;break;\
544 case ADDR_IMMTOI: size = X==0 ? 2:1;type=X==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\
545 case ADDR_ACC: size = 0;type=-1;pcrel=0;break;\
546 case ADDR_PC_REL: size = 1;type=R_W65_PCR8;pcrel=0;break;\
547 case ADDR_PC_REL_LONG: size = 2;type=R_W65_PCR16;pcrel=0;break;\
548 case ADDR_IMPLIED: size = 0;type=-1;pcrel=0;break;\
549 case ADDR_STACK: size = 0;type=-1;pcrel=0;break;\
550 case ADDR_DIR: size = 1;type=R_W65_ABS8;pcrel=0;break;\
551 case ADDR_DIR_IDX_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\
552 case ADDR_DIR_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\
553 case ADDR_DIR_IND: size = 1;type=R_W65_ABS8;pcrel=0;break;\
554 case ADDR_DIR_IDX_IND_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\
555 case ADDR_DIR_IND_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\
556 case ADDR_DIR_IND_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\
557 case ADDR_DIR_IND_IDX_Y_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\
558 case ADDR_ABS: size = 2;type=R_W65_ABS16;pcrel=0;break;\
559 case ADDR_ABS_IDX_X: size = 2;type=R_W65_ABS16;pcrel=0;break;\
560 case ADDR_ABS_IDX_Y: size = 2;type=R_W65_ABS16;pcrel=0;break;\
561 case ADDR_ABS_LONG: size = 3;type=R_W65_ABS24;pcrel=0;break;\
562 case ADDR_ABS_IND_LONG: size = 2;type=R_W65_ABS16;pcrel=0;break;\
563 case ADDR_ABS_LONG_IDX_X: size = 3;type=R_W65_ABS24;pcrel=0;break;\
564 case ADDR_STACK_REL: size = 1;type=R_W65_ABS8;pcrel=0;break;\
565 case ADDR_STACK_REL_INDX_IDX: size = 1;type=R_W65_ABS8;pcrel=0;break;\
566 case ADDR_ABS_IND: size = 2;type=R_W65_ABS16;pcrel=0;break;\
567 case ADDR_ABS_IND_IDX: size = 2;type=R_W65_ABS16;pcrel=0;break;\
568 case ADDR_BLOCK_MOVE: size = 2;type=-1;pcrel=0;break;\