From be8c092bb0532fb342e38ed21a8cf8ce7773b98f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 24 May 2004 14:33:22 +0000 Subject: Reorganise m68k instruction decoding and improve handling of MAC/EMAC --- gas/config/m68k-parse.y | 13 ++++++++----- gas/config/tc-m68k.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'gas/config') diff --git a/gas/config/m68k-parse.y b/gas/config/m68k-parse.y index c56ad23..d6bb4b8 100644 --- a/gas/config/m68k-parse.y +++ b/gas/config/m68k-parse.y @@ -1,5 +1,5 @@ /* m68k.y -- bison grammar for m68k operand parsing - Copyright 1995, 1996, 1997, 1998, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 2001, 2004 Free Software Foundation, Inc. Written by Ken Raeburn and Ian Lance Taylor, Cygnus Support This file is part of GAS, the GNU Assembler. @@ -35,7 +35,7 @@ etc), as well as gratuitously global symbol names If other parser generators (bison, byacc, etc) produce additional global names that conflict at link time, then those parser generators need to be - fixed instead of adding those names to this list. */ + fixed instead of adding those names to this list. */ #define yymaxdepth m68k_maxdepth #define yyparse m68k_parse @@ -122,7 +122,10 @@ operand: { op->trailing_ampersand = $2; } - | mit_operand + | mit_operand optional_ampersand + { + op->trailing_ampersand = $2; + } ; /* A trailing ampersand(for MAC/EMAC mask addressing). */ @@ -793,8 +796,8 @@ yylex () case '-': /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it appears anywhere else, it must be a unary minus on an - expression. */ - if (str[1] == '\0') + expression, unless it it trailed by a '&'(see mac load insn). */ + if (str[1] == '\0' || (str[1] == '&' && str[2] == '\0')) return *str++; s = str + 1; if (*s == '(') diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 89c2df9..7ee4656 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -3476,11 +3476,11 @@ install_operand (mode, val) case 'f': the_ins.opcode[0] |= ((val & 0x3) << 0); break; - case 'G': + case 'G': /* EMAC accumulator in a EMAC load instruction. */ the_ins.opcode[0] |= ((~val & 0x1) << 7); the_ins.opcode[1] |= ((val & 0x2) << (4 - 1)); break; - case 'H': + case 'H': /* EMAC accumulator in a EMAC non-load instruction. */ the_ins.opcode[0] |= ((val & 0x1) << 7); the_ins.opcode[1] |= ((val & 0x2) << (4 - 1)); break; -- cgit v1.1