+2000-12-15 Diego Novillo <dnovillo@redhat.com>
+
+ * config/tc-i386.c (intel_e09_1): Only flag as a memory operand if
+ it's not an offset expression.
+ (intel_e10_1): Ditto. Also, if the operand is an offset expression,
+ keep the braces '[' and ']' in the output string.
+ (intel_e11): Ditto. Also remove comparison intel_parser.op_modifier
+ != FLAT. There is no such op_modifier.
+
2000-12-14 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* dwarf2dbg.c: If we don't have <limits.h>, try including <sys/param.h>
/* e09 : e10 e09' */
else if (cur_token.code == ':')
{
- intel_parser.is_mem = 1;
+ /* Mark as a memory operand only if it's not already known to be an
+ offset expression. */
+ if (intel_parser.op_modifier != OFFSET_FLAT)
+ intel_parser.is_mem = 1;
return (intel_match_token (':') && intel_e10 () && intel_e09_1 ());
}
if (cur_token.code == '[')
{
intel_match_token ('[');
- intel_parser.is_mem = 1;
+
+ /* Mark as a memory operand only if it's not already known to be an
+ offset expression. If it's an offset expression, we need to keep
+ the brace in. */
+ if (intel_parser.op_modifier != OFFSET_FLAT)
+ intel_parser.is_mem = 1;
+ else
+ strcat (intel_parser.disp, "[");
/* Add a '+' to the displacement string if necessary. */
- if (*intel_parser.disp != '\0')
+ if (*intel_parser.disp != '\0'
+ && *(intel_parser.disp + strlen (intel_parser.disp) - 1) != '+')
strcat (intel_parser.disp, "+");
- return (intel_expr () && intel_match_token (']') && intel_e10_1 ());
+ if (intel_expr () && intel_match_token (']'))
+ {
+ /* Preserve brackets when the operand is an offset expression. */
+ if (intel_parser.op_modifier == OFFSET_FLAT)
+ strcat (intel_parser.disp, "]");
+
+ return intel_e10_1 ();
+ }
+ else
+ return 0;
}
/* e10' Empty */
else if (cur_token.code == '[')
{
intel_match_token ('[');
- intel_parser.is_mem = 1;
+
+ /* Mark as a memory operand only if it's not already known to be an
+ offset expression. If it's an offset expression, we need to keep
+ the brace in. */
+ if (intel_parser.op_modifier != OFFSET_FLAT)
+ intel_parser.is_mem = 1;
+ else
+ strcat (intel_parser.disp, "[");
/* Operands for jump/call inside brackets denote absolute addresses. */
if (current_templates->start->opcode_modifier & Jump
i.types[this_operand] |= JumpAbsolute;
/* Add a '+' to the displacement string if necessary. */
- if (*intel_parser.disp != '\0')
+ if (*intel_parser.disp != '\0'
+ && *(intel_parser.disp + strlen (intel_parser.disp) - 1) != '+')
strcat (intel_parser.disp, "+");
- return (intel_expr () && intel_match_token (']'));
+ if (intel_expr () && intel_match_token (']'))
+ {
+ /* Preserve brackets when the operand is an offset expression. */
+ if (intel_parser.op_modifier == OFFSET_FLAT)
+ strcat (intel_parser.disp, "]");
+
+ return 1;
+ }
+ else
+ return 0;
}
/* e11 BYTE
{
strcat (intel_parser.disp, cur_token.str);
intel_match_token (cur_token.code);
- intel_parser.is_mem = 1;
+
+ /* Mark as a memory operand only if it's not already known to be an
+ offset expression. */
+ if (intel_parser.op_modifier != OFFSET_FLAT)
+ intel_parser.is_mem = 1;
return 1;
}
/* The identifier represents a memory reference only if it's not
preceded by an offset modifier. */
- if (intel_parser.op_modifier != OFFSET_FLAT
- && intel_parser.op_modifier != FLAT)
+ if (intel_parser.op_modifier != OFFSET_FLAT)
intel_parser.is_mem = 1;
return 1;