* config/tc-i386.c (md_assemble): In JumpByte case, when looking
authorIan Lance Taylor <ian@airs.com>
Tue, 26 Aug 1997 16:25:03 +0000 (16:25 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 26 Aug 1997 16:25:03 +0000 (16:25 +0000)
for a WORD_PREFIX_OPCODE, change it to ADDR_PREFIX_OPCODE if this
is jcxz.

gas/ChangeLog
gas/config/tc-i386.c

index b36bdde..7c0c9de 100644 (file)
@@ -1,11 +1,17 @@
+Tue Aug 26 12:23:25 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * config/tc-i386.c (md_assemble): In JumpByte case, when looking
+       for a WORD_PREFIX_OPCODE, change it to ADDR_PREFIX_OPCODE if this
+       is jcxz.
+
 start-sanitize-v850
 Mon Aug 25 16:04:14 1997  Nick Clifton  <nickc@cygnus.com>
 
        * config/tc-v850.c (pre_defined_registers): Add 'hp' as alias for
        r2.
        (md_begin): Set up machine architecture and type.
-end-sanitize-v850
 
+end-sanitize-v850
 Mon Aug 25 14:25:48 1997  Ian Lance Taylor  <ian@cygnus.com>
 
        * symbols.c (resolve_symbol_value): Store the value back into the
index db88f6c..20a4f4e 100644 (file)
@@ -433,7 +433,7 @@ const pseudo_typeS md_pseudo_table[] =
 #ifndef I386COFF
   {"bss", s_bss, 0},
 #endif
-#ifndef OBJ_AOUT
+#if !defined(OBJ_AOUT) && !defined(USE_ALIGN_PTWO)
   {"align", s_align_bytes, 0},
 #else
   {"align", s_align_ptwo, 0},
@@ -1728,7 +1728,23 @@ md_assemble (line)
          {
            if (*q == WORD_PREFIX_OPCODE)
              {
-               FRAG_APPEND_1_CHAR (WORD_PREFIX_OPCODE);
+               /* The jcxz/jecxz instructions are marked with Data16
+                  and Data32, which means that they may get
+                  WORD_PREFIX_OPCODE added to the list of prefixes.
+                  However, the are correctly distinguished using
+                  ADDR_PREFIX_OPCODE.  Here we look for
+                  WORD_PREFIX_OPCODE, and actually emit
+                  ADDR_PREFIX_OPCODE.  This is a hack, but, then, so
+                  is the instruction itself.
+
+                  I don't know if there is any valid case in which we
+                  want to emit WORD_PREFIX_OPCODE, but I am keeping
+                  the old behaviour for safety.  */
+
+               if (IS_JUMP_ON_CX_ZERO (t->base_opcode))
+                 FRAG_APPEND_1_CHAR (ADDR_PREFIX_OPCODE);
+               else
+                 FRAG_APPEND_1_CHAR (WORD_PREFIX_OPCODE);
                insn_size += 1;
                break;
              }