+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.
{
const char *errmsg = NULL;
int op_idx;
- int parens = 0;
char *hold;
fc = 0;
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))
{
str = hold;
goto error;
}
+ else if (*str == ')' || *str == '(')
+ {
+ input_line_pointer = hold;
+ str = hold;
+ goto error;
+ }
else
{
expression (&ex);
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)