From 2711beb238ea5c178a7e346818937740041e0db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Sat, 2 Jul 2022 23:38:37 +0100 Subject: [PATCH] feat: one more instruction --- src/inst.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/inst.rs b/src/inst.rs index 11592281..e5229b81 100644 --- a/src/inst.rs +++ b/src/inst.rs @@ -228,7 +228,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ (noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"), - (noimpl, 4, "! UNIMP !"), + (push_de, 16, "PUSH DE"), (sub_a_u8, 8, "SUB A, u8"), (noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"), @@ -936,6 +936,10 @@ fn rst_08h(cpu: &mut Cpu) { rst(cpu, 0x0008); } +fn push_de(cpu: &mut Cpu) { + cpu.push_word(cpu.de()); +} + fn sub_a_u8(cpu: &mut Cpu) { let byte = cpu.read_u8(); cpu.a = sub_set_flags(cpu, cpu.a, byte); -- GitLab