/* Disassemble V850 instructions.
- Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2007, 2010
- Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2007, 2010,
+ 2012 Free Software Foundation, Inc.
This file is part of the GNU opcodes library.
MA 02110-1301, USA. */
-#include <stdio.h>
-
#include "sysdep.h"
+#include <stdio.h>
#include "opcode/v850.h"
#include "dis-asm.h"
#include "opintl.h"
*opindex_ptr != 0;
opindex_ptr++, opnum++)
{
+ bfd_boolean square = FALSE;
long value;
int flag;
char *prefix;
}
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);
else
shown_one = 1;
- info->fprintf_func (info->stream, v850_reg_names[first]);
+ info->fprintf_func (info->stream, "%s", v850_reg_names[first]);
for (bit++; bit < 32; bit++)
if ((mask & (1 << bit)) == 0)
break;
}
- if (opnum == 2 && opnum == memop)
+ if (square)
(*info->fprintf_func) (info->stream, "]");
}