From: Jeff Law Date: Tue, 8 Oct 1996 20:59:28 +0000 (+0000) Subject: * config/tc-mn10300.h (md_assemble): Tweak further so X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=a6be605a1a703e15458d7ae24650734f6804c14f;p=deliverable%2Fbinutils-gdb.git * config/tc-mn10300.h (md_assemble): Tweak further so that all instructions are parsed correctly. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 8ad62261ae..504344bd2d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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 * as.h: Include libiberty.h. diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index e64fc230f0..796b696637 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -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)