/* m32c.opc --- semantics for m32c opcodes. -*- mode: c -*-
-Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2005-2020 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
#define tprintf if (trace) printf
static unsigned char
-getbyte ()
+getbyte (void)
{
int tsave = trace;
unsigned char b;
/* Indicate which sorts of prefixes are allowed for the current
opcode. */
-void
-prefix (src_allowed, dest_allowed, index_bytewidth)
+static void
+prefix (int src_allowed, int dest_allowed, int index_bytewidth)
{
/* At the moment, we don't do anything with this information. We
just wanted to get the information entered in some
mb = sign_ext (s, dc.bytes * 8); \
v = ma op mb op c; \
tprintf("%d " #op " %d " #op " %d = %d\n", ma, mb, c, v); \
- set_oszc (v, dc.bytes, ll > ((1 op 1) ? b2mask[dc.bytes] : 0)); \
+ set_oszc (v, dc.bytes, (1 op 1) ? (ll > b2mask[dc.bytes]) : (ll >= 0)); \
put_dest (dc, v); \
}
static int ipcs = 0;
int
-decode_m32c()
+decode_m32c (void)
{
unsigned char op[40];
int opi;
prefix (0, 0, 0);
sc = decode_src23 (sss, ss, 1);
- BIT_OPC (sc, bit, !b & carry);
+ BIT_OPC (sc, bit, (!b) & carry);
/** 0000 0001 1101 sss0 ss11 0bit BNOR src */
prefix (0, 0, 0);
sc = decode_src23 (sss, ss, 1);
- BIT_OPC (sc, bit, !b | carry);
+ BIT_OPC (sc, bit, (!b) | carry);
/** 1101 ddd0 dd01 1bit BNOT dest */
/* We report the break to our caller with the PC still pointing at the
breakpoint instruction. */
put_reg (pc, m32c_opcode_pc);
- if (verbose || 1)
+ if (verbose)
printf("[break]\n");
if (in_gdb || (regs.r_intbl == 0 && regs.r_intbh == 0))
return M32C_MAKE_HIT_BREAK ();
/* We report the break to our caller with the PC still pointing at the
breakpoint instruction. */
put_reg (pc, m32c_opcode_pc);
- if (verbose || 1)
+ if (verbose)
printf("[gdb break]\n");
return M32C_MAKE_HIT_BREAK ();