* v850-dis.c (disassemble): Always print a closing square brace if
authorNick Clifton <nickc@redhat.com>
Wed, 13 Apr 2011 13:20:24 +0000 (13:20 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 13 Apr 2011 13:20:24 +0000 (13:20 +0000)
an opening square brace was printed.

gas/testsuite/ChangeLog
gas/testsuite/gas/v850/v850e1.d
gas/testsuite/gas/v850/v850e1.s
opcodes/ChangeLog
opcodes/v850-dis.c

index 3f9b878958caab96d73c81a13a1287ce1962ac6c..16abb0043d4753ee6ea2d46117ac36472d3cec19 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-13  Nick Clifton  <nickc@redhat.com>
+
+       * gas/v850/v850e1.s: Add a insn using reg+offset addressing.
+       * gas/v850/v850e1.d: Add expected disassembly.
+
 2011-04-12  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/12534
index 8172b09747eb0147604ef894fd033b5b4ca280f5..9ba03eab7bfd4efb0c5df047f6884f323f94058d 100644 (file)
@@ -42,3 +42,4 @@ Disassembly of section .text:
 0x0+76 ff 07 e6 00 [   ]*tst1  r0, lp
 0x0+7a 83 00  [        ]*zxb   sp
 0x0+7c c4 00  [        ]*zxh   gp
+0x0+7e 63 ff 9d 00[    ]*st.w  lp, 156\[sp\]
index 5013261c0b716d6a4a278623c2d2c83aa8b9917a..2e6d640a242611834638dc91afc9c170a1092c0b 100644 (file)
@@ -36,3 +36,4 @@
        tst1    r0, [r31]
        zxb     r3
        zxh     r4
+       st.w    lp, 156[sp]
index 37151f90af2e72c952cfdd77c5534d59fcd41285..ad8570622c0633bfd0c134068a247378f08dd6ed 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-13  Nick Clifton  <nickc@redhat.com>
+
+       * v850-dis.c (disassemble): Always print a closing square brace if
+       an opening square brace was printed.
+
 2011-04-12  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/12534
index c3624b21f4be92934709788980aab351220c5cd7..cf0d3860d3688bc4ab6777501689bc0c5c078150 100644 (file)
@@ -283,6 +283,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
               *opindex_ptr != 0;
               opindex_ptr++, opnum++)
            {
+             bfd_boolean square = FALSE;
              long value;
              int flag;
              char *prefix;
@@ -323,11 +324,17 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
                }
 
              if (opnum == 1 && opnum == memop)
-               info->fprintf_func (info->stream, "%s[", prefix);
+               {
+                 info->fprintf_func (info->stream, "%s[", prefix);
+                 square = TRUE;
+               }
              else if (opnum > 1
                       && (v850_operands[*(opindex_ptr - 1)].flags & V850_OPERAND_DISP) != 0
                       && opnum == memop)
-               info->fprintf_func (info->stream, "%s[", prefix);
+               {
+                 info->fprintf_func (info->stream, "%s[", prefix);
+                 square = TRUE;
+               }
              else if (opnum > 1)
                info->fprintf_func (info->stream, ", %s", prefix);
 
@@ -431,7 +438,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
                  break;
                }
 
-             if (opnum == 2 && opnum == memop)
+             if (square)
                (*info->fprintf_func) (info->stream, "]");
            }