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. */
61 #define ARCH_microblaze
93 #define ARCH_xstormy16
99 #define INCLUDE_SHMEDIA
103 #include "m32c-desc.h"
110 enum bfd_architecture a
= bfd_get_arch (abfd
);
111 disassembler_ftype disassemble
;
115 /* If you add a case to this table, also add it to the
116 ARCH_all definition right above this function. */
118 case bfd_arch_aarch64
:
119 disassemble
= print_insn_aarch64
;
124 disassemble
= print_insn_alpha
;
129 disassemble
= arc_get_disassembler (abfd
);
134 if (bfd_big_endian (abfd
))
135 disassemble
= print_insn_big_arm
;
137 disassemble
= print_insn_little_arm
;
142 disassemble
= print_insn_avr
;
147 disassemble
= print_insn_bfin
;
152 disassemble
= print_insn_cr16
;
157 disassemble
= cris_get_disassembler (abfd
);
162 disassemble
= print_insn_crx
;
167 disassemble
= print_insn_d10v
;
172 disassemble
= print_insn_d30v
;
177 /* As far as I know we only handle big-endian DLX objects. */
178 disassemble
= print_insn_dlx
;
183 if (bfd_get_mach (abfd
) == bfd_mach_h8300h
184 || bfd_get_mach (abfd
) == bfd_mach_h8300hn
)
185 disassemble
= print_insn_h8300h
;
186 else if (bfd_get_mach (abfd
) == bfd_mach_h8300s
187 || bfd_get_mach (abfd
) == bfd_mach_h8300sn
188 || bfd_get_mach (abfd
) == bfd_mach_h8300sx
189 || bfd_get_mach (abfd
) == bfd_mach_h8300sxn
)
190 disassemble
= print_insn_h8300s
;
192 disassemble
= print_insn_h8300
;
197 disassemble
= print_insn_h8500
;
202 disassemble
= print_insn_hppa
;
207 disassemble
= print_insn_i370
;
214 disassemble
= print_insn_i386
;
219 disassemble
= print_insn_i860
;
224 disassemble
= print_insn_i960
;
229 disassemble
= print_insn_ia64
;
234 disassemble
= print_insn_ip2k
;
238 case bfd_arch_epiphany
:
239 disassemble
= print_insn_epiphany
;
244 disassemble
= print_insn_fr30
;
249 disassemble
= print_insn_lm32
;
254 disassemble
= print_insn_m32r
;
257 #if defined(ARCH_m68hc11) || defined(ARCH_m68hc12) \
258 || defined(ARCH_9s12x) || defined(ARCH_m9s12xg)
259 case bfd_arch_m68hc11
:
260 disassemble
= print_insn_m68hc11
;
262 case bfd_arch_m68hc12
:
263 disassemble
= print_insn_m68hc12
;
265 case bfd_arch_m9s12x
:
266 disassemble
= print_insn_m9s12x
;
268 case bfd_arch_m9s12xg
:
269 disassemble
= print_insn_m9s12xg
;
274 disassemble
= print_insn_m68k
;
279 disassemble
= print_insn_m88k
;
284 disassemble
= print_insn_mt
;
287 #ifdef ARCH_microblaze
288 case bfd_arch_microblaze
:
289 disassemble
= print_insn_microblaze
;
293 case bfd_arch_msp430
:
294 disassemble
= print_insn_msp430
;
299 disassemble
= print_insn_ns32k
;
304 disassemble
= print_insn_mcore
;
309 disassemble
= print_insn_mep
;
314 if (bfd_big_endian (abfd
))
315 disassemble
= print_insn_big_mips
;
317 disassemble
= print_insn_little_mips
;
322 disassemble
= print_insn_mmix
;
326 case bfd_arch_mn10200
:
327 disassemble
= print_insn_mn10200
;
331 case bfd_arch_mn10300
:
332 disassemble
= print_insn_mn10300
;
336 case bfd_arch_openrisc
:
337 disassemble
= print_insn_openrisc
;
342 if (bfd_big_endian (abfd
))
343 disassemble
= print_insn_big_or32
;
345 disassemble
= print_insn_little_or32
;
350 disassemble
= print_insn_pdp11
;
355 disassemble
= print_insn_pj
;
359 case bfd_arch_powerpc
:
360 if (bfd_big_endian (abfd
))
361 disassemble
= print_insn_big_powerpc
;
363 disassemble
= print_insn_little_powerpc
;
367 case bfd_arch_rs6000
:
368 if (bfd_get_mach (abfd
) == bfd_mach_ppc_620
)
369 disassemble
= print_insn_big_powerpc
;
371 disassemble
= print_insn_rs6000
;
376 disassemble
= print_insn_rl78
;
381 disassemble
= print_insn_rx
;
386 disassemble
= print_insn_s390
;
391 if (bfd_big_endian (abfd
))
392 disassemble
= print_insn_big_score
;
394 disassemble
= print_insn_little_score
;
399 disassemble
= print_insn_sh
;
404 disassemble
= print_insn_sparc
;
409 disassemble
= print_insn_spu
;
414 disassemble
= print_insn_tic30
;
419 disassemble
= print_insn_tic4x
;
423 case bfd_arch_tic54x
:
424 disassemble
= print_insn_tic54x
;
429 disassemble
= print_insn_tic6x
;
434 disassemble
= print_insn_tic80
;
439 disassemble
= print_insn_v850
;
444 disassemble
= print_insn_w65
;
449 disassemble
= print_insn_xgate
;
452 #ifdef ARCH_xstormy16
453 case bfd_arch_xstormy16
:
454 disassemble
= print_insn_xstormy16
;
459 disassemble
= print_insn_xc16x
;
463 case bfd_arch_xtensa
:
464 disassemble
= print_insn_xtensa
;
469 disassemble
= print_insn_z80
;
474 if (bfd_get_mach(abfd
) == bfd_mach_z8001
)
475 disassemble
= print_insn_z8001
;
477 disassemble
= print_insn_z8002
;
482 disassemble
= print_insn_vax
;
487 disassemble
= print_insn_frv
;
492 disassemble
= print_insn_moxie
;
496 case bfd_arch_iq2000
:
497 disassemble
= print_insn_iq2000
;
502 disassemble
= print_insn_m32c
;
506 case bfd_arch_tilegx
:
507 disassemble
= print_insn_tilegx
;
511 case bfd_arch_tilepro
:
512 disassemble
= print_insn_tilepro
;
522 disassembler_usage (stream
)
523 FILE * stream ATTRIBUTE_UNUSED
;
526 print_aarch64_disassembler_options (stream
);
529 print_arm_disassembler_options (stream
);
532 print_mips_disassembler_options (stream
);
535 print_ppc_disassembler_options (stream
);
538 print_i386_disassembler_options (stream
);
541 print_s390_disassembler_options (stream
);
548 disassemble_init_for_target (struct disassemble_info
* info
)
556 case bfd_arch_aarch64
:
557 info
->symbol_is_valid
= aarch64_symbol_is_valid
;
558 info
->disassembler_needs_relocs
= TRUE
;
563 info
->symbol_is_valid
= arm_symbol_is_valid
;
564 info
->disassembler_needs_relocs
= TRUE
;
569 info
->skip_zeroes
= 16;
574 info
->skip_zeroes
= 32;
579 info
->skip_zeroes
= 256;
580 info
->skip_zeroes_at_end
= 0;
585 /* This processor in fact is little endian. The value set here
586 reflects the way opcodes are written in the cgen description. */
587 info
->endian
= BFD_ENDIAN_BIG
;
588 if (! info
->insn_sets
)
590 info
->insn_sets
= cgen_bitset_create (ISA_MAX
);
591 if (info
->mach
== bfd_mach_m16c
)
592 cgen_bitset_set (info
->insn_sets
, ISA_M16C
);
594 cgen_bitset_set (info
->insn_sets
, ISA_M32C
);
599 case bfd_arch_powerpc
:
602 case bfd_arch_rs6000
:
604 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
605 disassemble_init_powerpc (info
);