diff --git a/src/inst.rs b/src/inst.rs index 0dd5e6bbdde81a1f40c09e71dc258130e458e05d..8ff0b3035f123953ffd8a4e0839caabe9f2e3efc 100644 --- a/src/inst.rs +++ b/src/inst.rs @@ -209,7 +209,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ (ret_nz, 8, "RET NZ"), (pop_bc, 12, "POP BC"), (noimpl, 4, "! UNIMP !"), - (noimpl, 4, "! UNIMP !"), + (jp_u16, 16, "JP u16"), (noimpl, 4, "! UNIMP !"), (push_bc, 16, "PUSH BC"), (noimpl, 4, "! UNIMP !"), @@ -770,6 +770,11 @@ fn pop_bc(cpu: &mut Cpu) { cpu.set_bc(word); } +fn jp_u16(cpu: &mut Cpu) { + let word = cpu.read_u16(); + cpu.pc = word; +} + fn push_bc(cpu: &mut Cpu) { cpu.push_word(cpu.bc()); }