* [patch, moxie, committed] Add zex instructions to moxie simulator
@ 2014-12-12 13:47 Anthony Green
0 siblings, 0 replies; only message in thread
From: Anthony Green @ 2014-12-12 13:47 UTC (permalink / raw)
To: gdb-patches
I've committed the following small patch to add support for the zex
instructions to the moxie simulator. GCC and binutils already support
these instructions.
Thanks,
AG
in sim/moxie...
2014-12-12 Anthony Green <green@moxielogic.com>
* interp.c (sim_resume): Add zex instructions.
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index 4362c66..fdb6528 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -604,8 +604,24 @@ sim_resume (sd, step, siggnal)
cpu.asregs.regs[a] = (int) bv;
}
break;
- case 0x12: /* bad */
- case 0x13: /* bad */
+ case 0x12: /* zex.b */
+ {
+ int a = (inst >> 4) & 0xf;
+ int b = inst & 0xf;
+ signed char bv = cpu.asregs.regs[b];
+ TRACE("zex.b");
+ cpu.asregs.regs[a] = (int) bv & 0xff;
+ }
+ break;
+ case 0x13: /* zex.s */
+ {
+ int a = (inst >> 4) & 0xf;
+ int b = inst & 0xf;
+ signed short bv = cpu.asregs.regs[b];
+ TRACE("zex.s");
+ cpu.asregs.regs[a] = (int) bv & 0xffff;
+ }
+ break;
case 0x14: /* bad */
case 0x15: /* bad */
case 0x16: /* bad */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-12 13:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-12 13:47 [patch, moxie, committed] Add zex instructions to moxie simulator Anthony Green
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).