mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
Accept an absolute expression for index scale factor.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2001-03-25 Alan Modra <alan@linuxcare.com.au>
|
||||||
|
|
||||||
|
* config/tc-i386.c (i386_scale): Accept an absolute expression for
|
||||||
|
scale factor, and return the end of the expression.
|
||||||
|
(i386_operand): Modify for above.
|
||||||
|
|
||||||
2001-03-23 Nick Clifton <nickc@redhat.com>
|
2001-03-23 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* doc/as.texinfo: Document --listing-XXX command line switches.
|
* doc/as.texinfo: Document --listing-XXX command line switches.
|
||||||
|
@ -3344,35 +3344,38 @@ i386_immediate (imm_start)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int i386_scale PARAMS ((char *));
|
static char *i386_scale PARAMS ((char *));
|
||||||
|
|
||||||
static int
|
static char *
|
||||||
i386_scale (scale)
|
i386_scale (scale)
|
||||||
char *scale;
|
char *scale;
|
||||||
{
|
{
|
||||||
if (!isdigit (*scale))
|
offsetT val;
|
||||||
goto bad_scale;
|
char *save = input_line_pointer;
|
||||||
|
|
||||||
switch (*scale)
|
input_line_pointer = scale;
|
||||||
|
val = get_absolute_expression ();
|
||||||
|
|
||||||
|
switch (val)
|
||||||
{
|
{
|
||||||
case '0':
|
case 0:
|
||||||
case '1':
|
case 1:
|
||||||
i.log2_scale_factor = 0;
|
i.log2_scale_factor = 0;
|
||||||
break;
|
break;
|
||||||
case '2':
|
case 2:
|
||||||
i.log2_scale_factor = 1;
|
i.log2_scale_factor = 1;
|
||||||
break;
|
break;
|
||||||
case '4':
|
case 4:
|
||||||
i.log2_scale_factor = 2;
|
i.log2_scale_factor = 2;
|
||||||
break;
|
break;
|
||||||
case '8':
|
case 8:
|
||||||
i.log2_scale_factor = 3;
|
i.log2_scale_factor = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bad_scale:
|
|
||||||
as_bad (_("expecting scale factor of 1, 2, 4, or 8: got `%s'"),
|
as_bad (_("expecting scale factor of 1, 2, 4, or 8: got `%s'"),
|
||||||
scale);
|
scale);
|
||||||
return 0;
|
input_line_pointer = save;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
if (i.log2_scale_factor != 0 && ! i.index_reg)
|
if (i.log2_scale_factor != 0 && ! i.index_reg)
|
||||||
{
|
{
|
||||||
@ -3382,7 +3385,9 @@ i386_scale (scale)
|
|||||||
i.log2_scale_factor = 0;
|
i.log2_scale_factor = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 1;
|
scale = input_line_pointer;
|
||||||
|
input_line_pointer = save;
|
||||||
|
return scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int i386_displacement PARAMS ((char *, char *));
|
static int i386_displacement PARAMS ((char *, char *));
|
||||||
@ -3830,12 +3835,14 @@ i386_operand (operand_string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for scale factor. */
|
/* Check for scale factor. */
|
||||||
if (isdigit ((unsigned char) *base_string))
|
if (*base_string != ')')
|
||||||
{
|
{
|
||||||
if (!i386_scale (base_string))
|
char *end_scale = i386_scale (base_string);
|
||||||
|
|
||||||
|
if (!end_scale)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
++base_string;
|
base_string = end_scale;
|
||||||
if (is_space_char (*base_string))
|
if (is_space_char (*base_string))
|
||||||
++base_string;
|
++base_string;
|
||||||
if (*base_string != ')')
|
if (*base_string != ')')
|
||||||
|
Reference in New Issue
Block a user