1 /* Select disassembly routine for specified architecture.
2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 Free Software Foundation, Inc.
6 This file is part of the GNU opcodes library.
8 This library 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 3 of the License, or
11 (at your option) 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
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
62 #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;
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_ns32k;
306 disassemble = print_insn_mcore;
311 disassemble = print_insn_mep;
316 disassemble = print_insn_metag;
321 if (bfd_big_endian (abfd))
322 disassemble = print_insn_big_mips;
324 disassemble = print_insn_little_mips;
329 disassemble = print_insn_mmix;
333 case bfd_arch_mn10200:
334 disassemble = print_insn_mn10200;
338 case bfd_arch_mn10300:
339 disassemble = print_insn_mn10300;
344 if (bfd_big_endian (abfd))
345 disassemble = print_insn_big_nios2;
347 disassemble = print_insn_little_nios2;
351 case bfd_arch_openrisc:
352 disassemble = print_insn_openrisc;
357 if (bfd_big_endian (abfd))
358 disassemble = print_insn_big_or32;
360 disassemble = print_insn_little_or32;
365 disassemble = print_insn_pdp11;
370 disassemble = print_insn_pj;
374 case bfd_arch_powerpc:
375 if (bfd_big_endian (abfd))
376 disassemble = print_insn_big_powerpc;
378 disassemble = print_insn_little_powerpc;
382 case bfd_arch_rs6000:
383 if (bfd_get_mach (abfd) == bfd_mach_ppc_620)
384 disassemble = print_insn_big_powerpc;
386 disassemble = print_insn_rs6000;
391 disassemble = print_insn_rl78;
396 disassemble = print_insn_rx;
401 disassemble = print_insn_s390;
406 if (bfd_big_endian (abfd))
407 disassemble = print_insn_big_score;
409 disassemble = print_insn_little_score;
414 disassemble = print_insn_sh;
419 disassemble = print_insn_sparc;
424 disassemble = print_insn_spu;
429 disassemble = print_insn_tic30;
434 disassemble = print_insn_tic4x;
438 case bfd_arch_tic54x:
439 disassemble = print_insn_tic54x;
444 disassemble = print_insn_tic6x;
449 disassemble = print_insn_tic80;
454 case bfd_arch_v850_rh850:
455 disassemble = print_insn_v850;
460 disassemble = print_insn_w65;
465 disassemble = print_insn_xgate;
468 #ifdef ARCH_xstormy16
469 case bfd_arch_xstormy16:
470 disassemble = print_insn_xstormy16;
475 disassemble = print_insn_xc16x;
479 case bfd_arch_xtensa:
480 disassemble = print_insn_xtensa;
485 disassemble = print_insn_z80;
490 if (bfd_get_mach(abfd) == bfd_mach_z8001)
491 disassemble = print_insn_z8001;
493 disassemble = print_insn_z8002;
498 disassemble = print_insn_vax;
503 disassemble = print_insn_frv;
508 disassemble = print_insn_moxie;
512 case bfd_arch_iq2000:
513 disassemble = print_insn_iq2000;
518 disassemble = print_insn_m32c;
522 case bfd_arch_tilegx:
523 disassemble = print_insn_tilegx;
527 case bfd_arch_tilepro:
528 disassemble = print_insn_tilepro;
538 disassembler_usage (stream)
539 FILE * stream ATTRIBUTE_UNUSED;
542 print_aarch64_disassembler_options (stream);
545 print_arm_disassembler_options (stream);
548 print_mips_disassembler_options (stream);
551 print_ppc_disassembler_options (stream);
554 print_i386_disassembler_options (stream);
557 print_s390_disassembler_options (stream);
564 disassemble_init_for_target (struct disassemble_info * info)
572 case bfd_arch_aarch64:
573 info->symbol_is_valid = aarch64_symbol_is_valid;
574 info->disassembler_needs_relocs = TRUE;
579 info->symbol_is_valid = arm_symbol_is_valid;
580 info->disassembler_needs_relocs = TRUE;
585 info->skip_zeroes = 16;
590 info->skip_zeroes = 32;
595 info->skip_zeroes = 256;
596 info->skip_zeroes_at_end = 0;
601 info->disassembler_needs_relocs = TRUE;
606 /* This processor in fact is little endian. The value set here
607 reflects the way opcodes are written in the cgen description. */
608 info->endian = BFD_ENDIAN_BIG;
609 if (! info->insn_sets)
611 info->insn_sets = cgen_bitset_create (ISA_MAX);
612 if (info->mach == bfd_mach_m16c)
613 cgen_bitset_set (info->insn_sets, ISA_M16C);
615 cgen_bitset_set (info->insn_sets, ISA_M32C);
620 case bfd_arch_powerpc:
623 case bfd_arch_rs6000:
625 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
626 disassemble_init_powerpc (info);