* config/tc-mn10300.h (md_assemble): Tweak further so
authorJeff Law <law@redhat.com>
Tue, 8 Oct 1996 20:59:28 +0000 (20:59 +0000)
committerJeff Law <law@redhat.com>
Tue, 8 Oct 1996 20:59:28 +0000 (20:59 +0000)
        that all instructions are parsed correctly.

gas/ChangeLog
gas/config/tc-mn10300.c

index 8ad62261aed8759754061237e231aaa5d72d57db..504344bd2d192e471d670fe6bf520a067c7a52a7 100644 (file)
@@ -1,3 +1,8 @@
+Tue Oct  8 14:56:15 1996  Jeffrey A Law  (law@cygnus.com)
+
+       * config/tc-mn10300.h (md_assemble): Tweak further so
+       that all instructions are parsed correctly.
+
 Tue Oct  8 13:02:21 1996  Ian Lance Taylor  <ian@cygnus.com>
 
        * as.h: Include libiberty.h.
index e64fc230f0bebaf1a649a88b6b9b012bc6036143..796b696637902e041d797ea9bb85f6c258fa6ae3 100644 (file)
@@ -434,7 +434,6 @@ md_assemble (str)
     {
       const char *errmsg = NULL;
       int op_idx;
-      int parens = 0;
       char *hold;
 
       fc = 0;
@@ -467,16 +466,19 @@ md_assemble (str)
          hold = input_line_pointer;
          input_line_pointer = str;
 
-#if 1
-         if (*str == '(')
-            {
-             str++;
+         if (operand->flags & MN10300_OPERAND_PAREN)
+           {
+             if (*input_line_pointer != ')' && *input_line_pointer != '(')
+               {
+                 input_line_pointer = hold;
+                 str = hold;
+                 goto error;
+               }
              input_line_pointer++;
-             parens++;
+             goto keep_going;
            }
-#endif
          /* See if we can match the operands.  */
-         if (operand->flags & MN10300_OPERAND_DREG)
+         else if (operand->flags & MN10300_OPERAND_DREG)
            {
              if (!data_register_name (&ex))
                {
@@ -557,6 +559,12 @@ md_assemble (str)
              str = hold;
              goto error;
            }
+         else if (*str == ')' || *str == '(')
+           {
+             input_line_pointer = hold;
+             str = hold;
+             goto error;
+           }
          else
            {
              expression (&ex);
@@ -626,19 +634,11 @@ keep_going:
          while (*str == ' ' || *str == ',' || *str == '[' || *str == ']')
            ++str;
 
-         if (*str == ')')
-           {
-             str++;
-             parens--;
-           }
        }
-      if (parens == 0 && *str != ',')
+
+      /* Make sure we used all the operands!  */
+      if (*str != ',')
        match = 1;
-      else
-       {
-         input_line_pointer = hold;
-         str = hold;
-       }
 
     error:
       if (match == 0)