aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-10-08 20:59:28 +0000
committerJeff Law <law@redhat.com>1996-10-08 20:59:28 +0000
commita6be605a1a703e15458d7ae24650734f6804c14f (patch)
tree3ea6adf9b6955685bda9ef1eb97f7681eb8a1eec /gas/config
parent1d574167095412b5eaeb1242af3537fd5cd688e3 (diff)
downloadgdb-a6be605a1a703e15458d7ae24650734f6804c14f.zip
gdb-a6be605a1a703e15458d7ae24650734f6804c14f.tar.gz
gdb-a6be605a1a703e15458d7ae24650734f6804c14f.tar.bz2
* config/tc-mn10300.h (md_assemble): Tweak further so
that all instructions are parsed correctly.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mn10300.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index e64fc23..796b696 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)