1 /* Select disassembly routine for specified architecture.
2 Copyright (C) 1994-2016 Free Software Foundation, Inc.
4 This file is part of the GNU opcodes library.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
61 #define ARCH_microblaze
95 #define ARCH_xstormy16
101 #define INCLUDE_SHMEDIA
105 #include "m32c-desc.h"
109 disassembler (bfd *abfd)
111 enum bfd_architecture a = bfd_get_arch (abfd);
112 disassembler_ftype disassemble;
116 /* If you add a case to this table, also add it to the
117 ARCH_all definition right above this function. */
119 case bfd_arch_aarch64:
120 disassemble = print_insn_aarch64;
125 disassemble = print_insn_alpha;
130 disassemble = arc_get_disassembler (abfd);
135 if (bfd_big_endian (abfd))
136 disassemble = print_insn_big_arm;
138 disassemble = print_insn_little_arm;
143 disassemble = print_insn_avr;
148 disassemble = print_insn_bfin;
153 disassemble = print_insn_cr16;
158 disassemble = cris_get_disassembler (abfd);
163 disassemble = print_insn_crx;
168 disassemble = print_insn_d10v;
173 disassemble = print_insn_d30v;
178 /* As far as I know we only handle big-endian DLX objects. */
179 disassemble = print_insn_dlx;
184 if (bfd_get_mach (abfd) == bfd_mach_h8300h
185 || bfd_get_mach (abfd) == bfd_mach_h8300hn)
186 disassemble = print_insn_h8300h;
187 else if (bfd_get_mach (abfd) == bfd_mach_h8300s
188 || bfd_get_mach (abfd) == bfd_mach_h8300sn
189 || bfd_get_mach (abfd) == bfd_mach_h8300sx
190 || bfd_get_mach (abfd) == bfd_mach_h8300sxn)
191 disassemble = print_insn_h8300s;
193 disassemble = print_insn_h8300;
198 disassemble = print_insn_h8500;
203 disassemble = print_insn_hppa;
208 disassemble = print_insn_i370;
216 disassemble = print_insn_i386;
221 disassemble = print_insn_i860;
226 disassemble = print_insn_i960;
231 disassemble = print_insn_ia64;
236 disassemble = print_insn_ip2k;
240 case bfd_arch_epiphany:
241 disassemble = print_insn_epiphany;
246 disassemble = print_insn_fr30;
251 disassemble = print_insn_lm32;
256 disassemble = print_insn_m32r;
259 #if defined(ARCH_m68hc11) || defined(ARCH_m68hc12) \
260 || defined(ARCH_9s12x) || defined(ARCH_m9s12xg)
261 case bfd_arch_m68hc11:
262 disassemble = print_insn_m68hc11;
264 case bfd_arch_m68hc12:
265 disassemble = print_insn_m68hc12;
267 case bfd_arch_m9s12x:
268 disassemble = print_insn_m9s12x;
270 case bfd_arch_m9s12xg:
271 disassemble = print_insn_m9s12xg;
276 disassemble = print_insn_m68k;
281 disassemble = print_insn_m88k;
286 disassemble = print_insn_mt;
289 #ifdef ARCH_microblaze
290 case bfd_arch_microblaze:
291 disassemble = print_insn_microblaze;
295 case bfd_arch_msp430:
296 disassemble = print_insn_msp430;
301 disassemble = print_insn_nds32;
306 disassemble = print_insn_ns32k;
311 disassemble = print_insn_mcore;
316 disassemble = print_insn_mep;
321 disassemble = print_insn_metag;
326 if (bfd_big_endian (abfd))
327 disassemble = print_insn_big_mips;
329 disassemble = print_insn_little_mips;
334 disassemble = print_insn_mmix;
338 case bfd_arch_mn10200:
339 disassemble = print_insn_mn10200;
343 case bfd_arch_mn10300:
344 disassemble = print_insn_mn10300;
349 if (bfd_big_endian (abfd))
350 disassemble = print_insn_big_nios2;
352 disassemble = print_insn_little_nios2;
357 disassemble = print_insn_or1k;
362 disassemble = print_insn_pdp11;
367 disassemble = print_insn_pj;
371 case bfd_arch_powerpc:
372 if (bfd_big_endian (abfd))
373 disassemble = print_insn_big_powerpc;
375 disassemble = print_insn_little_powerpc;
379 case bfd_arch_rs6000:
380 if (bfd_get_mach (abfd) == bfd_mach_ppc_620)
381 disassemble = print_insn_big_powerpc;
383 disassemble = print_insn_rs6000;
388 disassemble = rl78_get_disassembler (abfd);
393 disassemble = print_insn_rx;
398 disassemble = print_insn_s390;
403 if (bfd_big_endian (abfd))
404 disassemble = print_insn_big_score;
406 disassemble = print_insn_little_score;
411 disassemble = print_insn_sh;
416 disassemble = print_insn_sparc;
421 disassemble = print_insn_spu;
426 disassemble = print_insn_tic30;
431 disassemble = print_insn_tic4x;
435 case bfd_arch_tic54x:
436 disassemble = print_insn_tic54x;
441 disassemble = print_insn_tic6x;
446 disassemble = print_insn_tic80;
451 disassemble = print_insn_ft32;
456 case bfd_arch_v850_rh850:
457 disassemble = print_insn_v850;
462 disassemble = print_insn_w65;
467 disassemble = print_insn_xgate;
470 #ifdef ARCH_xstormy16
471 case bfd_arch_xstormy16:
472 disassemble = print_insn_xstormy16;
477 disassemble = print_insn_xc16x;
481 case bfd_arch_xtensa:
482 disassemble = print_insn_xtensa;
487 disassemble = print_insn_z80;
492 if (bfd_get_mach(abfd) == bfd_mach_z8001)
493 disassemble = print_insn_z8001;
495 disassemble = print_insn_z8002;
500 disassemble = print_insn_vax;
504 case bfd_arch_visium:
505 disassemble = print_insn_visium;
510 disassemble = print_insn_frv;
515 disassemble = print_insn_moxie;
519 case bfd_arch_iq2000:
520 disassemble = print_insn_iq2000;
525 disassemble = print_insn_m32c;
529 case bfd_arch_tilegx:
530 disassemble = print_insn_tilegx;
534 case bfd_arch_tilepro:
535 disassemble = print_insn_tilepro;
545 disassembler_usage (FILE *stream ATTRIBUTE_UNUSED)
548 print_aarch64_disassembler_options (stream);
551 print_arm_disassembler_options (stream);
554 print_mips_disassembler_options (stream);
557 print_ppc_disassembler_options (stream);
560 print_i386_disassembler_options (stream);
563 print_s390_disassembler_options (stream);
570 disassemble_init_for_target (struct disassemble_info * info)
578 case bfd_arch_aarch64:
579 info->symbol_is_valid = aarch64_symbol_is_valid;
580 info->disassembler_needs_relocs = TRUE;
585 info->symbol_is_valid = arm_symbol_is_valid;
586 info->disassembler_needs_relocs = TRUE;
591 info->skip_zeroes = 16;
596 info->skip_zeroes = 32;
601 info->skip_zeroes = 256;
602 info->skip_zeroes_at_end = 0;
607 info->disassembler_needs_relocs = TRUE;
612 /* This processor in fact is little endian. The value set here
613 reflects the way opcodes are written in the cgen description. */
614 info->endian = BFD_ENDIAN_BIG;
615 if (! info->insn_sets)
617 info->insn_sets = cgen_bitset_create (ISA_MAX);
618 if (info->mach == bfd_mach_m16c)
619 cgen_bitset_set (info->insn_sets, ISA_M16C);
621 cgen_bitset_set (info->insn_sets, ISA_M32C);
626 case bfd_arch_powerpc:
629 case bfd_arch_rs6000:
631 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
632 disassemble_init_powerpc (info);