1 /* Select disassembly routine for specified architecture.
2 Copyright (C) 1994-2014 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. */
60 #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_nds32
;
304 disassemble
= print_insn_ns32k
;
309 disassemble
= print_insn_mcore
;
314 disassemble
= print_insn_mep
;
319 disassemble
= print_insn_metag
;
324 if (bfd_big_endian (abfd
))
325 disassemble
= print_insn_big_mips
;
327 disassemble
= print_insn_little_mips
;
332 disassemble
= print_insn_mmix
;
336 case bfd_arch_mn10200
:
337 disassemble
= print_insn_mn10200
;
341 case bfd_arch_mn10300
:
342 disassemble
= print_insn_mn10300
;
347 if (bfd_big_endian (abfd
))
348 disassemble
= print_insn_big_nios2
;
350 disassemble
= print_insn_little_nios2
;
355 disassemble
= print_insn_or1k
;
360 disassemble
= print_insn_pdp11
;
365 disassemble
= print_insn_pj
;
369 case bfd_arch_powerpc
:
370 if (bfd_big_endian (abfd
))
371 disassemble
= print_insn_big_powerpc
;
373 disassemble
= print_insn_little_powerpc
;
377 case bfd_arch_rs6000
:
378 if (bfd_get_mach (abfd
) == bfd_mach_ppc_620
)
379 disassemble
= print_insn_big_powerpc
;
381 disassemble
= print_insn_rs6000
;
386 disassemble
= print_insn_rl78
;
391 disassemble
= print_insn_rx
;
396 disassemble
= print_insn_s390
;
401 if (bfd_big_endian (abfd
))
402 disassemble
= print_insn_big_score
;
404 disassemble
= print_insn_little_score
;
409 disassemble
= print_insn_sh
;
414 disassemble
= print_insn_sparc
;
419 disassemble
= print_insn_spu
;
424 disassemble
= print_insn_tic30
;
429 disassemble
= print_insn_tic4x
;
433 case bfd_arch_tic54x
:
434 disassemble
= print_insn_tic54x
;
439 disassemble
= print_insn_tic6x
;
444 disassemble
= print_insn_tic80
;
449 case bfd_arch_v850_rh850
:
450 disassemble
= print_insn_v850
;
455 disassemble
= print_insn_w65
;
460 disassemble
= print_insn_xgate
;
463 #ifdef ARCH_xstormy16
464 case bfd_arch_xstormy16
:
465 disassemble
= print_insn_xstormy16
;
470 disassemble
= print_insn_xc16x
;
474 case bfd_arch_xtensa
:
475 disassemble
= print_insn_xtensa
;
480 disassemble
= print_insn_z80
;
485 if (bfd_get_mach(abfd
) == bfd_mach_z8001
)
486 disassemble
= print_insn_z8001
;
488 disassemble
= print_insn_z8002
;
493 disassemble
= print_insn_vax
;
498 disassemble
= print_insn_frv
;
503 disassemble
= print_insn_moxie
;
507 case bfd_arch_iq2000
:
508 disassemble
= print_insn_iq2000
;
513 disassemble
= print_insn_m32c
;
517 case bfd_arch_tilegx
:
518 disassemble
= print_insn_tilegx
;
522 case bfd_arch_tilepro
:
523 disassemble
= print_insn_tilepro
;
533 disassembler_usage (stream
)
534 FILE * stream ATTRIBUTE_UNUSED
;
537 print_aarch64_disassembler_options (stream
);
540 print_arm_disassembler_options (stream
);
543 print_mips_disassembler_options (stream
);
546 print_ppc_disassembler_options (stream
);
549 print_i386_disassembler_options (stream
);
552 print_s390_disassembler_options (stream
);
559 disassemble_init_for_target (struct disassemble_info
* info
)
567 case bfd_arch_aarch64
:
568 info
->symbol_is_valid
= aarch64_symbol_is_valid
;
569 info
->disassembler_needs_relocs
= TRUE
;
574 info
->symbol_is_valid
= arm_symbol_is_valid
;
575 info
->disassembler_needs_relocs
= TRUE
;
580 info
->skip_zeroes
= 16;
585 info
->skip_zeroes
= 32;
590 info
->skip_zeroes
= 256;
591 info
->skip_zeroes_at_end
= 0;
596 info
->disassembler_needs_relocs
= TRUE
;
601 /* This processor in fact is little endian. The value set here
602 reflects the way opcodes are written in the cgen description. */
603 info
->endian
= BFD_ENDIAN_BIG
;
604 if (! info
->insn_sets
)
606 info
->insn_sets
= cgen_bitset_create (ISA_MAX
);
607 if (info
->mach
== bfd_mach_m16c
)
608 cgen_bitset_set (info
->insn_sets
, ISA_M16C
);
610 cgen_bitset_set (info
->insn_sets
, ISA_M32C
);
615 case bfd_arch_powerpc
:
618 case bfd_arch_rs6000
:
620 #if defined (ARCH_powerpc) || defined (ARCH_rs6000)
621 disassemble_init_powerpc (info
);