diff options
author | Alan Modra <amodra@gmail.com> | 2018-04-16 15:26:05 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-04-16 15:26:05 +0930 |
commit | a9a4b30244006a0087c5a7bf73cbb13927f1d9f1 (patch) | |
tree | c3822fe01e204e7ad80a57e92afc0d103b390605 | |
parent | 04cb01fd5a3bc167ae26486bbc2bf941e96ad805 (diff) | |
download | gdb-a9a4b30244006a0087c5a7bf73cbb13927f1d9f1.zip gdb-a9a4b30244006a0087c5a7bf73cbb13927f1d9f1.tar.gz gdb-a9a4b30244006a0087c5a7bf73cbb13927f1d9f1.tar.bz2 |
Remove w65 support
include/
* coff/internal.h: Remove w65 support.
* coff/w65.h: Delete.
bfd/
* Makefile.am: Remove w65 support.
* archures.c: Likewise.
* coffcode.h: Likewise.
* config.bfd: Likewise.
* configure.ac: Likewise.
* targets.c: Likewise.
* coff-w65.c: Delete.
* cpu-w65.c: Delete.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
opcodes/
* Makefile.am: Remove w65 support.
* configure.ac: Likewise.
* disassemble.c: Likewise.
* disassemble.h: Likewise.
* w65-dis.c: Delete.
* w65-opc.h: Delete.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/POTFILES.in: Regenerate.
binutils/
* testsuite/binutils-all/objcopy.exp: Remove w65 support.
ld/
* Makefile.am: Remove w65 support.
* configure.tgt: Likewise.
* emulparams/w65.sh: Delete.
* scripttempl/w65.sc: Delete.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.
35 files changed, 47 insertions, 1306 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4e81da9..95e37e7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,20 @@ 2018-04-16 Alan Modra <amodra@gmail.com> + * Makefile.am: Remove w65 support. + * archures.c: Likewise. + * coffcode.h: Likewise. + * config.bfd: Likewise. + * configure.ac: Likewise. + * targets.c: Likewise. + * coff-w65.c: Delete. + * cpu-w65.c: Delete. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2018-04-16 Alan Modra <amodra@gmail.com> + * Makefile.am: Remove we32k support. * archures.c: Likewise. * coffcode.h: Likewise. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 9a097b1..14d4eca 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -163,7 +163,6 @@ ALL_MACHINES = \ cpu-v850_rh850.lo \ cpu-vax.lo \ cpu-visium.lo \ - cpu-w65.lo \ cpu-wasm32.lo \ cpu-xc16x.lo \ cpu-xgate.lo \ @@ -248,7 +247,6 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-visium.c \ cpu-wasm32.c \ - cpu-w65.c \ cpu-xc16x.c \ cpu-xgate.c \ cpu-xstormy16.c \ @@ -286,7 +284,6 @@ BFD32_BACKENDS = \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ - coff-w65.lo \ coff-z80.lo \ coff-z8k.lo \ coffgen.lo \ @@ -462,7 +459,6 @@ BFD32_BACKENDS_CFILES = \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ - coff-w65.c \ coff-z80.c \ coff-z8k.c \ coffgen.c \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index fe87949..0c8c604 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -496,7 +496,6 @@ ALL_MACHINES = \ cpu-v850_rh850.lo \ cpu-vax.lo \ cpu-visium.lo \ - cpu-w65.lo \ cpu-wasm32.lo \ cpu-xc16x.lo \ cpu-xgate.lo \ @@ -581,7 +580,6 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-visium.c \ cpu-wasm32.c \ - cpu-w65.c \ cpu-xc16x.c \ cpu-xgate.c \ cpu-xstormy16.c \ @@ -620,7 +618,6 @@ BFD32_BACKENDS = \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ - coff-w65.lo \ coff-z80.lo \ coff-z8k.lo \ coffgen.lo \ @@ -796,7 +793,6 @@ BFD32_BACKENDS_CFILES = \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ - coff-w65.c \ coff-z80.c \ coff-z8k.c \ coffgen.c \ @@ -1303,7 +1299,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic54x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-tic80.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-u68k.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-w65.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-x86_64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-z80.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-z8k.Plo@am__quote@ @@ -1386,7 +1381,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-v850_rh850.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-vax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-visium.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-w65.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-wasm32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xgate.Plo@am__quote@ diff --git a/bfd/archures.c b/bfd/archures.c index 1c5bfdf..5adfc2f 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -332,7 +332,6 @@ DESCRIPTION .#define bfd_mach_n1h_v3 4 .#define bfd_mach_n1h_v3m 5 . bfd_arch_ns32k, {* National Semiconductors ns32000. *} -. bfd_arch_w65, {* WDC 65816. *} . bfd_arch_tic30, {* Texas Instruments TMS320C30. *} . bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X. *} .#define bfd_mach_tic3x 30 @@ -633,7 +632,6 @@ extern const bfd_arch_info_type bfd_v850_rh850_arch; extern const bfd_arch_info_type bfd_vax_arch; extern const bfd_arch_info_type bfd_visium_arch; extern const bfd_arch_info_type bfd_wasm32_arch; -extern const bfd_arch_info_type bfd_w65_arch; extern const bfd_arch_info_type bfd_xstormy16_arch; extern const bfd_arch_info_type bfd_xtensa_arch; extern const bfd_arch_info_type bfd_xc16x_arch; @@ -718,7 +716,6 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_v850_rh850_arch, &bfd_vax_arch, &bfd_visium_arch, - &bfd_w65_arch, &bfd_wasm32_arch, &bfd_xstormy16_arch, &bfd_xtensa_arch, diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 9ebe628..bbbdf01 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2207,7 +2207,6 @@ enum bfd_architecture #define bfd_mach_n1h_v3 4 #define bfd_mach_n1h_v3m 5 bfd_arch_ns32k, /* National Semiconductors ns32000. */ - bfd_arch_w65, /* WDC 65816. */ bfd_arch_tic30, /* Texas Instruments TMS320C30. */ bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c deleted file mode 100644 index 68b2c94..0000000 --- a/bfd/coff-w65.c +++ /dev/null @@ -1,375 +0,0 @@ -/* BFD back-end for WDC 65816 COFF binaries. - Copyright (C) 1995-2018 Free Software Foundation, Inc. - Written by Steve Chamberlain, <sac@cygnus.com>. - - This file is part of BFD, the Binary File Descriptor library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libbfd.h" -#include "bfdlink.h" -#include "coff/w65.h" -#include "coff/internal.h" -#include "libcoff.h" - -#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) -static reloc_howto_type howto_table[] = -{ - HOWTO (R_W65_ABS8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_ABS24, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs24", TRUE, 0x00ffffff, 0x00ffffff, FALSE), - HOWTO (R_W65_ABS8S8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, ">abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS8S16, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "^abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS16S8, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, ">abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_ABS16S16,1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "^abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_PCR8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "pcrel8", TRUE, 0x000000ff, 0x000000ff, TRUE), - HOWTO (R_W65_PCR16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, TRUE), - HOWTO (R_W65_DP, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "dp", TRUE, 0x000000ff, 0x000000ff, FALSE), -}; - -#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) - -/* Turn a howto into a reloc number. */ - -#define SELECT_RELOC(x,howto) \ - { x.r_type = select_reloc(howto); } - -#define BADMAG(x) (W65BADMAG(x)) -#define W65 1 /* Customize coffcode.h */ -#define __A_MAGIC_SET__ - -/* Code to swap in the reloc */ -#define SWAP_IN_RELOC_OFFSET H_GET_32 -#define SWAP_OUT_RELOC_OFFSET H_PUT_32 -#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \ - dst->r_stuff[0] = 'S'; \ - dst->r_stuff[1] = 'C'; - -static int -select_reloc (reloc_howto_type *howto) -{ - return howto->type; -} - -/* Code to turn a r_type into a howto ptr, uses the above howto table. */ - -static void -rtype2howto (arelent *internal, - struct internal_reloc *dst) -{ - if (dst->r_type > 0 && dst->r_type <= NUM_HOWTOS) - internal->howto = howto_table + dst->r_type - 1; - else - internal->howto = NULL; -} - -#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - -/* Perform any necessary magic to the addend in a reloc entry. */ - -#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ - cache_ptr->addend = ext_reloc.r_offset; - -#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ - reloc_processing(relent, reloc, symbols, abfd, section) - -static void -reloc_processing (arelent * relent, - struct internal_reloc *reloc, - asymbol ** symbols, - bfd * abfd, - asection * section) -{ - relent->address = reloc->r_vaddr; - rtype2howto (relent, reloc); - - if (((int) reloc->r_symndx) > 0) - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - else - relent->sym_ptr_ptr = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; - - relent->addend = reloc->r_offset; - - relent->address -= section->vma; - /* relent->section = 0;*/ -} - -static int -w65_reloc16_estimate (bfd *abfd, - asection *input_section, - arelent *reloc, - unsigned int shrink, - struct bfd_link_info *link_info) -{ - bfd_vma value; - bfd_vma dot; - bfd_vma gap; - - /* The address of the thing to be relocated will have moved back by - the size of the shrink - but we don't change reloc->address here, - since we need it to know where the relocation lives in the source - uncooked section. */ - - /* reloc->address -= shrink; conceptual */ - - bfd_vma address = reloc->address - shrink; - - switch (reloc->howto->type) - { - case R_MOV16B2: - case R_JMP2: - shrink+=2; - break; - - /* Thing is a move one byte. */ - case R_MOV16B1: - value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - - if (value >= 0xff00) - { - /* Change the reloc type from 16bit, possible 8 to 8bit - possible 16. */ - reloc->howto = reloc->howto + 1; - /* The place to relc moves back by one. */ - /* This will be two bytes smaller in the long run. */ - shrink += 2; - bfd_perform_slip (abfd, 2, input_section, address); - } - - break; - /* This is the 24 bit branch which could become an 8 bitter, - the relocation points to the first byte of the insn, not the - actual data. */ - - case R_JMPL1: - value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - - dot = input_section->output_section->vma + - input_section->output_offset + address; - - /* See if the address we're looking at within 127 bytes of where - we are, if so then we can use a small branch rather than the - jump we were going to. */ - gap = value - dot; - - if (-120 < (long) gap && (long) gap < 120) - { - /* Change the reloc type from 24bit, possible 8 to 8bit - possible 32. */ - reloc->howto = reloc->howto + 1; - /* This will be two bytes smaller in the long run. */ - shrink += 2; - bfd_perform_slip (abfd, 2, input_section, address); - } - break; - - case R_JMP1: - value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - - dot = input_section->output_section->vma + - input_section->output_offset + address; - - /* See if the address we're looking at within 127 bytes of where - we are, if so then we can use a small branch rather than the - jump we were going to. */ - gap = value - (dot - shrink); - - if (-120 < (long) gap && (long) gap < 120) - { - /* Change the reloc type from 16bit, possible 8 to 8bit - possible 16. */ - reloc->howto = reloc->howto + 1; - /* The place to relc moves back by one. */ - - /* This will be two bytes smaller in the long run. */ - shrink += 2; - bfd_perform_slip (abfd, 2, input_section, address); - } - break; - } - - return shrink; -} - -/* First phase of a relaxing link. */ - -/* Reloc types - large small - R_MOV16B1 R_MOV16B2 mov.b with 16bit or 8 bit address - R_JMP1 R_JMP2 jmp or pcrel branch - R_JMPL1 R_JMPL_B8 24jmp or pcrel branch - R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b */ - -static void -w65_reloc16_extra_cases (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - arelent *reloc, - bfd_byte *data, - unsigned int *src_ptr, - unsigned int *dst_ptr) -{ - unsigned int src_address = *src_ptr; - unsigned int dst_address = *dst_ptr; - asection *input_section = link_order->u.indirect.section; - - switch (reloc->howto->type) - { - case R_W65_ABS8: - case R_W65_DP: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_put_8 (abfd, gap, data + dst_address); - dst_address += 1; - src_address += 1; - } - break; - - case R_W65_ABS8S8: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - gap >>= 8; - bfd_put_8 (abfd, gap, data + dst_address); - dst_address += 1; - src_address += 1; - } - break; - - case R_W65_ABS8S16: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - gap >>= 16; - bfd_put_8 (abfd, gap, data + dst_address); - dst_address += 1; - src_address += 1; - } - break; - - case R_W65_ABS16: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - - bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address); - dst_address += 2; - src_address += 2; - } - break; - case R_W65_ABS16S8: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - gap >>= 8; - bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address); - dst_address += 2; - src_address += 2; - } - break; - case R_W65_ABS16S16: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - gap >>= 16; - bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address); - dst_address += 2; - src_address += 2; - } - break; - - case R_W65_ABS24: - { - unsigned int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address); - bfd_put_8 (abfd, gap >> 16, data+dst_address + 2); - dst_address += 3; - src_address += 3; - } - break; - - case R_W65_PCR8: - { - int gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (dst_address - + input_section->output_offset - + input_section->output_section->vma); - - gap -= dot + 1; - if (gap < -128 || gap > 127) - (*link_info->callbacks->reloc_overflow) - (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr), - reloc->howto->name, reloc->addend, input_section->owner, - input_section, reloc->address); - - bfd_put_8 (abfd, gap, data + dst_address); - dst_address += 1; - src_address += 1; - } - break; - - case R_W65_PCR16: - { - bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info, - input_section); - bfd_vma dot = (dst_address - + input_section->output_offset - + input_section->output_section->vma); - - /* This wraps within the page, so ignore the relativeness, look at the - high part. */ - if ((gap & 0xf0000) != (dot & 0xf0000)) - (*link_info->callbacks->reloc_overflow) - (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr), - reloc->howto->name, reloc->addend, input_section->owner, - input_section, reloc->address); - - gap -= dot + 2; - bfd_put_16 (abfd, gap, data + dst_address); - dst_address += 2; - src_address += 2; - } - break; - default: - _bfd_error_handler (_("%pB: %s unsupported"), abfd, reloc->howto->name); - break; - - } - *src_ptr = src_address; - *dst_ptr = dst_address; -} - -#define coff_reloc16_extra_cases w65_reloc16_extra_cases -#define coff_reloc16_estimate w65_reloc16_estimate - -#ifndef bfd_pe_print_pdata -#define bfd_pe_print_pdata NULL -#endif - -#include "coffcode.h" - -#undef coff_bfd_get_relocated_section_contents -#undef coff_bfd_relax_section -#define coff_bfd_get_relocated_section_contents \ - bfd_coff_reloc16_get_relocated_section_contents -#define coff_bfd_relax_section bfd_coff_reloc16_relax_section - -CREATE_LITTLE_COFF_TARGET_VEC (w65_coff_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 12c84c4..8674850 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -2347,12 +2347,6 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr) break; #endif -#ifdef W65MAGIC - case W65MAGIC: - arch = bfd_arch_w65; - break; -#endif - default: /* Unreadable input file type. */ arch = bfd_arch_obscure; break; @@ -2862,12 +2856,6 @@ coff_set_flags (bfd * abfd, return TRUE; #endif -#ifdef W65MAGIC - case bfd_arch_w65: - *magicp = W65MAGIC; - return TRUE; -#endif - default: /* Unknown architecture. */ /* Fall through to "return FALSE" below, to avoid "statement never reached" errors on the one below. */ diff --git a/bfd/config.bfd b/bfd/config.bfd index a0c1c10..ae15c9f 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -104,7 +104,6 @@ case $targ in sparc64-*-aout* | \ sparc*-*-coff* | \ vax-*-bsd* | vax-*-ultrix* | \ - w65-*-* | \ sh5*-*-* | sh64*-*-* | \ null) if test "x$enable_obsolete" != xyes; then @@ -143,6 +142,7 @@ case $targ in sparc-*-lynxos* | \ tahoe-*-* | \ vax-*-vms* | \ + w65-*-* | \ we32k-*-* | \ null) echo "*** Configuration $targ is obsolete." >&2 @@ -1723,10 +1723,6 @@ case "${targ}" in targ_selvecs="wasm_vec" ;; - w65-*-*) - targ_defvec=w65_coff_vec - ;; - xgate-*-*) targ_defvec=xgate_elf32_vec targ_selvecs="xgate_elf32_vec" diff --git a/bfd/configure b/bfd/configure index c8d6b21..210dbcc 100755 --- a/bfd/configure +++ b/bfd/configure @@ -14625,7 +14625,6 @@ do vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; ft32_elf32_vec) tb="$tb elf32-ft32.lo elf32.lo $elf" ;; visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; - w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; wasm_vec) tb="$tb wasm-module.lo" ;; wasm32_elf32_vec) tb="$tb elf32-wasm32.lo elf32.lo $elf" ;; x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; diff --git a/bfd/configure.ac b/bfd/configure.ac index 5b5bfc1..f75dbf9 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -702,7 +702,6 @@ do vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; ft32_elf32_vec) tb="$tb elf32-ft32.lo elf32.lo $elf" ;; visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; - w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; wasm_vec) tb="$tb wasm-module.lo" ;; wasm32_elf32_vec) tb="$tb elf32-wasm32.lo elf32.lo $elf" ;; x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; diff --git a/bfd/cpu-w65.c b/bfd/cpu-w65.c deleted file mode 100644 index fc99abc..0000000 --- a/bfd/cpu-w65.c +++ /dev/null @@ -1,52 +0,0 @@ -/* BFD library support routines for the WDC 65816 architecture. - Copyright (C) 1995-2018 Free Software Foundation, Inc. - Hacked by Steve Chamberlain of Cygnus Support. - - This file is part of BFD, the Binary File Descriptor library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libbfd.h" - -static bfd_boolean -scan_mach (const struct bfd_arch_info *info ATTRIBUTE_UNUSED, - const char *string) -{ - if (strcmp(string,"w65") == 0) - return TRUE; - if (strcmp(string,"w65816") == 0) - return TRUE; - return FALSE; -} - -const bfd_arch_info_type bfd_w65_arch = -{ - 16, /* 16 bits in a word */ - 24, /* 24 bits in an address */ - 8, /* 8 bits in a byte */ - bfd_arch_w65, - 0, /* only 1 machine */ - "w65", /* arch_name */ - "w65", /* printable name */ - 1, - TRUE, /* the default machine */ - bfd_default_compatible, - scan_mach, - bfd_arch_default_fill, - 0, -}; diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index b6007b5..c52c3d4 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -42,7 +42,6 @@ coff-tic4x.c coff-tic54x.c coff-tic80.c coff-u68k.c -coff-w65.c coff-x86_64.c coff-z80.c coff-z8k.c @@ -127,7 +126,6 @@ cpu-v850.c cpu-v850_rh850.c cpu-vax.c cpu-visium.c -cpu-w65.c cpu-wasm32.c cpu-xc16x.c cpu-xgate.c diff --git a/bfd/targets.c b/bfd/targets.c index 4ba9652..a8413cb 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -883,7 +883,6 @@ extern const bfd_target vax_aout_bsd_vec; extern const bfd_target vax_aout_nbsd_vec; extern const bfd_target vax_elf32_vec; extern const bfd_target visium_elf32_vec; -extern const bfd_target w65_coff_vec; extern const bfd_target wasm_vec; extern const bfd_target wasm32_elf32_vec; extern const bfd_target x86_64_coff_vec; @@ -1382,8 +1381,6 @@ static const bfd_target * const _bfd_target_vector[] = &visium_elf32_vec, - &w65_coff_vec, - &wasm_vec, &wasm32_elf32_vec, diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9ff778c..419d6bb 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,9 @@ 2018-04-16 Alan Modra <amodra@gmail.com> + * testsuite/binutils-all/objcopy.exp: Remove w65 support. + +2018-04-16 Alan Modra <amodra@gmail.com> + * testsuite/binutils-all/objdump.exp: Remove we32k support. 2018-04-16 Alan Modra <amodra@gmail.com> diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 7ec02dd..81ec3ec 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -82,7 +82,7 @@ proc objcopy_test {testname srcfile} { setup_xfail "m68*-*-sysv*" "m68*-apple-aux*" setup_xfail "m8*-*" setup_xfail "sh-*-coff*" - setup_xfail "tic80-*-*" "w65-*" + setup_xfail "tic80-*-*" clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" diff --git a/include/ChangeLog b/include/ChangeLog index a5301c9..204a512 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,10 @@ 2018-04-16 Alan Modra <amodra@gmail.com> + * coff/internal.h: Remove w65 support. + * coff/w65.h: Delete. + +2018-04-16 Alan Modra <amodra@gmail.com> + * coff/we32k.h: Delete. 2018-04-16 Alan Modra <amodra@gmail.com> diff --git a/include/coff/internal.h b/include/coff/internal.h index 47f2a54..1879ddc 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -809,21 +809,4 @@ struct internal_reloc #define R_IMM24 0x33 /* 24 bit abs */ /* R_JR, R_IMM8, R_IMM16, R_IMM32 - as for Z8k */ -/* W65 modes */ - -#define R_W65_ABS8 1 /* addr & 0xff */ -#define R_W65_ABS16 2 /* addr & 0xffff */ -#define R_W65_ABS24 3 /* addr & 0xffffff */ - -#define R_W65_ABS8S8 4 /* (addr >> 8) & 0xff */ -#define R_W65_ABS8S16 5 /* (addr >> 16) & 0xff */ - -#define R_W65_ABS16S8 6 /* (addr >> 8) & 0ffff */ -#define R_W65_ABS16S16 7 /* (addr >> 16) & 0ffff */ - -#define R_W65_PCR8 8 -#define R_W65_PCR16 9 - -#define R_W65_DP 10 /* direct page 8 bits only */ - #endif /* GNU_COFF_INTERNAL_H */ diff --git a/include/coff/w65.h b/include/coff/w65.h deleted file mode 100644 index f8401a5..0000000 --- a/include/coff/w65.h +++ /dev/null @@ -1,47 +0,0 @@ -/* coff information for WDC 65816 - - Copyright (C) 2001-2018 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#define L_LNNO_SIZE 4 -#include "coff/external.h" - -#define W65MAGIC 0x6500 - -#define W65BADMAG(x) (((x).f_magic != W65MAGIC)) - -/********************** RELOCATION DIRECTIVES **********************/ - -/* The external reloc has an offset field, because some of the reloc - types on the w65 don't have room in the instruction for the entire - offset - eg the strange jump and high page addressing modes */ - -struct external_reloc -{ - char r_vaddr[4]; - char r_symndx[4]; - char r_offset[4]; - char r_type[2]; - char r_stuff[2]; -}; - -#define RELOC struct external_reloc -#define RELSZ 16 - - - - diff --git a/ld/ChangeLog b/ld/ChangeLog index 91fb515..221047b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,14 @@ 2018-04-16 Alan Modra <amodra@gmail.com> + * Makefile.am: Remove w65 support. + * configure.tgt: Likewise. + * emulparams/w65.sh: Delete. + * scripttempl/w65.sc: Delete. + * Makefile.in: Regenerate. + * po/BLD-POTFILES.in: Regenerate. + +2018-04-16 Alan Modra <amodra@gmail.com> + * Makefile.am: Remove m88k support. * configure.host: Likewise. * configure.tgt: Likewise. diff --git a/ld/Makefile.am b/ld/Makefile.am index 39c84f4..a45d845 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -407,7 +407,6 @@ ALL_EMULATION_SOURCES = \ evax.c \ evaxnbsd.c \ evsta.c \ - ew65.c \ exgateelf.c \ ez80.c \ ez8001.c \ @@ -1798,9 +1797,6 @@ evaxnbsd.c: $(srcdir)/emulparams/vaxnbsd.sh \ evsta.c: $(srcdir)/emulparams/vsta.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} -ew65.c: $(srcdir)/emulparams/w65.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS} - exgateelf.c: $(srcdir)/emulparams/xgateelf.sh \ $(srcdir)/emultempl/generic.em $(ELF_DEPS) \ $(srcdir)/scripttempl/elfxgate.sc ${GEN_DEPENDS} diff --git a/ld/Makefile.in b/ld/Makefile.in index 85d545c..8db4239 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -776,7 +776,6 @@ ALL_EMULATION_SOURCES = \ evax.c \ evaxnbsd.c \ evsta.c \ - ew65.c \ exgateelf.c \ ez80.c \ ez8001.c \ @@ -1427,7 +1426,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evaxnbsd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evsta.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ew65.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exgateelf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ez80.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ez8001.Po@am__quote@ @@ -3338,9 +3336,6 @@ evaxnbsd.c: $(srcdir)/emulparams/vaxnbsd.sh \ evsta.c: $(srcdir)/emulparams/vsta.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} -ew65.c: $(srcdir)/emulparams/w65.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS} - exgateelf.c: $(srcdir)/emulparams/xgateelf.sh \ $(srcdir)/emultempl/generic.em $(ELF_DEPS) \ $(srcdir)/scripttempl/elfxgate.sc ${GEN_DEPENDS} diff --git a/ld/configure.tgt b/ld/configure.tgt index 50da17a..30c6bf2 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -837,8 +837,6 @@ vax-*-linux-*) targ_emul=elf32vax ;; visium-*-elf) targ_emul=elf32visium ;; -w65-*-*) targ_emul=w65 - ;; xc16x-*-elf) targ_emul=elf32xc16x targ_extra_emuls="elf32xc16xl elf32xc16xs" ;; diff --git a/ld/emulparams/w65.sh b/ld/emulparams/w65.sh deleted file mode 100644 index 6f02b23..0000000 --- a/ld/emulparams/w65.sh +++ /dev/null @@ -1,5 +0,0 @@ -SCRIPT_NAME=w65 -OUTPUT_FORMAT="coff-w65" -TEXT_START_ADDR=0x1000 -TARGET_PAGE_SIZE=64 -ARCH=w65 diff --git a/ld/po/BLD-POTFILES.in b/ld/po/BLD-POTFILES.in index 8c326ef..37cdc31 100644 --- a/ld/po/BLD-POTFILES.in +++ b/ld/po/BLD-POTFILES.in @@ -329,7 +329,6 @@ evanilla.c evax.c evaxnbsd.c evsta.c -ew65.c exgateelf.c ez80.c ez8001.c diff --git a/ld/scripttempl/w65.sc b/ld/scripttempl/w65.sc deleted file mode 100644 index 37a7b48..0000000 --- a/ld/scripttempl/w65.sc +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2014-2018 Free Software Foundation, Inc. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. - -TORS=".tors : - { - ___ctors = . ; - *(.ctors) - ___ctors_end = . ; - ___dtors = . ; - *(.dtors) - ___dtors_end = . ; - } > ram" - -cat <<EOF -/* Copyright (C) 2014-2018 Free Software Foundation, Inc. - - Copying and distribution of this script, with or without modification, - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. */ - -OUTPUT_FORMAT("${OUTPUT_FORMAT}") -OUTPUT_ARCH(${ARCH}) - -MEMORY -{ - ram : o = 0x1000, l = 512k -} - -SECTIONS -{ -.text : - { - *(.text) - *(.strings) - ${RELOCATING+ _etext = . ; } - } ${RELOCATING+ > ram} - - ${CONSTRUCTING+${TORS}} - -.data : - { - *(.data) - ${RELOCATING+ _edata = . ; } - } ${RELOCATING+ > ram} - -.bss : - { - ${RELOCATING+ _bss_start = . ; } - *(.bss) - *(COMMON) - ${RELOCATING+ _end = . ; } - } ${RELOCATING+ >ram} - -.stack ${RELOCATING+ 0x30000 } : - { - ${RELOCATING+ _stack = . ; } - *(.stack) - } ${RELOCATING+ > ram} - -.stab . (NOLOAD) : - { - [ .stab ] - } - -.stabstr . (NOLOAD) : - { - [ .stabstr ] - } -} -EOF - - - - diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a3dbbb3..adf70dd 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,17 @@ 2018-04-16 Alan Modra <amodra@gmail.com> + * Makefile.am: Remove w65 support. + * configure.ac: Likewise. + * disassemble.c: Likewise. + * disassemble.h: Likewise. + * w65-dis.c: Delete. + * w65-opc.h: Delete. + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + +2018-04-16 Alan Modra <amodra@gmail.com> + * configure.ac: Remove we32k support. * configure: Regenerate. diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index 83303fc..71140bb 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -82,7 +82,6 @@ HFILES = \ sh-opc.h \ sh64-opc.h \ sysdep.h \ - w65-opc.h \ xc16x-desc.h xc16x-opc.h \ xstormy16-desc.h xstormy16-opc.h \ z8k-opc.h @@ -251,7 +250,6 @@ TARGET_LIBOPCODES_CFILES = \ vax-dis.c \ visium-dis.c \ visium-opc.c \ - w65-dis.c \ wasm32-dis.c \ xc16x-asm.c \ xc16x-desc.c \ diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index bdf9e37..4d731c0 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -383,7 +383,6 @@ HFILES = \ sh-opc.h \ sh64-opc.h \ sysdep.h \ - w65-opc.h \ xc16x-desc.h xc16x-opc.h \ xstormy16-desc.h xstormy16-opc.h \ z8k-opc.h @@ -553,7 +552,6 @@ TARGET_LIBOPCODES_CFILES = \ vax-dis.c \ visium-dis.c \ visium-opc.c \ - w65-dis.c \ wasm32-dis.c \ xc16x-asm.c \ xc16x-desc.c \ @@ -956,7 +954,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vax-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visium-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visium-opc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w65-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wasm32-dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xc16x-asm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xc16x-desc.Plo@am__quote@ diff --git a/opcodes/configure b/opcodes/configure index ed17030..56c8b33 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -12717,7 +12717,6 @@ if test x${all_targets} = xfalse ; then bfd_v850_rh850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; bfd_vax_arch) ta="$ta vax-dis.lo" ;; bfd_visium_arch) ta="$ta visium-dis.lo visium-opc.lo" ;; - bfd_w65_arch) ta="$ta w65-dis.lo" ;; bfd_wasm32_arch) ta="$ta wasm32-dis.lo" ;; bfd_xc16x_arch) ta="$ta xc16x-asm.lo xc16x-desc.lo xc16x-dis.lo xc16x-ibld.lo xc16x-opc.lo" using_cgen=yes ;; bfd_xgate_arch) ta="$ta xgate-dis.lo xgate-opc.lo" ;; diff --git a/opcodes/configure.ac b/opcodes/configure.ac index 2d31d40..eee9eac 100644 --- a/opcodes/configure.ac +++ b/opcodes/configure.ac @@ -341,7 +341,6 @@ if test x${all_targets} = xfalse ; then bfd_v850_rh850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; bfd_vax_arch) ta="$ta vax-dis.lo" ;; bfd_visium_arch) ta="$ta visium-dis.lo visium-opc.lo" ;; - bfd_w65_arch) ta="$ta w65-dis.lo" ;; bfd_wasm32_arch) ta="$ta wasm32-dis.lo" ;; bfd_xc16x_arch) ta="$ta xc16x-asm.lo xc16x-desc.lo xc16x-dis.lo xc16x-ibld.lo xc16x-opc.lo" using_cgen=yes ;; bfd_xgate_arch) ta="$ta xgate-dis.lo xgate-opc.lo" ;; diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index 9c58db7..c5642c7 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -90,7 +90,6 @@ #define ARCH_v850 #define ARCH_vax #define ARCH_visium -#define ARCH_w65 #define ARCH_wasm32 #define ARCH_xstormy16 #define ARCH_xc16x @@ -440,11 +439,6 @@ disassembler (enum bfd_architecture a, disassemble = print_insn_v850; break; #endif -#ifdef ARCH_w65 - case bfd_arch_w65: - disassemble = print_insn_w65; - break; -#endif #ifdef ARCH_wasm32 case bfd_arch_wasm32: disassemble = print_insn_wasm32; diff --git a/opcodes/disassemble.h b/opcodes/disassemble.h index 2fea54f..27c6c10 100644 --- a/opcodes/disassemble.h +++ b/opcodes/disassemble.h @@ -90,7 +90,6 @@ extern int print_insn_tilepro (bfd_vma, disassemble_info *); extern int print_insn_v850 (bfd_vma, disassemble_info *); extern int print_insn_vax (bfd_vma, disassemble_info *); extern int print_insn_visium (bfd_vma, disassemble_info *); -extern int print_insn_w65 (bfd_vma, disassemble_info *); extern int print_insn_wasm32 (bfd_vma, disassemble_info *); extern int print_insn_xc16x (bfd_vma, disassemble_info *); extern int print_insn_xgate (bfd_vma, disassemble_info *); diff --git a/opcodes/po/POTFILES.in b/opcodes/po/POTFILES.in index 7736bb7..6e611c8 100644 --- a/opcodes/po/POTFILES.in +++ b/opcodes/po/POTFILES.in @@ -208,8 +208,6 @@ v850-opc.c vax-dis.c visium-dis.c visium-opc.c -w65-dis.c -w65-opc.h wasm32-dis.c xc16x-asm.c xc16x-desc.c diff --git a/opcodes/w65-dis.c b/opcodes/w65-dis.c deleted file mode 100644 index 2ad4e4e..0000000 --- a/opcodes/w65-dis.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Disassemble WDC 65816 instructions. - Copyright (C) 1995-2018 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - It is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include <stdio.h> - -#define STATIC_TABLE -#define DEFINE_TABLE - -#include "w65-opc.h" -#include "disassemble.h" - -static fprintf_ftype fpr; -static void *stream; -static struct disassemble_info *local_info; - -static void -print_operand (int lookup, char *format, int *args) -{ - int val; - int c; - - while (*format) - { - switch (c = *format++) - { - case '$': - val = args[(*format++) - '0']; - if (lookup) - local_info->print_address_func (val, local_info); - else - fpr (stream, "0x%x", val); - - break; - default: - fpr (stream, "%c", c); - break; - } - } -} - -int -print_insn_w65 (bfd_vma memaddr, struct disassemble_info *info) -{ - int status = 0; - unsigned char insn[4]; - const struct opinfo *op; - int i; - int X = 0; - int M = 0; - int args[2]; - - stream = info->stream; - fpr = info->fprintf_func; - local_info = info; - - for (i = 0; i < 4 && status == 0; i++) - status = info->read_memory_func (memaddr + i, insn + i, 1, info); - - for (op = optable; op->val != insn[0]; op++) - ; - - fpr (stream, "%s", op->name); - - /* Prepare all the posible operand values. */ - { - int size = 1; - int asR_W65_ABS8 = insn[1]; - int asR_W65_ABS16 = (insn[2] << 8) + asR_W65_ABS8; - int asR_W65_ABS24 = (insn[3] << 16) + asR_W65_ABS16; - int asR_W65_PCR8 = ((char) (asR_W65_ABS8)) + memaddr + 2; - int asR_W65_PCR16 = ((short) (asR_W65_ABS16)) + memaddr + 3; - - switch (op->amode) - { - DISASM (); - } - - return size; - } -} diff --git a/opcodes/w65-opc.h b/opcodes/w65-opc.h deleted file mode 100644 index 724a11e..0000000 --- a/opcodes/w65-opc.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Instruction opcode header for WDC 65816 - (generated by the program sim/w65/gencode -a) - - Copyright (C) 2001-2018 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - It is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with this file; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#define ADDR_IMMTOA 1 /* #a */ -#define ADDR_IMMCOP 2 /* #c */ -#define ADDR_IMMTOI 3 /* #i */ -#define ADDR_ACC 4 /* A */ -#define ADDR_PC_REL 5 /* r */ -#define ADDR_PC_REL_LONG 6 /* rl */ -#define ADDR_IMPLIED 7 /* i */ -#define ADDR_STACK 8 /* s */ -#define ADDR_DIR 9 /* d */ -#define ADDR_DIR_IDX_X 10 /* d,x */ -#define ADDR_DIR_IDX_Y 11 /* d,y */ -#define ADDR_DIR_IND 12 /* (d) */ -#define ADDR_DIR_IDX_IND_X 13 /* (d,x) */ -#define ADDR_DIR_IND_IDX_Y 14 /* (d),y */ -#define ADDR_DIR_IND_LONG 15 /* [d] */ -#define ADDR_DIR_IND_IDX_Y_LONG 16 /* [d],y */ -#define ADDR_ABS 17 /* a */ -#define ADDR_ABS_IDX_X 18 /* a,x */ -#define ADDR_ABS_IDX_Y 19 /* a,y */ -#define ADDR_ABS_LONG 20 /* al */ -#define ADDR_ABS_IND_LONG 21 /* [a] */ -#define ADDR_ABS_LONG_IDX_X 22 /* al,x */ -#define ADDR_STACK_REL 23 /* d,s */ -#define ADDR_STACK_REL_INDX_IDX 24 /* (d,s),y */ -#define ADDR_ABS_IND 25 /* (a) */ -#define ADDR_ABS_IND_IDX 26 /* (a,x) */ -#define ADDR_BLOCK_MOVE 27 /* xyz */ -struct opinfo { - int val; - int code; - char *name; - int amode; -}; -const struct opinfo optable[257]={ -#define O_adc 1 -#define O_and 2 -#define O_asl 3 -#define O_bcc 4 -#define O_bcs 5 -#define O_beq 6 -#define O_bit 7 -#define O_bmi 8 -#define O_bne 9 -#define O_bpl 10 -#define O_bra 11 -#define O_brk 12 -#define O_brl 13 -#define O_bvc 14 -#define O_bvs 15 -#define O_clc 16 -#define O_cld 17 -#define O_cli 18 -#define O_clv 19 -#define O_cmp 20 -#define O_cop 21 -#define O_cpx 22 -#define O_cpy 23 -#define O_dec 24 -#define O_dex 25 -#define O_dey 26 -#define O_eor 27 -#define O_inc 28 -#define O_inx 29 -#define O_iny 30 -#define O_jmp 31 -#define O_jsr 32 -#define O_lda 33 -#define O_ldx 34 -#define O_ldy 35 -#define O_lsr 36 -#define O_mvn 37 -#define O_mvp 38 -#define O_nop 39 -#define O_ora 40 -#define O_pea 41 -#define O_pei 42 -#define O_per 43 -#define O_pha 44 -#define O_phb 45 -#define O_phd 46 -#define O_phk 47 -#define O_php 48 -#define O_phx 49 -#define O_phy 50 -#define O_pla 51 -#define O_plb 52 -#define O_pld 53 -#define O_plp 54 -#define O_plx 55 -#define O_ply 56 -#define O_rep 57 -#define O_rol 58 -#define O_ror 59 -#define O_rti 60 -#define O_rtl 61 -#define O_rts 62 -#define O_sbc 63 -#define O_sec 64 -#define O_sed 65 -#define O_sei 66 -#define O_sep 67 -#define O_sta 68 -#define O_stp 69 -#define O_stx 70 -#define O_sty 71 -#define O_stz 72 -#define O_tax 73 -#define O_tay 74 -#define O_tcd 75 -#define O_tcs 76 -#define O_tdc 77 -#define O_trb 78 -#define O_tsb 79 -#define O_tsc 80 -#define O_tsx 81 -#define O_txa 82 -#define O_txs 83 -#define O_txy 84 -#define O_tya 85 -#define O_tyx 86 -#define O_wai 87 -#define O_wdm 88 -#define O_xba 89 -#define O_xce 90 -#ifdef DEFINE_TABLE - {0x69, O_adc, "adc", ADDR_IMMTOA}, - {0x72, O_adc, "adc", ADDR_DIR_IND}, - {0x71, O_adc, "adc", ADDR_DIR_IND_IDX_Y}, - {0x73, O_adc, "adc", ADDR_STACK_REL_INDX_IDX}, - {0x61, O_adc, "adc", ADDR_DIR_IDX_IND_X}, - {0x67, O_adc, "adc", ADDR_DIR_IND_LONG}, - {0x77, O_adc, "adc", ADDR_DIR_IND_IDX_Y_LONG}, - {0x6D, O_adc, "adc", ADDR_ABS}, - {0x7D, O_adc, "adc", ADDR_ABS_IDX_X}, - {0x79, O_adc, "adc", ADDR_ABS_IDX_Y}, - {0x6F, O_adc, "adc", ADDR_ABS_LONG}, - {0x7F, O_adc, "adc", ADDR_ABS_LONG_IDX_X}, - {0x65, O_adc, "adc", ADDR_DIR}, - {0x63, O_adc, "adc", ADDR_STACK_REL}, - {0x75, O_adc, "adc", ADDR_DIR_IDX_X}, - {0x29, O_and, "and", ADDR_IMMTOA}, - {0x32, O_and, "and", ADDR_DIR_IND}, - {0x31, O_and, "and", ADDR_DIR_IND_IDX_Y}, - {0x33, O_and, "and", ADDR_STACK_REL_INDX_IDX}, - {0x21, O_and, "and", ADDR_DIR_IDX_IND_X}, - {0x27, O_and, "and", ADDR_DIR_IND_LONG}, - {0x37, O_and, "and", ADDR_DIR_IND_IDX_Y_LONG}, - {0x2D, O_and, "and", ADDR_ABS}, - {0x3D, O_and, "and", ADDR_ABS_IDX_X}, - {0x39, O_and, "and", ADDR_ABS_IDX_Y}, - {0x2F, O_and, "and", ADDR_ABS_LONG}, - {0x3F, O_and, "and", ADDR_ABS_LONG_IDX_X}, - {0x25, O_and, "and", ADDR_DIR}, - {0x23, O_and, "and", ADDR_STACK_REL}, - {0x35, O_and, "and", ADDR_DIR_IDX_X}, - {0x0A, O_asl, "asl", ADDR_ACC}, - {0x0E, O_asl, "asl", ADDR_ABS}, - {0x1E, O_asl, "asl", ADDR_ABS_IDX_X}, - {0x06, O_asl, "asl", ADDR_DIR}, - {0x16, O_asl, "asl", ADDR_DIR_IDX_X}, - {0x90, O_bcc, "bcc", ADDR_PC_REL}, - {0xB0, O_bcs, "bcs", ADDR_PC_REL}, - {0xF0, O_beq, "beq", ADDR_PC_REL}, - {0x89, O_bit, "bit", ADDR_IMMTOA}, - {0x24, O_bit, "bit", ADDR_DIR_IND}, - {0x34, O_bit, "bit", ADDR_DIR_IDX_IND_X}, - {0x2C, O_bit, "bit", ADDR_ABS}, - {0x3C, O_bit, "bit", ADDR_ABS_IDX_X}, - {0x30, O_bmi, "bmi", ADDR_PC_REL}, - {0xD0, O_bne, "bne", ADDR_PC_REL}, - {0x10, O_bpl, "bpl", ADDR_PC_REL}, - {0x80, O_bra, "bra", ADDR_PC_REL}, - {0x00, O_brk, "brk", ADDR_STACK}, - {0x82, O_brl, "brl", ADDR_PC_REL_LONG}, - {0x50, O_bvc, "bvc", ADDR_PC_REL}, - {0x70, O_bvs, "bvs", ADDR_PC_REL}, - {0x18, O_clc, "clc", ADDR_IMPLIED}, - {0xD8, O_cld, "cld", ADDR_IMPLIED}, - {0x58, O_cli, "cli", ADDR_IMPLIED}, - {0xB8, O_clv, "clv", ADDR_IMPLIED}, - {0xC9, O_cmp, "cmp", ADDR_IMMTOA}, - {0xD2, O_cmp, "cmp", ADDR_DIR_IND}, - {0xD1, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y}, - {0xD3, O_cmp, "cmp", ADDR_STACK_REL_INDX_IDX}, - {0xC1, O_cmp, "cmp", ADDR_DIR_IDX_IND_X}, - {0xC7, O_cmp, "cmp", ADDR_DIR_IND_LONG}, - {0xD7, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y_LONG}, - {0xCD, O_cmp, "cmp", ADDR_ABS}, - {0xDD, O_cmp, "cmp", ADDR_ABS_IDX_X}, - {0xD9, O_cmp, "cmp", ADDR_ABS_IDX_Y}, - {0xCF, O_cmp, "cmp", ADDR_ABS_LONG}, - {0xDF, O_cmp, "cmp", ADDR_ABS_LONG_IDX_X}, - {0xC5, O_cmp, "cmp", ADDR_DIR}, - {0xC3, O_cmp, "cmp", ADDR_STACK_REL}, - {0xD5, O_cmp, "cmp", ADDR_DIR_IDX_X}, - {0x02, O_cop, "cop", ADDR_IMMCOP}, - {0xE0, O_cpx, "cpx", ADDR_IMMTOI}, - {0xEC, O_cpx, "cpx", ADDR_ABS}, - {0xE4, O_cpx, "cpx", ADDR_DIR}, - {0xC0, O_cpy, "cpy", ADDR_IMMTOI}, - {0xCC, O_cpy, "cpy", ADDR_ABS}, - {0xC4, O_cpy, "cpy", ADDR_DIR}, - {0x3A, O_dec, "dec", ADDR_ACC}, - {0xCE, O_dec, "dec", ADDR_ABS}, - {0xDE, O_dec, "dec", ADDR_ABS_IDX_X}, - {0xC6, O_dec, "dec", ADDR_DIR}, - {0xD6, O_dec, "dec", ADDR_DIR_IDX_X}, - {0xCA, O_dex, "dex", ADDR_IMPLIED}, - {0x88, O_dey, "dey", ADDR_IMPLIED}, - {0x49, O_eor, "eor", ADDR_IMMTOA}, - {0x52, O_eor, "eor", ADDR_DIR_IND}, - {0x51, O_eor, "eor", ADDR_DIR_IND_IDX_Y}, - {0x53, O_eor, "eor", ADDR_STACK_REL_INDX_IDX}, - {0x41, O_eor, "eor", ADDR_DIR_IDX_IND_X}, - {0x47, O_eor, "eor", ADDR_DIR_IND_LONG}, - {0x57, O_eor, "eor", ADDR_DIR_IND_IDX_Y_LONG}, - {0x4D, O_eor, "eor", ADDR_ABS}, - {0x5D, O_eor, "eor", ADDR_ABS_IDX_X}, - {0x59, O_eor, "eor", ADDR_ABS_IDX_Y}, - {0x4F, O_eor, "eor", ADDR_ABS_LONG}, - {0x5F, O_eor, "eor", ADDR_ABS_LONG_IDX_X}, - {0x45, O_eor, "eor", ADDR_DIR}, - {0x43, O_eor, "eor", ADDR_STACK_REL}, - {0x55, O_eor, "eor", ADDR_DIR_IDX_X}, - {0x1A, O_inc, "inc", ADDR_ACC}, - {0xEE, O_inc, "inc", ADDR_ABS}, - {0xFE, O_inc, "inc", ADDR_ABS_IDX_X}, - {0xE6, O_inc, "inc", ADDR_DIR}, - {0xF6, O_inc, "inc", ADDR_DIR_IDX_X}, - {0xE8, O_inx, "inx", ADDR_IMPLIED}, - {0xC8, O_iny, "iny", ADDR_IMPLIED}, - {0x6C, O_jmp, "jmp", ADDR_ABS_IND}, - {0x7C, O_jmp, "jmp", ADDR_ABS_IND_IDX}, - {0xDC, O_jmp, "jmp", ADDR_ABS_IND_LONG}, - {0x4C, O_jmp, "jmp", ADDR_ABS}, - {0x5C, O_jmp, "jmp", ADDR_ABS_LONG}, - {0xFC, O_jsr, "jsr", ADDR_ABS_IND_IDX}, - {0x20, O_jsr, "jsr", ADDR_ABS}, - {0x22, O_jsr, "jsr", ADDR_ABS_LONG}, - {0xA9, O_lda, "lda", ADDR_IMMTOA}, - {0xB2, O_lda, "lda", ADDR_DIR_IND}, - {0xB1, O_lda, "lda", ADDR_DIR_IND_IDX_Y}, - {0xB3, O_lda, "lda", ADDR_STACK_REL_INDX_IDX}, - {0xA1, O_lda, "lda", ADDR_DIR_IDX_IND_X}, - {0xA7, O_lda, "lda", ADDR_DIR_IND_LONG}, - {0xB7, O_lda, "lda", ADDR_DIR_IND_IDX_Y_LONG}, - {0xAD, O_lda, "lda", ADDR_ABS}, - {0xBD, O_lda, "lda", ADDR_ABS_IDX_X}, - {0xB9, O_lda, "lda", ADDR_ABS_IDX_Y}, - {0xAF, O_lda, "lda", ADDR_ABS_LONG}, - {0xBF, O_lda, "lda", ADDR_ABS_LONG_IDX_X}, - {0xA5, O_lda, "lda", ADDR_DIR}, - {0xA3, O_lda, "lda", ADDR_STACK_REL}, - {0xB5, O_lda, "lda", ADDR_DIR_IDX_X}, - {0xA2, O_ldx, "ldx", ADDR_IMMTOI}, - {0xAE, O_ldx, "ldx", ADDR_ABS}, - {0xBE, O_ldx, "ldx", ADDR_ABS_IDX_Y}, - {0xA6, O_ldx, "ldx", ADDR_DIR}, - {0xB6, O_ldx, "ldx", ADDR_DIR_IDX_Y}, - {0xA0, O_ldy, "ldy", ADDR_IMMTOI}, - {0xAC, O_ldy, "ldy", ADDR_ABS}, - {0xBC, O_ldy, "ldy", ADDR_ABS_IDX_X}, - {0xA4, O_ldy, "ldy", ADDR_DIR}, - {0xB4, O_ldy, "ldy", ADDR_DIR_IDX_X}, - {0x4A, O_lsr, "lsr", ADDR_ACC}, - {0x4E, O_lsr, "lsr", ADDR_ABS}, - {0x5E, O_lsr, "lsr", ADDR_ABS_IDX_X}, - {0x46, O_lsr, "lsr", ADDR_DIR}, - {0x56, O_lsr, "lsr", ADDR_DIR_IDX_X}, - {0x54, O_mvn, "mvn", ADDR_BLOCK_MOVE}, - {0x44, O_mvp, "mvp", ADDR_BLOCK_MOVE}, - {0xEA, O_nop, "nop", ADDR_IMPLIED}, - {0x09, O_ora, "ora", ADDR_IMMTOA}, - {0x12, O_ora, "ora", ADDR_DIR_IND}, - {0x11, O_ora, "ora", ADDR_DIR_IND_IDX_Y}, - {0x13, O_ora, "ora", ADDR_STACK_REL_INDX_IDX}, - {0x01, O_ora, "ora", ADDR_DIR_IDX_IND_X}, - {0x07, O_ora, "ora", ADDR_DIR_IND_LONG}, - {0x17, O_ora, "ora", ADDR_DIR_IND_IDX_Y_LONG}, - {0x0D, O_ora, "ora", ADDR_ABS}, - {0x1D, O_ora, "ora", ADDR_ABS_IDX_X}, - {0x19, O_ora, "ora", ADDR_ABS_IDX_Y}, - {0x0F, O_ora, "ora", ADDR_ABS_LONG}, - {0x1F, O_ora, "ora", ADDR_ABS_LONG_IDX_X}, - {0x05, O_ora, "ora", ADDR_DIR}, - {0x03, O_ora, "ora", ADDR_STACK_REL}, - {0x15, O_ora, "ora", ADDR_DIR_IDX_X}, - {0xF4, O_pea, "pea", ADDR_ABS}, - {0xD4, O_pei, "pei", ADDR_DIR}, - {0x62, O_per, "per", ADDR_PC_REL_LONG}, - {0x48, O_pha, "pha", ADDR_STACK}, - {0x8B, O_phb, "phb", ADDR_STACK}, - {0x0B, O_phd, "phd", ADDR_STACK}, - {0x4B, O_phk, "phk", ADDR_STACK}, - {0x08, O_php, "php", ADDR_STACK}, - {0xDA, O_phx, "phx", ADDR_STACK}, - {0x5A, O_phy, "phy", ADDR_STACK}, - {0x68, O_pla, "pla", ADDR_STACK}, - {0xAB, O_plb, "plb", ADDR_STACK}, - {0x2B, O_pld, "pld", ADDR_STACK}, - {0x28, O_plp, "plp", ADDR_STACK}, - {0xFA, O_plx, "plx", ADDR_STACK}, - {0x7A, O_ply, "ply", ADDR_STACK}, - {0xC2, O_rep, "rep", ADDR_IMMCOP}, - {0x2A, O_rol, "rol", ADDR_ACC}, - {0x2E, O_rol, "rol", ADDR_ABS}, - {0x3E, O_rol, "rol", ADDR_ABS_IDX_X}, - {0x26, O_rol, "rol", ADDR_DIR}, - {0x36, O_rol, "rol", ADDR_DIR_IDX_X}, - {0x6A, O_ror, "ror", ADDR_ACC}, - {0x6E, O_ror, "ror", ADDR_ABS}, - {0x7E, O_ror, "ror", ADDR_ABS_IDX_X}, - {0x66, O_ror, "ror", ADDR_DIR}, - {0x76, O_ror, "ror", ADDR_DIR_IDX_X}, - {0x40, O_rti, "rti", ADDR_STACK}, - {0x6B, O_rtl, "rtl", ADDR_STACK}, - {0x60, O_rts, "rts", ADDR_STACK}, - {0xE9, O_sbc, "sbc", ADDR_IMMTOA}, - {0xF2, O_sbc, "sbc", ADDR_DIR_IND}, - {0xF1, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y}, - {0xF3, O_sbc, "sbc", ADDR_STACK_REL_INDX_IDX}, - {0xE1, O_sbc, "sbc", ADDR_DIR_IDX_IND_X}, - {0xE7, O_sbc, "sbc", ADDR_DIR_IND_LONG}, - {0xF7, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y_LONG}, - {0xED, O_sbc, "sbc", ADDR_ABS}, - {0xFD, O_sbc, "sbc", ADDR_ABS_IDX_X}, - {0xF9, O_sbc, "sbc", ADDR_ABS_IDX_Y}, - {0xEF, O_sbc, "sbc", ADDR_ABS_LONG}, - {0xFF, O_sbc, "sbc", ADDR_ABS_LONG_IDX_X}, - {0xE5, O_sbc, "sbc", ADDR_DIR}, - {0xE3, O_sbc, "sbc", ADDR_STACK_REL}, - {0xF5, O_sbc, "sbc", ADDR_DIR_IDX_X}, - {0x38, O_sec, "sec", ADDR_IMPLIED}, - {0xF8, O_sed, "sed", ADDR_IMPLIED}, - {0x78, O_sei, "sei", ADDR_IMPLIED}, - {0xE2, O_sep, "sep", ADDR_IMMCOP}, - {0x92, O_sta, "sta", ADDR_DIR_IND}, - {0x91, O_sta, "sta", ADDR_DIR_IND_IDX_Y}, - {0x93, O_sta, "sta", ADDR_STACK_REL_INDX_IDX}, - {0x81, O_sta, "sta", ADDR_DIR_IDX_IND_X}, - {0x87, O_sta, "sta", ADDR_DIR_IND_LONG}, - {0x97, O_sta, "sta", ADDR_DIR_IND_IDX_Y_LONG}, - {0x8D, O_sta, "sta", ADDR_ABS}, - {0x9D, O_sta, "sta", ADDR_ABS_IDX_X}, - {0x99, O_sta, "sta", ADDR_ABS_IDX_Y}, - {0x8F, O_sta, "sta", ADDR_ABS_LONG}, - {0x9F, O_sta, "sta", ADDR_ABS_LONG_IDX_X}, - {0x85, O_sta, "sta", ADDR_DIR}, - {0x83, O_sta, "sta", ADDR_STACK_REL}, - {0x95, O_sta, "sta", ADDR_DIR_IDX_X}, - {0xDB, O_stp, "stp", ADDR_IMPLIED}, - {0x8E, O_stx, "stx", ADDR_ABS}, - {0x86, O_stx, "stx", ADDR_DIR}, - {0x96, O_stx, "stx", ADDR_DIR_IDX_X}, - {0x8C, O_sty, "sty", ADDR_ABS}, - {0x84, O_sty, "sty", ADDR_DIR}, - {0x94, O_sty, "sty", ADDR_DIR_IDX_X}, - {0x9C, O_stz, "stz", ADDR_ABS}, - {0x9E, O_stz, "stz", ADDR_ABS_IDX_X}, - {0x64, O_stz, "stz", ADDR_DIR}, - {0x74, O_stz, "stz", ADDR_DIR_IDX_X}, - {0xAA, O_tax, "tax", ADDR_IMPLIED}, - {0xA8, O_tay, "tay", ADDR_IMPLIED}, - {0x5B, O_tcd, "tcd", ADDR_IMPLIED}, - {0x1B, O_tcs, "tcs", ADDR_IMPLIED}, - {0x7B, O_tdc, "tdc", ADDR_IMPLIED}, - {0x1C, O_trb, "trb", ADDR_ABS}, - {0x14, O_trb, "trb", ADDR_DIR}, - {0x0C, O_tsb, "tsb", ADDR_ABS}, - {0x04, O_tsb, "tsb", ADDR_DIR}, - {0x3B, O_tsc, "tsc", ADDR_IMPLIED}, - {0xBA, O_tsx, "tsx", ADDR_IMPLIED}, - {0x8A, O_txa, "txa", ADDR_IMPLIED}, - {0x9A, O_txs, "txs", ADDR_IMPLIED}, - {0x9B, O_txy, "txy", ADDR_IMPLIED}, - {0x98, O_tya, "tya", ADDR_IMPLIED}, - {0xBB, O_tyx, "tyx", ADDR_IMPLIED}, - {0xCB, O_wai, "wai", ADDR_IMPLIED}, - {0x42, O_wdm, "wdm", ADDR_IMPLIED}, - {0xEB, O_xba, "xba", ADDR_IMPLIED}, - {0xFB, O_xce, "xce", ADDR_IMPLIED}, - { 0, 0, NULL, 0 } -}; -#endif -#define DISASM()\ - case ADDR_IMMTOA:\ - args[0] = M==0 ? asR_W65_ABS16 : asR_W65_ABS8;\ - print_operand (0, " #$0", args);\ - size += M==0 ? 2:1;\ - break;\ - case ADDR_IMMCOP:\ - args[0] = asR_W65_ABS8;\ - print_operand (0, " #$0", args);\ - size += 1;\ - break;\ - case ADDR_IMMTOI:\ - args[0] = X==0 ? asR_W65_ABS16 : asR_W65_ABS8;\ - print_operand (0, " #$0", args);\ - size += X==0 ? 2:1;\ - break;\ - case ADDR_ACC:\ - print_operand (0, " a", 0);\ - size += 0;\ - break;\ - case ADDR_PC_REL:\ - args[0] = asR_W65_PCR8;\ - print_operand (0, " $0", args);\ - size += 1;\ - break;\ - case ADDR_PC_REL_LONG:\ - args[0] = asR_W65_PCR16;\ - print_operand (0, " $0", args);\ - size += 2;\ - break;\ - case ADDR_IMPLIED:\ - size += 0;\ - break;\ - case ADDR_STACK:\ - size += 0;\ - break;\ - case ADDR_DIR:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " <$0", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IDX_X:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " <$0,x", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IDX_Y:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " <$0,y", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IND:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " (<$0)", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IDX_IND_X:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " (<$0,x)", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IND_IDX_Y:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " (<$0),y", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IND_LONG:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " [$0]", args);\ - size += 1;\ - break;\ - case ADDR_DIR_IND_IDX_Y_LONG:\ - args[0] = asR_W65_ABS8;\ - print_operand (1, " [$0],y", args);\ - size += 1;\ - break;\ - case ADDR_ABS:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " !$0", args);\ - size += 2;\ - break;\ - case ADDR_ABS_IDX_X:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " !$0,x", args);\ - size += 2;\ - break;\ - case ADDR_ABS_IDX_Y:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " !$0,y", args);\ - size += 2;\ - break;\ - case ADDR_ABS_LONG:\ - args[0] = asR_W65_ABS24;\ - print_operand (1, " >$0", args);\ - size += 3;\ - break;\ - case ADDR_ABS_IND_LONG:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " [>$0]", args);\ - size += 2;\ - break;\ - case ADDR_ABS_LONG_IDX_X:\ - args[0] = asR_W65_ABS24;\ - print_operand (1, " >$0,x", args);\ - size += 3;\ - break;\ - case ADDR_STACK_REL:\ - args[0] = asR_W65_ABS8;\ - print_operand (0, " $0,s", args);\ - size += 1;\ - break;\ - case ADDR_STACK_REL_INDX_IDX:\ - args[0] = asR_W65_ABS8;\ - print_operand (0, " ($0,s),y", args);\ - size += 1;\ - break;\ - case ADDR_ABS_IND:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " ($0)", args);\ - size += 2;\ - break;\ - case ADDR_ABS_IND_IDX:\ - args[0] = asR_W65_ABS16;\ - print_operand (1, " ($0,x)", args);\ - size += 2;\ - break;\ - case ADDR_BLOCK_MOVE:\ - args[0] = (asR_W65_ABS16 >>8) &0xff;\ - args[1] = ( asR_W65_ABS16 & 0xff);\ - print_operand (0," $0,$1",args);\ - size += 2;\ - break;\ - -#define GETINFO(size,type,pcrel)\ - case ADDR_IMMTOA: size = M==0 ? 2:1;type=M==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\ - case ADDR_IMMCOP: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_IMMTOI: size = X==0 ? 2:1;type=X==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\ - case ADDR_ACC: size = 0;type=-1;pcrel=0;break;\ - case ADDR_PC_REL: size = 1;type=R_W65_PCR8;pcrel=0;break;\ - case ADDR_PC_REL_LONG: size = 2;type=R_W65_PCR16;pcrel=0;break;\ - case ADDR_IMPLIED: size = 0;type=-1;pcrel=0;break;\ - case ADDR_STACK: size = 0;type=-1;pcrel=0;break;\ - case ADDR_DIR: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IDX_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IND: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IDX_IND_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IND_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IND_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_DIR_IND_IDX_Y_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_ABS: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_ABS_IDX_X: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_ABS_IDX_Y: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_ABS_LONG: size = 3;type=R_W65_ABS24;pcrel=0;break;\ - case ADDR_ABS_IND_LONG: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_ABS_LONG_IDX_X: size = 3;type=R_W65_ABS24;pcrel=0;break;\ - case ADDR_STACK_REL: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_STACK_REL_INDX_IDX: size = 1;type=R_W65_ABS8;pcrel=0;break;\ - case ADDR_ABS_IND: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_ABS_IND_IDX: size = 2;type=R_W65_ABS16;pcrel=0;break;\ - case ADDR_BLOCK_MOVE: size = 2;type=-1;pcrel=0;break;\ - |