summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/mc68hc11/hc11ops.c
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 /src/emu/cpu/mc68hc11/hc11ops.c
parent70e0a1694289243539e3edfa719014538de11be3 (diff)
MC68HC11: Implemented SUBD DIR & SUBD EXT opcodes [Angelo Salese]
Diffstat (limited to 'src/emu/cpu/mc68hc11/hc11ops.c')
-rw-r--r--src/emu/cpu/mc68hc11/hc11ops.c30
1 files changed, 30 insertions, 0 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)
{