projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gas/
[deliverable/binutils-gdb.git]
/
gas
/
config
/
tc-i386-intel.c
diff --git
a/gas/config/tc-i386-intel.c
b/gas/config/tc-i386-intel.c
index e7a53889e534519724afded650fe60fa6c9c84c3..5d5e0c1176978ca709ce6798d23865b8e8cae808 100644
(file)
--- a/
gas/config/tc-i386-intel.c
+++ b/
gas/config/tc-i386-intel.c
@@
-23,6
+23,7
@@
static struct
{
operatorT op_modifier; /* Operand modifier. */
int is_mem; /* 1 if operand is memory reference. */
{
operatorT op_modifier; /* Operand modifier. */
int is_mem; /* 1 if operand is memory reference. */
+ int has_offset; /* 1 if operand has offset. */
unsigned int in_offset; /* >=1 if processing operand of offset. */
unsigned int in_bracket; /* >=1 if processing operand in brackets. */
unsigned int in_scale; /* >=1 if processing multipication operand
unsigned int in_offset; /* >=1 if processing operand of offset. */
unsigned int in_bracket; /* >=1 if processing operand in brackets. */
unsigned int in_scale; /* >=1 if processing multipication operand
@@
-37,35
+38,35
@@
intel_state;
/* offset X_add_symbol */
#define O_offset O_md32
/* offset X_add_symbol */
#define O_offset O_md32
+/* offset X_add_symbol */
+#define O_short O_md31
+/* near ptr X_add_symbol */
+#define O_near_ptr O_md30
+/* far ptr X_add_symbol */
+#define O_far_ptr O_md29
/* byte ptr X_add_symbol */
/* byte ptr X_add_symbol */
-#define O_byte_ptr O_md
31
+#define O_byte_ptr O_md
28
/* word ptr X_add_symbol */
/* word ptr X_add_symbol */
-#define O_word_ptr O_md
30
+#define O_word_ptr O_md
27
/* dword ptr X_add_symbol */
/* dword ptr X_add_symbol */
-#define O_dword_ptr O_md2
9
+#define O_dword_ptr O_md2
6
/* qword ptr X_add_symbol */
/* qword ptr X_add_symbol */
-#define O_qword_ptr O_md2
8
+#define O_qword_ptr O_md2
5
/* oword ptr X_add_symbol */
/* oword ptr X_add_symbol */
-#define O_oword_ptr O_md2
7
+#define O_oword_ptr O_md2
4
/* fword ptr X_add_symbol */
/* fword ptr X_add_symbol */
-#define O_fword_ptr O_md2
6
+#define O_fword_ptr O_md2
3
/* tbyte ptr X_add_symbol */
/* tbyte ptr X_add_symbol */
-#define O_tbyte_ptr O_md2
5
+#define O_tbyte_ptr O_md2
2
/* xmmword ptr X_add_symbol */
/* xmmword ptr X_add_symbol */
-#define O_xmmword_ptr O_md2
4
+#define O_xmmword_ptr O_md2
1
/* ymmword ptr X_add_symbol */
/* ymmword ptr X_add_symbol */
-#define O_ymmword_ptr O_md23
-/* near ptr X_add_symbol */
-#define O_near_ptr O_md22
-/* far ptr X_add_symbol */
-#define O_far_ptr O_md21
-/* offset X_add_symbol */
-#define O_short O_md20
+#define O_ymmword_ptr O_md20
static struct
{
const char *name;
static struct
{
const char *name;
- operatorT op
erator
;
+ operatorT op;
unsigned int operands;
}
const i386_operators[] =
unsigned int operands;
}
const i386_operators[] =
@@
-91,7
+92,7
@@
const i386_operators[] =
static struct
{
const char *name;
static struct
{
const char *name;
- operatorT op
erator
;
+ operatorT op;
unsigned short sz[3];
}
const i386_types[] =
unsigned short sz[3];
}
const i386_types[] =
@@
-158,7
+159,7
@@
operatorT i386_operator (const char *name, unsigned int operands, char *pc)
if (i386_operators[j].operands
&& i386_operators[j].operands != operands)
return O_illegal;
if (i386_operators[j].operands
&& i386_operators[j].operands != operands)
return O_illegal;
- return i386_operators[j].op
erator
;
+ return i386_operators[j].op;
}
for (j = 0; i386_types[j].name; ++j)
}
for (j = 0; i386_types[j].name; ++j)
@@
-175,7
+176,7
@@
operatorT i386_operator (const char *name, unsigned int operands, char *pc)
*pc = c;
if (intel_syntax > 0 || operands != 1)
return O_illegal;
*pc = c;
if (intel_syntax > 0 || operands != 1)
return O_illegal;
- return i386_types[j].op
erator
;
+ return i386_types[j].op;
}
*input_line_pointer = c;
}
*input_line_pointer = c;
@@
-279,6
+280,7
@@
static int i386_intel_simplify (expressionS *e)
break;
case O_offset:
break;
case O_offset:
+ intel_state.has_offset = 1;
++intel_state.in_offset;
ret = i386_intel_simplify_symbol (e->X_add_symbol);
--intel_state.in_offset;
++intel_state.in_offset;
ret = i386_intel_simplify_symbol (e->X_add_symbol);
--intel_state.in_offset;
@@
-464,17
+466,23
@@
i386_intel_operand (char *operand_string, int got_a_float)
/* Initialize state structure. */
intel_state.op_modifier = O_absent;
intel_state.is_mem = 0;
/* Initialize state structure. */
intel_state.op_modifier = O_absent;
intel_state.is_mem = 0;
+ intel_state.has_offset = 0;
intel_state.base = NULL;
intel_state.index = NULL;
intel_state.seg = NULL;
operand_type_set (&intel_state.reloc_types, ~0);
intel_state.base = NULL;
intel_state.index = NULL;
intel_state.seg = NULL;
operand_type_set (&intel_state.reloc_types, ~0);
- assert (!intel_state.in_offset);
- assert (!intel_state.in_bracket);
- assert (!intel_state.in_scale);
+
gas_
assert (!intel_state.in_offset);
+
gas_
assert (!intel_state.in_bracket);
+
gas_
assert (!intel_state.in_scale);
saved_input_line_pointer = input_line_pointer;
input_line_pointer = buf = xstrdup (operand_string);
saved_input_line_pointer = input_line_pointer;
input_line_pointer = buf = xstrdup (operand_string);
+ /* A '$' followed by an identifier char is an identifier. Otherwise,
+ it's operator '.' followed by an expression. */
+ if (*buf == '$' && !is_identifier_char (buf[1]))
+ *buf = '.';
+
intel_syntax = -1;
memset (&exp, 0, sizeof(exp));
exp_seg = expression (&exp);
intel_syntax = -1;
memset (&exp, 0, sizeof(exp));
exp_seg = expression (&exp);
@@
-492,13
+500,17
@@
i386_intel_operand (char *operand_string, int got_a_float)
as_bad (_("invalid expression"));
ret = 0;
}
as_bad (_("invalid expression"));
ret = 0;
}
+ else if (!intel_state.has_offset
+ && input_line_pointer > buf
+ && *(input_line_pointer - 1) == ']')
+ intel_state.is_mem |= 1;
input_line_pointer = saved_input_line_pointer;
free (buf);
input_line_pointer = saved_input_line_pointer;
free (buf);
- assert (!intel_state.in_offset);
- assert (!intel_state.in_bracket);
- assert (!intel_state.in_scale);
+
gas_
assert (!intel_state.in_offset);
+
gas_
assert (!intel_state.in_bracket);
+
gas_
assert (!intel_state.in_scale);
if (!ret)
return 0;
if (!ret)
return 0;
This page took
0.025872 seconds
and
4
git commands to generate.