diff --git a/src/inst.rs b/src/inst.rs index e8bfa1012ddc4fcd69428769051fdd76b4451396..eff4bf48c860c5e414acac65b72ad046ced4c017 100644 --- a/src/inst.rs +++ b/src/inst.rs @@ -232,7 +232,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ (sub_a_u8, 8, "SUB A, u8"), (noimpl, 4, "! UNIMP !"), (noimpl, 4, "! UNIMP !"), - (noimpl, 4, "! UNIMP !"), + (reti, 16, "RETI"), (jp_c_u16, 12, "JP C, u16"), (noimpl, 4, "! UNIMP !"), (call_c_u16, 12, "CALL C, u16"), @@ -1212,6 +1212,11 @@ fn sub_a_u8(cpu: &mut Cpu) { cpu.a = sub_set_flags(cpu, cpu.a, byte); } +fn reti(cpu: &mut Cpu) { + cpu.pc = cpu.pop_word(); + cpu.enable_int(); +} + fn jp_c_u16(cpu: &mut Cpu) { let word = cpu.read_u16();