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. */
60 #define ARCH_microblaze
92 #define ARCH_xstormy16
98 #define INCLUDE_SHMEDIA
102 #include "m32c-desc.h"
109 enum bfd_architecture a
= bfd_get_arch (abfd
);
110 disassembler_ftype disassemble
;
114 /* If you add a case to this table, also add it to the
115 ARCH_all definition right above this function. */
118 disassemble
= print_insn_alpha
;
123 disassemble
= arc_get_disassembler (abfd
);
128 if (bfd_big_endian (abfd
))
129 disassemble
= print_insn_big_arm
;
131 disassemble
= print_insn_little_arm
;
136 disassemble
= print_insn_avr
;
141 disassemble
= print_insn_bfin
;
146 disassemble
= print_insn_cr16
;
151 disassemble
= cris_get_disassembler (abfd
);
156 disassemble
= print_insn_crx
;
161 disassemble
= print_insn_d10v
;
166 disassemble
= print_insn_d30v
;
171 /* As far as I know we only handle big-endian DLX objects. */
172 disassemble
= print_insn_dlx
;
177 if (bfd_get_mach (abfd
) == bfd_mach_h8300h
178 || bfd_get_mach (abfd
) == bfd_mach_h8300hn
)
179 disassemble
= print_insn_h8300h
;
180 else if (bfd_get_mach (abfd
) == bfd_mach_h8300s
181 || bfd_get_mach (abfd
) == bfd_mach_h8300sn
182 || bfd_get_mach (abfd
) == bfd_mach_h8300sx
183 || bfd_get_mach (abfd
) == bfd_mach_h8300sxn
)
184 disassemble
= print_insn_h8300s
;
186 disassemble
= print_insn_h8300
;
191 disassemble
= print_insn_h8500
;
196 disassemble
= print_insn_hppa
;
201 disassemble
= print_insn_i370
;
208 disassemble
= print_insn_i386
;
213 disassemble
= print_insn_i860
;
218 disassemble
= print_insn_i960
;
223 disassemble
= print_insn_ia64
;
228 disassemble
= print_insn_ip2k
;
232 case bfd_arch_epiphany
:
233 disassemble
= print_insn_epiphany
;
238 disassemble
= print_insn_fr30
;
243 disassemble
= print_insn_lm32
;
248 disassemble
= print_insn_m32r
;
251 #if defined(ARCH_m68hc11) || defined(ARCH_m68hc12)
252 case bfd_arch_m68hc11
:
253 disassemble
= print_insn_m68hc11
;
255 case bfd_arch_m68hc12
:
256 disassemble
= print_insn_m68hc12
;
261 disassemble
= print_insn_m68k
;
266 disassemble
= print_insn_m88k
;
271 disassemble
= print_insn_mt
;
274 #ifdef ARCH_microblaze
275 case bfd_arch_microblaze
:
276 disassemble
= print_insn_microblaze
;
280 case bfd_arch_msp430
:
281 disassemble
= print_insn_msp430
;
286 disassemble
= print_insn_ns32k
;
291 disassemble
= print_insn_mcore
;
296 disassemble
= print_insn_mep
;
301 if (bfd_big_endian (abfd
))
302 disassemble
= print_insn_big_mips
;
304 disassemble
= print_insn_little_mips
;
309 disassemble
= print_insn_mmix
;
313 case bfd_arch_mn10200
:
314 disassemble
= print_insn_mn10200
;
318 case bfd_arch_mn10300
:
319 disassemble
= print_insn_mn10300
;
323 case bfd_arch_openrisc
:
324 disassemble
= print_insn_openrisc
;
329 if (bfd_big_endian (abfd
))
330 disassemble
= print_insn_big_or32
;
332 disassemble
= print_insn_little_or32
;
337 disassemble
= print_insn_pdp11
;
342 disassemble
= print_insn_pj
;
346 case bfd_arch_powerpc
:
347 if (bfd_big_endian (abfd
))
348 disassemble
= print_insn_big_powerpc
;
350 disassemble
= print_insn_little_powerpc
;
354 case bfd_arch_rs6000
:
355 if (bfd_get_mach (abfd
) == bfd_mach_ppc_620
)
356 disassemble
= print_insn_big_powerpc
;
358 disassemble
= print_insn_rs6000
;
363 disassemble
= print_insn_rl78
;
368 disassemble
= print_insn_rx
;
373 disassemble
= print_insn_s390
;
378 if (bfd_big_endian (abfd
))
379 disassemble
= print_insn_big_score
;
381 disassemble
= print_insn_little_score
;
386 disassemble
= print_insn_sh
;
391 disassemble
= print_insn_sparc
;
396 disassemble
= print_insn_spu
;
401 disassemble
= print_insn_tic30
;
406 disassemble
= print_insn_tic4x
;
410 case bfd_arch_tic54x
:
411 disassemble
= print_insn_tic54x
;
416 disassemble
= print_insn_tic6x
;
421 disassemble
= print_insn_tic80
;
426 disassemble
= print_insn_v850
;
431 disassemble
= print_insn_w65
;
436 disassemble
= print_insn_xgate
;
439 #ifdef ARCH_xstormy16
440 case bfd_arch_xstormy16
:
441 disassemble
= print_insn_xstormy16
;
446 disassemble
= print_insn_xc16x
;
450 case bfd_arch_xtensa
:
451 disassemble
= print_insn_xtensa
;
456 disassemble
= print_insn_z80
;
461 if (bfd_get_mach(abfd
) == bfd_mach_z8001
)
462 disassemble
= print_insn_z8001
;
464 disassemble
= print_insn_z8002
;
469 disassemble
= print_insn_vax
;
474 disassemble
= print_insn_frv
;
479 disassemble
= print_insn_moxie
;
483 case bfd_arch_iq2000
:
484 disassemble
= print_insn_iq2000
;
489 disassemble
= print_insn_m32c
;
493 case bfd_arch_tilegx
:
494 disassemble
= print_insn_tilegx
;
498 case bfd_arch_tilepro
:
499 disassemble
= print_insn_tilepro
;
509 disassembler_usage (stream
)
510 FILE * stream ATTRIBUTE_UNUSED
;
513 print_arm_disassembler_options (stream
);
516 print_mips_disassembler_options (stream
);
519 print_ppc_disassembler_options (stream
);
522 print_i386_disassembler_options (stream
);
525 print_s390_disassembler_options (stream
);
532 disassemble_init_for_target (struct disassemble_info
* info
)
541 info
->symbol_is_valid
= arm_symbol_is_valid
;
542 info
->disassembler_needs_relocs
= TRUE
;
547 info
->skip_zeroes
= 16;
552 info
->skip_zeroes
= 32;
557 info
->skip_zeroes
= 256;
558 info
->skip_zeroes_at_end
= 0;
563 /* This processor in fact is little endian. The value set here
564 reflects the way opcodes are written in the cgen description. */
565 info
->endian
= BFD_ENDIAN_BIG
;
566 if (! info
->insn_sets
)
568 info
->insn_sets
= cgen_bitset_create (ISA_MAX
);
569 if (info
->mach
== bfd_mach_m16c
)
570 cgen_bitset_set (info
->insn_sets
, ISA_M16C
);
572 cgen_bitset_set (info
->insn_sets
, ISA_M32C
);
577 case bfd_arch_powerpc
:
580 case bfd_arch_rs6000
:
582 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
583 disassemble_init_powerpc (info
);