static int i386_intel_operand (char *, int);
static int i386_intel_simplify (expressionS *);
static int i386_intel_parse_name (const char *, expressionS *);
-static const reg_entry *parse_register (char *, char **);
+static const reg_entry *parse_register (const char *, char **);
static const char *parse_insn (const char *, char *, bool);
static char *parse_operands (char *, const char *);
static void swap_operands (void);
temp_string = base_string;
/* Skip past '(' and whitespace. */
- if (*base_string != '(')
- {
- as_bad (_("unbalanced braces"));
- return 0;
- }
+ gas_assert (*base_string == '(');
++base_string;
if (is_space_char (*base_string))
++base_string;
/* REG_STRING starts *before* REGISTER_PREFIX. */
static const reg_entry *
-parse_register (char *reg_string, char **end_op)
+parse_register (const char *reg_string, char **end_op)
{
const reg_entry *r;
if (!r)
{
char *save = input_line_pointer;
- char c;
+ char *buf = xstrdup (reg_string), *name;
symbolS *symbolP;
- input_line_pointer = reg_string;
- c = get_symbol_name (®_string);
- symbolP = symbol_find (reg_string);
+ input_line_pointer = buf;
+ get_symbol_name (&name);
+ symbolP = symbol_find (name);
while (symbolP && S_GET_SEGMENT (symbolP) != reg_section)
{
const expressionS *e = symbol_get_value_expression(symbolP);
know (e->X_add_number >= 0
&& (valueT) e->X_add_number < i386_regtab_size);
r = i386_regtab + e->X_add_number;
- *end_op = input_line_pointer;
+ *end_op = (char *) reg_string + (input_line_pointer - buf);
}
if (r && !check_register (r))
{
r = &bad_reg;
}
}
- *input_line_pointer = c;
input_line_pointer = save;
+ free (buf);
}
return r;
}