summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2010-03-24 13:27:07 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2010-03-24 13:27:07 +0000
commit905c826a97c2f88ff78da4f08656066518649e43 (patch)
tree0597e8c7336cf034a5ba470faf3ca16492e96d27
parent70e0a1694289243539e3edfa719014538de11be3 (diff)
MC68HC11: Implemented SUBD DIR & SUBD EXT opcodes [Angelo Salese]
-rw-r--r--src/emu/cpu/mc68hc11/hc11ops.c30
-rw-r--r--src/emu/cpu/mc68hc11/hc11ops.h4
2 files changed, 32 insertions, 2 deletions
diff --git a/src/emu/cpu/mc68hc11/hc11ops.c b/src/emu/cpu/mc68hc11/hc11ops.c
index ac4a83ac226..da0f9672696 100644
--- a/src/emu/cpu/mc68hc11/hc11ops.c
+++ b/src/emu/cpu/mc68hc11/hc11ops.c
@@ -3229,6 +3229,36 @@ static void HC11OP(subd_imm)(hc11_state *cpustate)
CYCLES(cpustate, 4);
}
+/* SUBD DIR 0x93 */
+static void HC11OP(subd_dir)(hc11_state *cpustate)
+{
+ UINT8 d = FETCH(cpustate);
+ UINT16 i = READ16(cpustate, d);
+ UINT32 r = REG_D - i;
+ CLEAR_NZVC(cpustate);
+ SET_N16(r);
+ SET_Z16(r);
+ SET_V_SUB16(r, i, REG_D);
+ SET_C16(r);
+ REG_D = (UINT16)r;
+ CYCLES(cpustate, 5);
+}
+
+/* SUBD EXT 0xB3 */
+static void HC11OP(subd_ext)(hc11_state *cpustate)
+{
+ UINT16 addr = FETCH16(cpustate);
+ UINT16 i = READ16(cpustate, addr);
+ UINT32 r = REG_D - i;
+ CLEAR_NZVC(cpustate);
+ SET_N16(r);
+ SET_Z16(r);
+ SET_V_SUB16(r, i, REG_D);
+ SET_C16(r);
+ REG_D = (UINT16)r;
+ CYCLES(cpustate, 6);
+}
+
/* SUBD INDX 0xA3 */
static void HC11OP(subd_indx)(hc11_state *cpustate)
{
diff --git a/src/emu/cpu/mc68hc11/hc11ops.h b/src/emu/cpu/mc68hc11/hc11ops.h
index f3c9a18e49b..9e2a2f0044e 100644
--- a/src/emu/cpu/mc68hc11/hc11ops.h
+++ b/src/emu/cpu/mc68hc11/hc11ops.h
@@ -295,8 +295,8 @@ static const hc11_opcode_list_struct hc11_opcode_list[] =
{ 0, 0xe0, HC11OP(subb_indx) },
{ 0x18, 0xe0, HC11OP(subb_indy) },
{ 0, 0x83, HC11OP(subd_imm) },
-// { 0, 0x93, HC11OP(subd_dir) },
-// { 0, 0xb3, HC11OP(subd_ext) },
+ { 0, 0x93, HC11OP(subd_dir) },
+ { 0, 0xb3, HC11OP(subd_ext) },
{ 0, 0xa3, HC11OP(subd_indx) },
{ 0x18, 0xa3, HC11OP(subd_indy) },
{ 0, 0x3f, HC11OP(swi) },