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"
112 enum bfd_architecture a = bfd_get_arch (abfd);
113 disassembler_ftype disassemble;
117 /* If you add a case to this table, also add it to the
118 ARCH_all definition right above this function. */
120 case bfd_arch_aarch64:
121 disassemble = print_insn_aarch64;
126 disassemble = print_insn_alpha;
131 disassemble = arc_get_disassembler (abfd);
136 if (bfd_big_endian (abfd))
137 disassemble = print_insn_big_arm;
139 disassemble = print_insn_little_arm;
144 disassemble = print_insn_avr;
149 disassemble = print_insn_bfin;
154 disassemble = print_insn_cr16;
159 disassemble = cris_get_disassembler (abfd);
164 disassemble = print_insn_crx;
169 disassemble = print_insn_d10v;
174 disassemble = print_insn_d30v;
179 /* As far as I know we only handle big-endian DLX objects. */
180 disassemble = print_insn_dlx;
185 if (bfd_get_mach (abfd) == bfd_mach_h8300h
186 || bfd_get_mach (abfd) == bfd_mach_h8300hn)
187 disassemble = print_insn_h8300h;
188 else if (bfd_get_mach (abfd) == bfd_mach_h8300s
189 || bfd_get_mach (abfd) == bfd_mach_h8300sn
190 || bfd_get_mach (abfd) == bfd_mach_h8300sx
191 || bfd_get_mach (abfd) == bfd_mach_h8300sxn)
192 disassemble = print_insn_h8300s;
194 disassemble = print_insn_h8300;
199 disassemble = print_insn_h8500;
204 disassemble = print_insn_hppa;
209 disassemble = print_insn_i370;
217 disassemble = print_insn_i386;
222 disassemble = print_insn_i860;
227 disassemble = print_insn_i960;
232 disassemble = print_insn_ia64;
237 disassemble = print_insn_ip2k;
241 case bfd_arch_epiphany:
242 disassemble = print_insn_epiphany;
247 disassemble = print_insn_fr30;
252 disassemble = print_insn_lm32;
257 disassemble = print_insn_m32r;
260 #if defined(ARCH_m68hc11) || defined(ARCH_m68hc12) \
261 || defined(ARCH_9s12x) || defined(ARCH_m9s12xg)
262 case bfd_arch_m68hc11:
263 disassemble = print_insn_m68hc11;
265 case bfd_arch_m68hc12:
266 disassemble = print_insn_m68hc12;
268 case bfd_arch_m9s12x:
269 disassemble = print_insn_m9s12x;
271 case bfd_arch_m9s12xg:
272 disassemble = print_insn_m9s12xg;
277 disassemble = print_insn_m68k;
282 disassemble = print_insn_m88k;
287 disassemble = print_insn_mt;
290 #ifdef ARCH_microblaze
291 case bfd_arch_microblaze:
292 disassemble = print_insn_microblaze;
296 case bfd_arch_msp430:
297 disassemble = print_insn_msp430;
302 disassemble = print_insn_nds32;
307 disassemble = print_insn_ns32k;
312 disassemble = print_insn_mcore;
317 disassemble = print_insn_mep;
322 disassemble = print_insn_metag;
327 if (bfd_big_endian (abfd))
328 disassemble = print_insn_big_mips;
330 disassemble = print_insn_little_mips;
335 disassemble = print_insn_mmix;
339 case bfd_arch_mn10200:
340 disassemble = print_insn_mn10200;
344 case bfd_arch_mn10300:
345 disassemble = print_insn_mn10300;
350 if (bfd_big_endian (abfd))
351 disassemble = print_insn_big_nios2;
353 disassemble = print_insn_little_nios2;
358 disassemble = print_insn_or1k;
363 disassemble = print_insn_pdp11;
368 disassemble = print_insn_pj;
372 case bfd_arch_powerpc:
373 if (bfd_big_endian (abfd))
374 disassemble = print_insn_big_powerpc;
376 disassemble = print_insn_little_powerpc;
380 case bfd_arch_rs6000:
381 if (bfd_get_mach (abfd) == bfd_mach_ppc_620)
382 disassemble = print_insn_big_powerpc;
384 disassemble = print_insn_rs6000;
389 disassemble = rl78_get_disassembler (abfd);
394 disassemble = print_insn_rx;
399 disassemble = print_insn_s390;
404 if (bfd_big_endian (abfd))
405 disassemble = print_insn_big_score;
407 disassemble = print_insn_little_score;
412 disassemble = print_insn_sh;
417 disassemble = print_insn_sparc;
422 disassemble = print_insn_spu;
427 disassemble = print_insn_tic30;
432 disassemble = print_insn_tic4x;
436 case bfd_arch_tic54x:
437 disassemble = print_insn_tic54x;
442 disassemble = print_insn_tic6x;
447 disassemble = print_insn_tic80;
452 disassemble = print_insn_ft32;
457 case bfd_arch_v850_rh850:
458 disassemble = print_insn_v850;
463 disassemble = print_insn_w65;
468 disassemble = print_insn_xgate;
471 #ifdef ARCH_xstormy16
472 case bfd_arch_xstormy16:
473 disassemble = print_insn_xstormy16;
478 disassemble = print_insn_xc16x;
482 case bfd_arch_xtensa:
483 disassemble = print_insn_xtensa;
488 disassemble = print_insn_z80;
493 if (bfd_get_mach(abfd) == bfd_mach_z8001)
494 disassemble = print_insn_z8001;
496 disassemble = print_insn_z8002;
501 disassemble = print_insn_vax;
505 case bfd_arch_visium:
506 disassemble = print_insn_visium;
511 disassemble = print_insn_frv;
516 disassemble = print_insn_moxie;
520 case bfd_arch_iq2000:
521 disassemble = print_insn_iq2000;
526 disassemble = print_insn_m32c;
530 case bfd_arch_tilegx:
531 disassemble = print_insn_tilegx;
535 case bfd_arch_tilepro:
536 disassemble = print_insn_tilepro;
546 disassembler_usage (stream)
547 FILE * stream ATTRIBUTE_UNUSED;
550 print_aarch64_disassembler_options (stream);
553 print_arm_disassembler_options (stream);
556 print_mips_disassembler_options (stream);
559 print_ppc_disassembler_options (stream);
562 print_i386_disassembler_options (stream);
565 print_s390_disassembler_options (stream);
572 disassemble_init_for_target (struct disassemble_info * info)
580 case bfd_arch_aarch64:
581 info->symbol_is_valid = aarch64_symbol_is_valid;
582 info->disassembler_needs_relocs = TRUE;
587 info->symbol_is_valid = arm_symbol_is_valid;
588 info->disassembler_needs_relocs = TRUE;
593 info->skip_zeroes = 16;
598 info->skip_zeroes = 32;
603 info->skip_zeroes = 256;
604 info->skip_zeroes_at_end = 0;
609 info->disassembler_needs_relocs = TRUE;
614 /* This processor in fact is little endian. The value set here
615 reflects the way opcodes are written in the cgen description. */
616 info->endian = BFD_ENDIAN_BIG;
617 if (! info->insn_sets)
619 info->insn_sets = cgen_bitset_create (ISA_MAX);
620 if (info->mach == bfd_mach_m16c)
621 cgen_bitset_set (info->insn_sets, ISA_M16C);
623 cgen_bitset_set (info->insn_sets, ISA_M32C);
628 case bfd_arch_powerpc:
631 case bfd_arch_rs6000:
633 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
634 disassemble_init_powerpc (info);