/* Instruction printing code for the OpenRISC 1000
- Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2007, 2012 Free Software Foundation, Inc.
Contributed by Damjan Lampret <lampret@opencores.org>.
Modified from a29k port.
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
+#ifndef DEBUG
#define DEBUG 0
+#endif
+#include "sysdep.h"
#include "dis-asm.h"
#include "opcode/or32.h"
#include "safe-ctype.h"
-#include <string.h>
-#include <stdlib.h>
#define EXTEND29(x) ((x) & (unsigned long) 0x10000000 ? ((x) | (unsigned long) 0xf0000000) : ((x)))
((unsigned long) insn_ch[2] << 8) +
((unsigned long) insn_ch[3]);
#if DEBUG
- printf ("find_bytes_big3: %x\n", *insn);
+ printf ("find_bytes_big3: %lx\n", *insn);
#endif
}
{
unsigned long tmp = strtoul (enc, NULL, 16);
#if DEBUG
- printf (" enc=%s, tmp=%x ", enc, tmp);
+ printf (" enc=%s, tmp=%lx ", enc, tmp);
#endif
if (param_ch == '0')
tmp = 15 - tmp;
opc_pos--;
param_pos--;
#if DEBUG
- printf ("\n ret=%x opc_pos=%x, param_pos=%x\n", ret, opc_pos, param_pos);
+ printf ("\n ret=%lx opc_pos=%x, param_pos=%x\n", ret, opc_pos, param_pos);
#endif
ret += ((insn >> opc_pos) & 0x1) << param_pos;
&& ret >> (letter_range (param_ch) - 1))
{
#if DEBUG
- printf ("\n ret=%x opc_pos=%x, param_pos=%x\n",
+ printf ("\n ret=%lx opc_pos=%x, param_pos=%x\n",
ret, opc_pos, param_pos);
#endif
ret |= 0xffffffff << letter_range(param_ch);
#if DEBUG
- printf ("\n after conversion to signed: ret=%x\n", ret);
+ printf ("\n after conversion to signed: ret=%lx\n", ret);
#endif
}
enc++;
enc++;
#if DEBUG
- printf ("ret=%x\n", ret);
+ printf ("ret=%lx\n", ret);
#endif
return ret;
}
zeros = or32_extract ('0', encoding, insn);
#if DEBUG
- printf ("ones: %x \n", ones);
- printf ("zeros: %x \n", zeros);
+ printf ("ones: %lx \n", ones);
+ printf ("zeros: %lx \n", zeros);
#endif
if ((insn & ones) != ones)
{
int regnum = or32_extract (param_ch, encoding, insn);
#if DEBUG
- printf ("or32_print_register: %c, %s, %x\n", param_ch, encoding, insn);
+ printf ("or32_print_register: %c, %s, %lx\n", param_ch, encoding, insn);
#endif
if (param_ch == 'A')
(*info->fprintf_func) (info->stream, "r%d", regnum);