From 28d39d1a3a0fa205e5223b183c3df93264865dc5 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 21 Jan 2004 11:17:53 +0000 Subject: [PATCH] Stop indexed move byte instructions from being relaxed. --- bfd/ChangeLog | 5 + bfd/bfd-in2.h | 4 + bfd/libbfd.h | 1 + bfd/opncls.c | 22 +- bfd/reloc.c | 7 +- gas/ChangeLog | 6 + gas/config/tc-m68hc11.c | 54 ++- gas/testsuite/ChangeLog | 6 + gas/testsuite/gas/m68hc11/m68hc11.exp | 15 +- gas/testsuite/gas/m68hc11/movb.d | 451 ++++++++++++++++++++++++++ gas/testsuite/gas/m68hc11/movb.s | 333 +++++++++++++++++++ 11 files changed, 882 insertions(+), 22 deletions(-) create mode 100644 gas/testsuite/gas/m68hc11/movb.d create mode 100644 gas/testsuite/gas/m68hc11/movb.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6818677152f..c1c024c5e4e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2004-01-21 Tom Rix + + * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw. + * bfd-in2.h, libbfd.h: Rebuilt. + 2004-01-20 Danny Smith * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 4cc59e0bfbe..f66c29ce23c 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3377,6 +3377,10 @@ value and a 8-bit page number. The symbol address is transformed to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ BFD_RELOC_M68HC11_24, +/* Motorola 68HC12 reloc. +This is the 5 bits of a value. */ + BFD_RELOC_M68HC12_5B, + /* These relocs are only used within the CRIS assembler. They are not (at present) written to any object files. */ BFD_RELOC_CRIS_BDISP8, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index d6ee8f33b43..40e1b789f9a 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1430,6 +1430,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M68HC11_LO16", "BFD_RELOC_M68HC11_PAGE", "BFD_RELOC_M68HC11_24", + "BFD_RELOC_M68HC12_5B", "BFD_RELOC_CRIS_BDISP8", "BFD_RELOC_CRIS_UNSIGNED_5", "BFD_RELOC_CRIS_SIGNED_6", diff --git a/bfd/opncls.c b/bfd/opncls.c index 96f1e14ccda..6abd40509ca 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -70,8 +70,7 @@ _bfd_new_bfd (void) nbfd->direction = no_direction; nbfd->iostream = NULL; nbfd->where = 0; - if (!bfd_hash_table_init_n (&nbfd->section_htab, - bfd_section_hash_newfunc, + if (!bfd_hash_table_init_n (& nbfd->section_htab, bfd_section_hash_newfunc, 251)) { free (nbfd); @@ -923,7 +922,7 @@ find_separate_debug_file (bfd *abfd, const char *debug_file_directory) for (i = strlen (dir) - 1; i >= 0; i--) if (IS_DIR_SEPARATOR (dir[i])) break; - + dir[i + 1] = '\0'; BFD_ASSERT (dir[i] == '/' || dir[0] == '\0') @@ -996,23 +995,26 @@ SYNOPSIS DESCRIPTION Takes a BFD and searches it for a .gnu_debuglink section. If this - section is found, examines the section for the name and checksum of - a '.debug' file containing auxiliary debugging - information. Searches filesystem for .debug file in some standard + section is found, it examines the section for the name and checksum + of a '.debug' file containing auxiliary debugging information. It + then searches the filesystem for this .debug file in some standard locations, including the directory tree rooted at @var{dir}, and if - found returns the full filename. If @var{dir} is NULL, will search - default path configured into libbfd at build time. + found returns the full filename. + + If @var{dir} is NULL, it will search a default path configured into + libbfd at build time. [XXX this feature is not currently + implemented]. RETURNS <> on any errors or failure to locate the .debug file, otherwise a pointer to a heap-allocated string containing the - filename. The caller is responsible for freeing this string. + filename. The caller is responsible for freeing this string. */ char * bfd_follow_gnu_debuglink (bfd *abfd, const char *dir) { -#if 0 /* Disabled until DEBUGDIR can be defined by configure.in */ +#if 0 /* Disabled until DEBUGDIR can be defined by configure.in. */ if (dir == NULL) dir = DEBUGDIR; #endif diff --git a/bfd/reloc.c b/bfd/reloc.c index d3a6534b7c9..9bffaa36588 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -1,6 +1,6 @@ /* BFD support for handling relocation entries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Support. @@ -3764,6 +3764,11 @@ ENUMDOC This is a 24-bit reloc that represents the address with a 16-bit value and a 8-bit page number. The symbol address is transformed to follow the 16K memory bank of 68HC12 (seen as mapped in the window). +ENUM + BFD_RELOC_M68HC12_5B +ENUMDOC + Motorola 68HC12 reloc. + This is the 5 bits of a value. ENUM BFD_RELOC_CRIS_BDISP8 diff --git a/gas/ChangeLog b/gas/ChangeLog index cf68b2a2f9a..c855fccd727 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2004-01-11 Tom Rix + + * config/tc-m68hc11.c (build_indexed_byte): movb and movw cannot + be relaxed, use fixup. + (md_apply_fix3): Use 5 bit reloc from movb and movw fixup. + 2004-01-19 Jakub Jelinek * config/tc-sparc.c (sparc_ip): Disallow %f32-%f63 for single diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index 812cda541d9..780f773fc91 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -1,5 +1,5 @@ /* tc-m68hc11.c -- Assembler code for the Motorola 68HC11 & 68HC12. - Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GAS, the GNU Assembler. @@ -1951,18 +1951,43 @@ build_indexed_byte (operand *op, int format ATTRIBUTE_UNUSED, int move_insn) sym = make_expr_symbol (&op->exp); off = 0; } - frag_var (rs_machine_dependent, 2, 2, - ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_UNDF), - sym, off, f); + /* movb/movw cannot be relaxed. */ + if (move_insn) + { + byte <<= 6; + number_to_chars_bigendian (f, byte, 1); + fix_new (frag_now, f - frag_now->fr_literal, 1, + sym, off, 0, BFD_RELOC_M68HC12_5B); + return 1; + } + else + { + number_to_chars_bigendian (f, byte, 1); + frag_var (rs_machine_dependent, 2, 2, + ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_UNDF), + sym, off, f); + } } else { f = frag_more (1); - number_to_chars_bigendian (f, byte, 1); - frag_var (rs_machine_dependent, 2, 2, - ENCODE_RELAX (STATE_INDEXED_PCREL, STATE_UNDF), - op->exp.X_add_symbol, - op->exp.X_add_number, f); + /* movb/movw cannot be relaxed. */ + if (move_insn) + { + byte <<= 6; + number_to_chars_bigendian (f, byte, 1); + fix_new (frag_now, f - frag_now->fr_literal, 1, + op->exp.X_add_symbol, op->exp.X_add_number, 0, BFD_RELOC_M68HC12_5B); + return 1; + } + else + { + number_to_chars_bigendian (f, byte, 1); + frag_var (rs_machine_dependent, 2, 2, + ENCODE_RELAX (STATE_INDEXED_PCREL, STATE_UNDF), + op->exp.X_add_symbol, + op->exp.X_add_number, f); + } } return 3; } @@ -3287,6 +3312,17 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) where[0] = where[0] | (value & 0x07); break; + case BFD_RELOC_M68HC12_5B: + if (value < -16 || value > 15) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Offset out of 5-bit range for movw/movb insn: %ld"), + value); + if (value >= 0) + where[0] |= value; + else + where[0] |= (0x10 | (16 + value)); + break; + case BFD_RELOC_M68HC11_RL_JUMP: case BFD_RELOC_M68HC11_RL_GROUP: case BFD_RELOC_VTABLE_INHERIT: diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 234176815b7..d1b38859559 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-01-11 Tom Rix + + * gas/m68hc11/movb.s: Add m68hc12 movb and movw dump test. + * gas/m68hc11/movb.d: Likewise. + * gas/m68hc11/m68hc11.exp: Likewise. Add more movb failure tests. + 2004-01-19 Alan Modra * gas/i386/katmai.d: Adjust for changed sib printing. diff --git a/gas/testsuite/gas/m68hc11/m68hc11.exp b/gas/testsuite/gas/m68hc11/m68hc11.exp index 8764777742a..2bfa8803aab 100644 --- a/gas/testsuite/gas/m68hc11/m68hc11.exp +++ b/gas/testsuite/gas/m68hc11/m68hc11.exp @@ -140,11 +140,21 @@ gas_m68hc11_error "-m68hc12" "movb 200,x,3,y\n" \ "Offset out of 5-bit range for movw/movb insn: 200" gas_m68hc11_error "-m68hc12" "movb 2,x,300,y\n" \ "Offset out of 5-bit range for movw/movb insn: 300" +gas_m68hc11_error "-m68hc12" "movb 2,x,bar,y\nbar=300\n" \ + "Offset out of 5-bit range for movw/movb insn: 300" +gas_m68hc11_error "-m68hc12" "movb bar,y,2,x\nbar=300\n" \ + "Offset out of 5-bit range for movw/movb insn: 300" +gas_m68hc11_error "-m68hc12" "movb 200,pc,3,y\n" \ + "Offset out of 5-bit range for movw/movb insn: 200" +gas_m68hc11_error "-m68hc12" "movb 2,x,300,pc\n" \ + "Offset out of 5-bit range for movw/movb insn: 300" +gas_m68hc11_error "-m68hc12" "movb 2,x,bar,pc\nbar=300\n" \ + "Offset out of 5-bit range for movw/movb insn: 300" +gas_m68hc11_error "-m68hc12" "movb bar,pc,2,x\nbar=300\n" \ + "Offset out of 5-bit range for movw/movb insn: 300" setup_xfail m6811-*-* setup_xfail m6812-*-* -gas_m68hc11_error "-m68hc12" "movb 2,x,bar,y\nbar=300\n" \ - "Offset out of 5-bit range for movw/movb insn: 300" # ------------------ # Specific commands @@ -173,3 +183,4 @@ run_dump_test branchs12 run_dump_test insns12 run_dump_test indexed12 run_dump_test bug-1825 +run_dump_test movb diff --git a/gas/testsuite/gas/m68hc11/movb.d b/gas/testsuite/gas/m68hc11/movb.d new file mode 100644 index 00000000000..4ef5e81bd86 --- /dev/null +++ b/gas/testsuite/gas/m68hc11/movb.d @@ -0,0 +1,451 @@ +#objdump: -D +#as: -m68hc12 +#name: 68HC12 movb movw instructions + +.*: +file format elf32\-m68hc12 + +Disassembly of section .text: + +0+00 <\.text>: +[ ]+ 0: 86 00[ ]+ ldaa #0 +[ ]+ 2: 18 0a 0f 0f movb 15,X, 15,X +[ ]+ 6: 18 0a 0f 0f movb 15,X, 15,X +[ ]+ a: 18 0a 0f 0f movb 15,X, 15,X +[ ]+ e: 86 01[ ]+ ldaa #1 +[ ]+10: 18 0a 0f 0f movb 15,X, 15,X +[ ]+14: 18 0a 0f 0f movb 15,X, 15,X +[ ]+18: 18 0a 0f 0f movb 15,X, 15,X +[ ]+1c: 86 02[ ]+ ldaa #2 +[ ]+1e: 18 0a 0f 10 movb 15,X, \-16,X +[ ]+22: 18 0a 0f 10 movb 15,X, \-16,X +[ ]+26: 18 0a 0f 10 movb 15,X, \-16,X +[ ]+2a: 86 03[ ]+ ldaa #3 +[ ]+2c: 18 0a 10 0f movb \-16,X, 15,X +[ ]+30: 18 0a 10 0f movb \-16,X, 15,X +[ ]+34: 18 0a 10 0f movb \-16,X, 15,X +[ ]+38: 86 04[ ]+ ldaa #4 +[ ]+3a: 18 02 0f 0f movw 15,X, 15,X +[ ]+3e: 18 02 0f 0f movw 15,X, 15,X +[ ]+42: 18 02 0f 0f movw 15,X, 15,X +[ ]+46: 86 05[ ]+ ldaa #5 +[ ]+48: 18 02 0f 0f movw 15,X, 15,X +[ ]+4c: 18 02 0f 0f movw 15,X, 15,X +[ ]+50: 18 02 0f 0f movw 15,X, 15,X +[ ]+54: 86 06[ ]+ ldaa #6 +[ ]+56: 18 02 0f 10 movw 15,X, \-16,X +[ ]+5a: 18 02 0f 10 movw 15,X, \-16,X +[ ]+5e: 18 02 0f 10 movw 15,X, \-16,X +[ ]+62: 86 07[ ]+ ldaa #7 +[ ]+64: 18 02 10 0f movw \-16,X, 15,X +[ ]+68: 18 02 10 0f movw \-16,X, 15,X +[ ]+6c: 18 02 10 0f movw \-16,X, 15,X +[ ]+70: 86 08[ ]+ ldaa #8 +[ ]+72: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+76: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+7a: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+7e: 86 09[ ]+ ldaa #9 +[ ]+80: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+84: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+88: 18 0a 4f 4f movb 15,Y, 15,Y +[ ]+8c: 86 0a[ ]+ ldaa #10 +[ ]+8e: 18 0a 4f 50 movb 15,Y, \-16,Y +[ ]+92: 18 0a 4f 50 movb 15,Y, \-16,Y +[ ]+96: 18 0a 4f 50 movb 15,Y, \-16,Y +[ ]+9a: 86 0b[ ]+ ldaa #11 +[ ]+9c: 18 0a 50 4f movb \-16,Y, 15,Y +[ ]+a0: 18 0a 50 4f movb \-16,Y, 15,Y +[ ]+a4: 18 0a 50 4f movb \-16,Y, 15,Y +[ ]+a8: 86 0c[ ]+ ldaa #12 +[ ]+aa: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+ae: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+b2: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+b6: 86 0d[ ]+ ldaa #13 +[ ]+b8: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+bc: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+c0: 18 02 4f 4f movw 15,Y, 15,Y +[ ]+c4: 86 0e[ ]+ ldaa #14 +[ ]+c6: 18 02 4f 50 movw 15,Y, \-16,Y +[ ]+ca: 18 02 4f 50 movw 15,Y, \-16,Y +[ ]+ce: 18 02 4f 50 movw 15,Y, \-16,Y +[ ]+d2: 86 0f[ ]+ ldaa #15 +[ ]+d4: 18 02 50 4f movw \-16,Y, 15,Y +[ ]+d8: 18 02 50 4f movw \-16,Y, 15,Y +[ ]+dc: 18 02 50 4f movw \-16,Y, 15,Y +[ ]+e0: 86 10[ ]+ ldaa #16 +[ ]+e2: 18 0a 4f cf movb 15,Y, 15,PC \{f5 \} +[ ]+e6: 18 0a 4f cf movb 15,Y, 15,PC \{f9 \} +[ ]+ea: 18 0a 4f cf movb 15,Y, 15,PC \{fd \} +[ ]+ee: 86 11[ ]+ ldaa #17 +[ ]+f0: 18 0a 4f cf movb 15,Y, 15,PC \{103 \} +[ ]+f4: 18 0a 4f cf movb 15,Y, 15,PC \{107 \} +[ ]+f8: 18 0a 4f cf movb 15,Y, 15,PC \{10b \} +[ ]+fc: 86 12[ ]+ ldaa #18 +[ ]+fe: 18 0a 4f d0 movb 15,Y, \-16,PC \{f2 \} + 102: 18 0a 4f d0 movb 15,Y, \-16,PC \{f6 \} + 106: 18 0a 4f d0 movb 15,Y, \-16,PC \{fa \} + 10a: 86 13[ ]+ ldaa #19 + 10c: 18 0a 50 cf movb \-16,Y, 15,PC \{11f \} + 110: 18 0a 50 cf movb \-16,Y, 15,PC \{123 \} + 114: 18 0a 50 cf movb \-16,Y, 15,PC \{127 \} + 118: 86 14[ ]+ ldaa #20 + 11a: 18 02 4f cf movw 15,Y, 15,PC \{12d \} + 11e: 18 02 4f cf movw 15,Y, 15,PC \{131 \} + 122: 18 02 4f cf movw 15,Y, 15,PC \{135 \} + 126: 86 15[ ]+ ldaa #21 + 128: 18 02 4f cf movw 15,Y, 15,PC \{13b \} + 12c: 18 02 4f cf movw 15,Y, 15,PC \{13f \} + 130: 18 02 4f cf movw 15,Y, 15,PC \{143 \} + 134: 86 16[ ]+ ldaa #22 + 136: 18 02 4f d0 movw 15,Y, \-16,PC \{12a \} + 13a: 18 02 4f d0 movw 15,Y, \-16,PC \{12e \} + 13e: 18 02 4f d0 movw 15,Y, \-16,PC \{132 \} + 142: 86 17[ ]+ ldaa #23 + 144: 18 02 50 cf movw \-16,Y, 15,PC \{157 \} + 148: 18 02 50 cf movw \-16,Y, 15,PC \{15b \} + 14c: 18 02 50 cf movw \-16,Y, 15,PC \{15f \} + 150: 86 18[ ]+ ldaa #24 + 152: 18 0a 8f cf movb 15,SP, 15,PC \{165 \} + 156: 18 0a 8f cf movb 15,SP, 15,PC \{169 \} + 15a: 18 0a 8f cf movb 15,SP, 15,PC \{16d \} + 15e: 86 19[ ]+ ldaa #25 + 160: 18 0a 8f cf movb 15,SP, 15,PC \{173 \} + 164: 18 0a 8f cf movb 15,SP, 15,PC \{177 \} + 168: 18 0a 8f cf movb 15,SP, 15,PC \{17b \} + 16c: 86 1a[ ]+ ldaa #26 + 16e: 18 0a 8f d0 movb 15,SP, \-16,PC \{162 \} + 172: 18 0a 8f d0 movb 15,SP, \-16,PC \{166 \} + 176: 18 0a 8f d0 movb 15,SP, \-16,PC \{16a \} + 17a: 86 1b[ ]+ ldaa #27 + 17c: 18 0a 90 cf movb \-16,SP, 15,PC \{18f \} + 180: 18 0a 90 cf movb \-16,SP, 15,PC \{193 \} + 184: 18 0a 90 cf movb \-16,SP, 15,PC \{197 \} + 188: 86 1c[ ]+ ldaa #28 + 18a: 18 02 8f cf movw 15,SP, 15,PC \{19d \} + 18e: 18 02 8f cf movw 15,SP, 15,PC \{1a1 \} + 192: 18 02 8f cf movw 15,SP, 15,PC \{1a5 \} + 196: 86 1d[ ]+ ldaa #29 + 198: 18 02 8f cf movw 15,SP, 15,PC \{1ab \} + 19c: 18 02 8f cf movw 15,SP, 15,PC \{1af \} + 1a0: 18 02 8f cf movw 15,SP, 15,PC \{1b3 \} + 1a4: 86 1e[ ]+ ldaa #30 + 1a6: 18 02 8f d0 movw 15,SP, \-16,PC \{19a \} + 1aa: 18 02 8f d0 movw 15,SP, \-16,PC \{19e \} + 1ae: 18 02 8f d0 movw 15,SP, \-16,PC \{1a2 \} + 1b2: 86 1f[ ]+ ldaa #31 + 1b4: 18 02 90 cf movw \-16,SP, 15,PC \{1c7 \} + 1b8: 18 02 90 cf movw \-16,SP, 15,PC \{1cb \} + 1bc: 18 02 90 cf movw \-16,SP, 15,PC \{1cf \} + 1c0: 86 20[ ]+ ldaa #32 + 1c2: 18 09 0f 10 movb 1000 , 15,X + 1c6: 00 + 1c7: 18 09 0f 10 movb 1000 , 15,X + 1cb: 00 + 1cc: 18 09 0f 10 movb 1000 , 15,X + 1d0: 00 + 1d1: 86 21[ ]+ ldaa #33 + 1d3: 18 0d 0f 10 movb 15,X, 1000 + 1d7: 00 + 1d8: 18 0d 0f 10 movb 15,X, 1000 + 1dc: 00 + 1dd: 18 0d 0f 10 movb 15,X, 1000 + 1e1: 00 + 1e2: 86 22[ ]+ ldaa #34 + 1e4: 18 09 10 10 movb 1000 , \-16,X + 1e8: 00 + 1e9: 18 09 10 10 movb 1000 , \-16,X + 1ed: 00 + 1ee: 18 09 10 10 movb 1000 , \-16,X + 1f2: 00 + 1f3: 86 23[ ]+ ldaa #35 + 1f5: 18 0d 10 10 movb \-16,X, 1000 + 1f9: 00 + 1fa: 18 0d 10 10 movb \-16,X, 1000 + 1fe: 00 + 1ff: 18 0d 10 10 movb \-16,X, 1000 + 203: 00 + 204: 86 24[ ]+ ldaa #36 + 206: 18 01 0f 10 movw 1002 , 15,X + 20a: 02 + 20b: 18 01 0f 10 movw 1002 , 15,X + 20f: 02 + 210: 18 01 0f 10 movw 1002 , 15,X + 214: 02 + 215: 86 25[ ]+ ldaa #37 + 217: 18 05 0f 10 movw 15,X, 1002 + 21b: 02 + 21c: 18 05 0f 10 movw 15,X, 1002 + 220: 02 + 221: 18 05 0f 10 movw 15,X, 1002 + 225: 02 + 226: 86 26[ ]+ ldaa #38 + 228: 18 01 10 10 movw 1002 , \-16,X + 22c: 02 + 22d: 18 01 10 10 movw 1002 , \-16,X + 231: 02 + 232: 18 01 10 10 movw 1002 , \-16,X + 236: 02 + 237: 86 27[ ]+ ldaa #39 + 239: 18 05 10 10 movw \-16,X, 1002 + 23d: 02 + 23e: 18 05 10 10 movw \-16,X, 1002 + 242: 02 + 243: 18 05 10 10 movw \-16,X, 1002 + 247: 02 + 248: 86 28[ ]+ ldaa #40 + 24a: 18 09 4f 10 movb 1000 , 15,Y + 24e: 00 + 24f: 18 09 4f 10 movb 1000 , 15,Y + 253: 00 + 254: 18 09 4f 10 movb 1000 , 15,Y + 258: 00 + 259: 86 29[ ]+ ldaa #41 + 25b: 18 0d 4f 10 movb 15,Y, 1000 + 25f: 00 + 260: 18 0d 4f 10 movb 15,Y, 1000 + 264: 00 + 265: 18 0d 4f 10 movb 15,Y, 1000 + 269: 00 + 26a: 86 2a[ ]+ ldaa #42 + 26c: 18 09 50 10 movb 1000 , \-16,Y + 270: 00 + 271: 18 09 50 10 movb 1000 , \-16,Y + 275: 00 + 276: 18 09 50 10 movb 1000 , \-16,Y + 27a: 00 + 27b: 86 2b[ ]+ ldaa #43 + 27d: 18 0d 50 10 movb \-16,Y, 1000 + 281: 00 + 282: 18 0d 50 10 movb \-16,Y, 1000 + 286: 00 + 287: 18 0d 50 10 movb \-16,Y, 1000 + 28b: 00 + 28c: 86 2c[ ]+ ldaa #44 + 28e: 18 01 4f 10 movw 1002 , 15,Y + 292: 02 + 293: 18 01 4f 10 movw 1002 , 15,Y + 297: 02 + 298: 18 01 4f 10 movw 1002 , 15,Y + 29c: 02 + 29d: 86 2d[ ]+ ldaa #45 + 29f: 18 05 4f 10 movw 15,Y, 1002 + 2a3: 02 + 2a4: 18 05 4f 10 movw 15,Y, 1002 + 2a8: 02 + 2a9: 18 05 4f 10 movw 15,Y, 1002 + 2ad: 02 + 2ae: 86 2e[ ]+ ldaa #46 + 2b0: 18 01 50 10 movw 1002 , \-16,Y + 2b4: 02 + 2b5: 18 01 50 10 movw 1002 , \-16,Y + 2b9: 02 + 2ba: 18 01 50 10 movw 1002 , \-16,Y + 2be: 02 + 2bf: 86 2f[ ]+ ldaa #47 + 2c1: 18 05 50 10 movw \-16,Y, 1002 + 2c5: 02 + 2c6: 18 05 50 10 movw \-16,Y, 1002 + 2ca: 02 + 2cb: 18 05 50 10 movw \-16,Y, 1002 + 2cf: 02 + 2d0: 86 30[ ]+ ldaa #48 + 2d2: 18 09 cf 10 movb 1000 , 15,PC \{2e4 \} + 2d6: 00 + 2d7: 18 09 cf 10 movb 1000 , 15,PC \{2e9 \} + 2db: 00 + 2dc: 18 09 cf 10 movb 1000 , 15,PC \{2ee \} + 2e0: 00 + 2e1: 86 31[ ]+ ldaa #49 + 2e3: 18 0d cf 10 movb 15,PC \{2f5 \}, 1000 + 2e7: 00 + 2e8: 18 0d cf 10 movb 15,PC \{2fa \}, 1000 + 2ec: 00 + 2ed: 18 0d cf 10 movb 15,PC \{2ff \}, 1000 + 2f1: 00 + 2f2: 86 32[ ]+ ldaa #50 + 2f4: 18 09 d0 10 movb 1000 , \-16,PC \{2e7 \} + 2f8: 00 + 2f9: 18 09 d0 10 movb 1000 , \-16,PC \{2ec \} + 2fd: 00 + 2fe: 18 09 d0 10 movb 1000 , \-16,PC \{2f1 \} + 302: 00 + 303: 86 33[ ]+ ldaa #51 + 305: 18 0d d0 10 movb \-16,PC \{2f8 \}, 1000 + 309: 00 + 30a: 18 0d d0 10 movb \-16,PC \{2fd \}, 1000 + 30e: 00 + 30f: 18 0d d0 10 movb \-16,PC \{302 \}, 1000 + 313: 00 + 314: 86 34[ ]+ ldaa #52 + 316: 18 01 cf 10 movw 1002 , 15,PC \{328 \} + 31a: 02 + 31b: 18 01 cf 10 movw 1002 , 15,PC \{32d \} + 31f: 02 + 320: 18 01 cf 10 movw 1002 , 15,PC \{332 \} + 324: 02 + 325: 86 35[ ]+ ldaa #53 + 327: 18 05 cf 10 movw 15,PC \{339 \}, 1002 + 32b: 02 + 32c: 18 05 cf 10 movw 15,PC \{33e \}, 1002 + 330: 02 + 331: 18 05 cf 10 movw 15,PC \{343 \}, 1002 + 335: 02 + 336: 86 36[ ]+ ldaa #54 + 338: 18 01 d0 10 movw 1002 , \-16,PC \{32b \} + 33c: 02 + 33d: 18 01 d0 10 movw 1002 , \-16,PC \{330 \} + 341: 02 + 342: 18 01 d0 10 movw 1002 , \-16,PC \{335 \} + 346: 02 + 347: 86 37[ ]+ ldaa #55 + 349: 18 05 d0 10 movw \-16,PC \{33c \}, 1002 + 34d: 02 + 34e: 18 05 d0 10 movw \-16,PC \{341 \}, 1002 + 352: 02 + 353: 18 05 d0 10 movw \-16,PC \{346 \}, 1002 + 357: 02 + 358: 86 38[ ]+ ldaa #56 + 35a: 18 09 8f 10 movb 1000 , 15,SP + 35e: 00 + 35f: 18 09 8f 10 movb 1000 , 15,SP + 363: 00 + 364: 18 09 8f 10 movb 1000 , 15,SP + 368: 00 + 369: 86 39[ ]+ ldaa #57 + 36b: 18 0d 8f 10 movb 15,SP, 1000 + 36f: 00 + 370: 18 0d 8f 10 movb 15,SP, 1000 + 374: 00 + 375: 18 0d 8f 10 movb 15,SP, 1000 + 379: 00 + 37a: 86 3a[ ]+ ldaa #58 + 37c: 18 09 90 10 movb 1000 , \-16,SP + 380: 00 + 381: 18 09 90 10 movb 1000 , \-16,SP + 385: 00 + 386: 18 09 90 10 movb 1000 , \-16,SP + 38a: 00 + 38b: 86 3b[ ]+ ldaa #59 + 38d: 18 0d 90 10 movb \-16,SP, 1000 + 391: 00 + 392: 18 0d 90 10 movb \-16,SP, 1000 + 396: 00 + 397: 18 0d 90 10 movb \-16,SP, 1000 + 39b: 00 + 39c: 86 3c[ ]+ ldaa #60 + 39e: 18 01 8f 10 movw 1002 , 15,SP + 3a2: 02 + 3a3: 18 01 8f 10 movw 1002 , 15,SP + 3a7: 02 + 3a8: 18 01 8f 10 movw 1002 , 15,SP + 3ac: 02 + 3ad: 86 3d[ ]+ ldaa #61 + 3af: 18 05 8f 10 movw 15,SP, 1002 + 3b3: 02 + 3b4: 18 05 8f 10 movw 15,SP, 1002 + 3b8: 02 + 3b9: 18 05 8f 10 movw 15,SP, 1002 + 3bd: 02 + 3be: 86 3e[ ]+ ldaa #62 + 3c0: 18 01 90 10 movw 1002 , \-16,SP + 3c4: 02 + 3c5: 18 01 90 10 movw 1002 , \-16,SP + 3c9: 02 + 3ca: 18 01 90 10 movw 1002 , \-16,SP + 3ce: 02 + 3cf: 86 3f[ ]+ ldaa #63 + 3d1: 18 05 90 10 movw \-16,SP, 1002 + 3d5: 02 + 3d6: 18 05 90 10 movw \-16,SP, 1002 + 3da: 02 + 3db: 18 05 90 10 movw \-16,SP, 1002 + 3df: 02 + 3e0: 86 40[ ]+ ldaa #64 + 3e2: 18 08 07 aa movb #170, 7,X + 3e6: 18 08 07 aa movb #170, 7,X + 3ea: 18 08 07 aa movb #170, 7,X + 3ee: 86 41[ ]+ ldaa #65 + 3f0: 18 08 18 aa movb #170, \-8,X + 3f4: 18 08 18 aa movb #170, \-8,X + 3f8: 18 08 18 aa movb #170, \-8,X + 3fc: 86 42[ ]+ ldaa #66 + 3fe: 18 00 07 00 movw #44 , 7,X + 402: 44 + 403: 18 00 07 00 movw #44 , 7,X + 407: 44 + 408: 18 00 07 00 movw #44 , 7,X + 40c: 44 + 40d: 86 43[ ]+ ldaa #67 + 40f: 18 00 18 00 movw #44 , \-8,X + 413: 44 + 414: 18 00 18 00 movw #44 , \-8,X + 418: 44 + 419: 18 00 18 00 movw #44 , \-8,X + 41d: 44 + 41e: 86 44[ ]+ ldaa #68 + 420: 18 08 47 aa movb #170, 7,Y + 424: 18 08 47 aa movb #170, 7,Y + 428: 18 08 47 aa movb #170, 7,Y + 42c: 86 45[ ]+ ldaa #69 + 42e: 18 08 58 aa movb #170, \-8,Y + 432: 18 08 58 aa movb #170, \-8,Y + 436: 18 08 58 aa movb #170, \-8,Y + 43a: 86 46[ ]+ ldaa #70 + 43c: 18 00 47 00 movw #44 , 7,Y + 440: 44 + 441: 18 00 47 00 movw #44 , 7,Y + 445: 44 + 446: 18 00 47 00 movw #44 , 7,Y + 44a: 44 + 44b: 86 47[ ]+ ldaa #71 + 44d: 18 00 58 00 movw #44 , \-8,Y + 451: 44 + 452: 18 00 58 00 movw #44 , \-8,Y + 456: 44 + 457: 18 00 58 00 movw #44 , \-8,Y + 45b: 44 + 45c: 86 48[ ]+ ldaa #72 + 45e: 18 08 c7 aa movb #170, 7,PC \{468 \} + 462: 18 08 c7 aa movb #170, 7,PC \{46c \} + 466: 18 08 c7 aa movb #170, 7,PC \{470 \} + 46a: 86 49[ ]+ ldaa #73 + 46c: 18 08 d8 aa movb #170, \-8,PC \{467 \} + 470: 18 08 d8 aa movb #170, \-8,PC \{46b \} + 474: 18 08 d8 aa movb #170, \-8,PC \{46f \} + 478: 86 4a[ ]+ ldaa #74 + 47a: 18 00 c7 00 movw #44 , 7,PC \{484 \} + 47e: 44 + 47f: 18 00 c7 00 movw #44 , 7,PC \{489 \} + 483: 44 + 484: 18 00 c7 00 movw #44 , 7,PC \{48e \} + 488: 44 + 489: 86 4b[ ]+ ldaa #75 + 48b: 18 00 d8 00 movw #44 , \-8,PC \{486 \} + 48f: 44 + 490: 18 00 d8 00 movw #44 , \-8,PC \{48b \} + 494: 44 + 495: 18 00 d8 00 movw #44 , \-8,PC \{490 \} + 499: 44 + 49a: 86 4c[ ]+ ldaa #76 + 49c: 18 08 87 aa movb #170, 7,SP + 4a0: 18 08 87 aa movb #170, 7,SP + 4a4: 18 08 87 aa movb #170, 7,SP + 4a8: 86 4d[ ]+ ldaa #77 + 4aa: 18 08 98 aa movb #170, \-8,SP + 4ae: 18 08 98 aa movb #170, \-8,SP + 4b2: 18 08 98 aa movb #170, \-8,SP + 4b6: 86 4e[ ]+ ldaa #78 + 4b8: 18 00 87 00 movw #44 , 7,SP + 4bc: 44 + 4bd: 18 00 87 00 movw #44 , 7,SP + 4c1: 44 + 4c2: 18 00 87 00 movw #44 , 7,SP + 4c6: 44 + 4c7: 86 4f[ ]+ ldaa #79 + 4c9: 18 00 98 00 movw #44 , \-8,SP + 4cd: 44 + 4ce: 18 00 98 00 movw #44 , \-8,SP + 4d2: 44 + 4d3: 18 00 98 00 movw #44 , \-8,SP + 4d7: 44 + 4d8: 86 50[ ]+ ldaa #80 + diff --git a/gas/testsuite/gas/m68hc11/movb.s b/gas/testsuite/gas/m68hc11/movb.s new file mode 100644 index 00000000000..c9aae0f8bae --- /dev/null +++ b/gas/testsuite/gas/m68hc11/movb.s @@ -0,0 +1,333 @@ + dog2=15 + dog3=-16 + dog4=7 + dog5=-8 + ;; idx - idx + ldaa #0 + movb 15,x,dog2,x + movb 15,x,cat2,x + movb 15,x,15,x + ldaa #1 + movb dog2,x,15,x + movb cat2,x,15,x + movb 15,x,15,x + ldaa #2 + movb 15,x,dog3,x + movb 15,x,cat3,x + movb 15,x,-16,x + ldaa #3 + movb dog3,x,15,x + movb cat3,x,15,x + movb -16,x,15,x + ldaa #4 + movw 15,x,dog2,x + movw 15,x,cat2,x + movw 15,x,15,x + ldaa #5 + movw dog2,x,15,x + movw cat2,x,15,x + movw 15,x,15,x + ldaa #6 + movw 15,x,dog3,x + movw 15,x,cat3,x + movw 15,x,-16,x + ldaa #7 + movw dog3,x,15,x + movw cat3,x,15,x + movw -16,x,15,x + ldaa #8 + movb 15,y,dog2,y + movb 15,y,cat2,y + movb 15,y,15,y + ldaa #9 + movb dog2,y,15,y + movb cat2,y,15,y + movb 15,y,15,y + ldaa #10 + movb 15,y,dog3,y + movb 15,y,cat3,y + movb 15,y,-16,y + ldaa #11 + movb dog3,y,15,y + movb cat3,y,15,y + movb -16,y,15,y + ldaa #12 + movw 15,y,dog2,y + movw 15,y,cat2,y + movw 15,y,15,y + ldaa #13 + movw dog2,y,15,y + movw cat2,y,15,y + movw 15,y,15,y + ldaa #14 + movw 15,y,dog3,y + movw 15,y,cat3,y + movw 15,y,-16,y + ldaa #15 + movw dog3,y,15,y + movw cat3,y,15,y + movw -16,y,15,y + ldaa #16 + movb 15,y,dog2,pc + movb 15,y,cat2,pc + movb 15,y,15,pc + ldaa #17 + movb dog2,y,15,pc + movb cat2,y,15,pc + movb 15,y,15,pc + ldaa #18 + movb 15,y,dog3,pc + movb 15,y,cat3,pc + movb 15,y,-16,pc + ldaa #19 + movb dog3,y,15,pc + movb cat3,y,15,pc + movb -16,y,15,pc + ldaa #20 + movw 15,y,dog2,pc + movw 15,y,cat2,pc + movw 15,y,15,pc + ldaa #21 + movw dog2,y,15,pc + movw cat2,y,15,pc + movw 15,y,15,pc + ldaa #22 + movw 15,y,dog3,pc + movw 15,y,cat3,pc + movw 15,y,-16,pc + ldaa #23 + movw dog3,y,15,pc + movw cat3,y,15,pc + movw -16,y,15,pc + ldaa #24 + movb 15,sp,dog2,pc + movb 15,sp,cat2,pc + movb 15,sp,15,pc + ldaa #25 + movb dog2,sp,15,pc + movb cat2,sp,15,pc + movb 15,sp,15,pc + ldaa #26 + movb 15,sp,dog3,pc + movb 15,sp,cat3,pc + movb 15,sp,-16,pc + ldaa #27 + movb dog3,sp,15,pc + movb cat3,sp,15,pc + movb -16,sp,15,pc + ldaa #28 + movw 15,sp,dog2,pc + movw 15,sp,cat2,pc + movw 15,sp,15,pc + ldaa #29 + movw dog2,sp,15,pc + movw cat2,sp,15,pc + movw 15,sp,15,pc + ldaa #30 + movw 15,sp,dog3,pc + movw 15,sp,cat3,pc + movw 15,sp,-16,pc + ldaa #31 + movw dog3,sp,15,pc + movw cat3,sp,15,pc + movw -16,sp,15,pc + ldaa #32 + ;; ext - idx + ;; idx - ext + movb 0x1000,dog2,x + movb 0x1000,cat2,x + movb 0x1000,15,x + ldaa #33 + movb dog2,x,0x1000 + movb cat2,x,0x1000 + movb 15,x,0x1000 + ldaa #34 + movb 0x1000,dog3,x + movb 0x1000,cat3,x + movb 0x1000,-16,x + ldaa #35 + movb dog3,x,0x1000 + movb cat3,x,0x1000 + movb -16,x,0x1000 + ldaa #36 + movw 0x1002,dog2,x + movw 0x1002,cat2,x + movw 0x1002,15,x + ldaa #37 + movw dog2,x,0x1002 + movw cat2,x,0x1002 + movw 15,x,0x1002 + ldaa #38 + movw 0x1002,dog3,x + movw 0x1002,cat3,x + movw 0x1002,-16,x + ldaa #39 + movw dog3,x,0x1002 + movw cat3,x,0x1002 + movw -16,x,0x1002 + ldaa #40 + movb 0x1000,dog2,y + movb 0x1000,cat2,y + movb 0x1000,15,y + ldaa #41 + movb dog2,y,0x1000 + movb cat2,y,0x1000 + movb 15,y,0x1000 + ldaa #42 + movb 0x1000,dog3,y + movb 0x1000,cat3,y + movb 0x1000,-16,y + ldaa #43 + movb dog3,y,0x1000 + movb cat3,y,0x1000 + movb -16,y,0x1000 + ldaa #44 + movw 0x1002,dog2,y + movw 0x1002,cat2,y + movw 0x1002,15,y + ldaa #45 + movw dog2,y,0x1002 + movw cat2,y,0x1002 + movw 15,y,0x1002 + ldaa #46 + movw 0x1002,dog3,y + movw 0x1002,cat3,y + movw 0x1002,-16,y + ldaa #47 + movw dog3,y,0x1002 + movw cat3,y,0x1002 + movw -16,y,0x1002 + ldaa #48 + movb 0x1000,dog2,pc + movb 0x1000,cat2,pc + movb 0x1000,15,pc + ldaa #49 + movb dog2,pc,0x1000 + movb cat2,pc,0x1000 + movb 15,pc,0x1000 + ldaa #50 + movb 0x1000,dog3,pc + movb 0x1000,cat3,pc + movb 0x1000,-16,pc + ldaa #51 + movb dog3,pc,0x1000 + movb cat3,pc,0x1000 + movb -16,pc,0x1000 + ldaa #52 + movw 0x1002,dog2,pc + movw 0x1002,cat2,pc + movw 0x1002,15,pc + ldaa #53 + movw dog2,pc,0x1002 + movw cat2,pc,0x1002 + movw 15,pc,0x1002 + ldaa #54 + movw 0x1002,dog3,pc + movw 0x1002,cat3,pc + movw 0x1002,-16,pc + ldaa #55 + movw dog3,pc,0x1002 + movw cat3,pc,0x1002 + movw -16,pc,0x1002 + ldaa #56 + movb 0x1000,dog2,sp + movb 0x1000,cat2,sp + movb 0x1000,15,sp + ldaa #57 + movb dog2,sp,0x1000 + movb cat2,sp,0x1000 + movb 15,sp,0x1000 + ldaa #58 + movb 0x1000,dog3,sp + movb 0x1000,cat3,sp + movb 0x1000,-16,sp + ldaa #59 + movb dog3,sp,0x1000 + movb cat3,sp,0x1000 + movb -16,sp,0x1000 + ldaa #60 + movw 0x1002,dog2,sp + movw 0x1002,cat2,sp + movw 0x1002,15,sp + ldaa #61 + movw dog2,sp,0x1002 + movw cat2,sp,0x1002 + movw 15,sp,0x1002 + ldaa #62 + movw 0x1002,dog3,sp + movw 0x1002,cat3,sp + movw 0x1002,-16,sp + ldaa #63 + movw dog3,sp,0x1002 + movw cat3,sp,0x1002 + movw -16,sp,0x1002 + ldaa #64 + ;; imm - idx + movb #0xaa,dog4,x + movb #0xaa,cat4,x + movb #0xaa,7,x + ldaa #65 + movb #0xaa,dog5,x + movb #0xaa,cat5,x + movb #0xaa,-8,x + ldaa #66 + movw #0x44,dog4,x + movw #0x44,cat4,x + movw #0x44,7,x + ldaa #67 + movw #0x44,dog5,x + movw #0x44,cat5,x + movw #0x44,-8,x + ldaa #68 + movb #0xaa,dog4,y + movb #0xaa,cat4,y + movb #0xaa,7,y + ldaa #69 + movb #0xaa,dog5,y + movb #0xaa,cat5,y + movb #0xaa,-8,y + ldaa #70 + movw #0x44,dog4,y + movw #0x44,cat4,y + movw #0x44,7,y + ldaa #71 + movw #0x44,dog5,y + movw #0x44,cat5,y + movw #0x44,-8,y + ldaa #72 + movb #0xaa,dog4,pc + movb #0xaa,cat4,pc + movb #0xaa,7,pc + ldaa #73 + movb #0xaa,dog5,pc + movb #0xaa,cat5,pc + movb #0xaa,-8,pc + ldaa #74 + movw #0x44,dog4,pc + movw #0x44,cat4,pc + movw #0x44,7,pc + ldaa #75 + movw #0x44,dog5,pc + movw #0x44,cat5,pc + movw #0x44,-8,pc + ldaa #76 + movb #0xaa,dog4,sp + movb #0xaa,cat4,sp + movb #0xaa,7,sp + ldaa #77 + movb #0xaa,dog5,sp + movb #0xaa,cat5,sp + movb #0xaa,-8,sp + ldaa #78 + movw #0x44,dog4,sp + movw #0x44,cat4,sp + movw #0x44,7,sp + ldaa #79 + movw #0x44,dog5,sp + movw #0x44,cat5,sp + movw #0x44,-8,sp + ldaa #80 + cat2=15 + cat3=-16 + cat4=7 + cat5=-8 -- 2.30.2