aboutsummaryrefslogtreecommitdiff
path: root/sim/v850/simops.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-30 04:27:48 +0000
committerJeff Law <law@redhat.com>1996-08-30 04:27:48 +0000
commite9b6cbaca5f9b88ec83e8eb747b3013736873de0 (patch)
treefe25ef30ed9e0f5d83052c5b5c7fd071c4cb485f /sim/v850/simops.c
parent3095b8dfc59db40a8d91247be6428537966bb924 (diff)
downloadgdb-e9b6cbaca5f9b88ec83e8eb747b3013736873de0.zip
gdb-e9b6cbaca5f9b88ec83e8eb747b3013736873de0.tar.gz
gdb-e9b6cbaca5f9b88ec83e8eb747b3013736873de0.tar.bz2
* interp.c (do_format_5): Get operands correctly and
call the target function. (sim_resume): Don't do a PC update for format 5 instructions. * simops.c: Handle "jarl" and "jmp" instructions.
Diffstat (limited to 'sim/v850/simops.c')
-rw-r--r--sim/v850/simops.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 31c56c4..7ac1a44 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -291,11 +291,32 @@ OP_58F ()
State.pc += 2;
}
+/* jmp [reg1] */
void
-OP_660 ()
+OP_60 ()
{
+ /* interp.c will bump this by +2, so correct for it here. */
+ State.pc = State.regs[OP[0]] - 2;
}
+/* jarl disp22, reg */
+void
+OP_780 ()
+{
+ unsigned int op0, opc;
+ int temp;
+
+ temp = OP[0];
+ temp = (temp << 10) >> 10;
+ op0 = temp;
+ opc = State.pc;
+
+ State.pc += temp;
+
+ /* Gross. jarl X,r0 is really jr and doesn't save its result. */
+ if (OP[1] != 0)
+ State.regs[OP[1]] = opc + 4;
+}
/* add reg, reg */
void
@@ -642,21 +663,11 @@ OP_10720 ()
}
void
-OP_780 ()
-{
-}
-
-void
OP_720 ()
{
}
void
-OP_60 ()
-{
-}
-
-void
OP_87C0 ()
{
}
@@ -1094,3 +1105,8 @@ OP_700 ()
{
}
+void
+OP_660 ()
+{
+}
+