From 7d063384af231365d6f623f89f09f1af909478f8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 13 Apr 2011 13:20:24 +0000 Subject: [PATCH] * v850-dis.c (disassemble): Always print a closing square brace if an opening square brace was printed. --- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/v850/v850e1.d | 1 + gas/testsuite/gas/v850/v850e1.s | 1 + opcodes/ChangeLog | 5 +++++ opcodes/v850-dis.c | 13 ++++++++++--- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 3f9b878958c..16abb0043d4 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-13 Nick Clifton + + * gas/v850/v850e1.s: Add a insn using reg+offset addressing. + * gas/v850/v850e1.d: Add expected disassembly. + 2011-04-12 Nick Clifton PR binutils/12534 diff --git a/gas/testsuite/gas/v850/v850e1.d b/gas/testsuite/gas/v850/v850e1.d index 8172b09747e..9ba03eab7bf 100644 --- a/gas/testsuite/gas/v850/v850e1.d +++ b/gas/testsuite/gas/v850/v850e1.d @@ -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\] diff --git a/gas/testsuite/gas/v850/v850e1.s b/gas/testsuite/gas/v850/v850e1.s index 5013261c0b7..2e6d640a242 100644 --- a/gas/testsuite/gas/v850/v850e1.s +++ b/gas/testsuite/gas/v850/v850e1.s @@ -36,3 +36,4 @@ tst1 r0, [r31] zxb r3 zxh r4 + st.w lp, 156[sp] diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 37151f90af2..ad8570622c0 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2011-04-13 Nick Clifton + + * v850-dis.c (disassemble): Always print a closing square brace if + an opening square brace was printed. + 2011-04-12 Nick Clifton PR binutils/12534 diff --git a/opcodes/v850-dis.c b/opcodes/v850-dis.c index c3624b21f4b..cf0d3860d36 100644 --- a/opcodes/v850-dis.c +++ b/opcodes/v850-dis.c @@ -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, "]"); } -- 2.30.2