diff options
author | Ian Lance Taylor <ian@airs.com> | 1998-06-09 16:21:35 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1998-06-09 16:21:35 +0000 |
commit | 284f02bba855e37809d001b2ce4c98fce0a8eec0 (patch) | |
tree | 9237941ccd1b4ef11bb74a1ce5c2e1f1ef4c2f57 /gas/config/tc-i386.c | |
parent | b8e4d255f32facce1fad058ed42ff04993706a32 (diff) | |
download | gdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.zip gdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.tar.gz gdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.tar.bz2 |
Tue Jun 9 12:20:05 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
* config/tc-i386.h: Change Data16 to Size16, Data32 to Size32,
IgnoreDataSize to IgnoreSize as they are used for address size as
well as data size.
* config/tc-i386.c: Likewise. Add code to reject addr32/data32 in
32-bit mode, similarly addr16/data16 and variants.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index ea2a984..8a41231 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -934,8 +934,18 @@ md_assemble (line) if (*l != END_OF_INSN && current_templates - && (current_templates->start->opcode_modifier & IsPrefix) != 0) + && (current_templates->start->opcode_modifier & IsPrefix)) { + /* If we are in 16-bit mode, do not allow addr16 or data16. + Similarly, in 32-bit mode, do not allow addr32 or data32. */ + if ((current_templates->start->opcode_modifier & (Size16 | Size32)) + && (((current_templates->start->opcode_modifier & Size32) != 0) + ^ flag_16bit_code)) + { + as_bad (_("redundant %s prefix"), + current_templates->start->name); + return; + } /* Add prefix, checking for repeated prefixes. */ switch (add_prefix (current_templates->start->base_opcode)) { @@ -1246,9 +1256,9 @@ md_assemble (line) /* If matched instruction specifies an explicit opcode suffix, use it. */ - if (i.tm.opcode_modifier & (Data16|Data32)) + if (i.tm.opcode_modifier & (Size16 | Size32)) { - if (i.tm.opcode_modifier & Data16) + if (i.tm.opcode_modifier & Size16) i.suffix = WORD_OPCODE_SUFFIX; else i.suffix = DWORD_OPCODE_SUFFIX; @@ -1453,7 +1463,7 @@ md_assemble (line) prefix anyway. */ if ((i.suffix == DWORD_OPCODE_SUFFIX || i.suffix == LONG_OPCODE_SUFFIX) == flag_16bit_code - && !(i.tm.opcode_modifier & IgnoreDataSize)) + && !(i.tm.opcode_modifier & IgnoreSize)) { unsigned int prefix = DATA_PREFIX_OPCODE; if (i.tm.opcode_modifier & JumpByte) /* jcxz, loop */ |