2003-01-02 Chris Demetriou <cgd@broadcom.com>
authorChris Demetriou <cgd@google.com>
Thu, 2 Jan 2003 22:04:55 +0000 (22:04 +0000)
committerChris Demetriou <cgd@google.com>
Thu, 2 Jan 2003 22:04:55 +0000 (22:04 +0000)
        * mips-dis.c (print_insn_args): Use position extracted by "+A"
        to calculate size for "+B".  Redo code for "+C" so it shares
        the same style as "+A" and "+B" now do.

opcodes/ChangeLog
opcodes/mips-dis.c

index 342eb91e43b5aff8a84dde343e8c0f8201d3a0be..18a16d36fc1461c4bf81081150b19a7388058ba0 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-02  Chris Demetriou  <cgd@broadcom.com>
+
+       * mips-dis.c (print_insn_args): Use position extracted by "+A"
+       to calculate size for "+B".  Redo code for "+C" so it shares
+       the same style as "+A" and "+B" now do.
+
 2003-01-02  Chris Demetriou  <cgd@broadcom.com>
 
        * mips-dis.c: Update copyright years.
index cbf87ce8cccc22bc81f7f1d94b27ba59176b15f9..176ffeb46944f2c7846a9ca6bc4c1810ec3da431 100644 (file)
@@ -672,6 +672,9 @@ print_insn_args (d, l, pc, info)
      struct disassemble_info *info;
 {
   int op, delta;
+  unsigned int lsb, msb, msbd;
+
+  lsb = 0;
 
   for (; *d != '\0'; d++)
     {
@@ -697,21 +700,18 @@ print_insn_args (d, l, pc, info)
              return;
 
            case 'A':
-             (*info->fprintf_func) (info->stream, "0x%x",
-                                    (l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
+             lsb = (l >> OP_SH_SHAMT) & OP_MASK_SHAMT;
+             (*info->fprintf_func) (info->stream, "0x%x", lsb);
              break;
        
            case 'B':
-             (*info->fprintf_func) (info->stream, "0x%x",
-                                    (((l >> OP_SH_INSMSB) & OP_MASK_INSMSB)
-                                     - ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT)
-                                     + 1));
+             msb = (l >> OP_SH_INSMSB) & OP_MASK_INSMSB;
+             (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1);
              break;
 
            case 'C':
-             (*info->fprintf_func) (info->stream, "0x%x",
-                                    (((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD)
-                                     + 1));
+             msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD;
+             (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
              break;
 
            case 'D':