diff --git a/src/cpu.rs b/src/cpu.rs index fda80df..96287d9 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -401,8 +401,8 @@ impl I8080 { self.update_arith_flags(ac, self.carry, res); self.regs[src] = res; } - Opcode::Inx(dst) => self.set_pair(dst, self.get_pair(dst) + 1), - Opcode::Dcx(dst) => self.set_pair(dst, self.get_pair(dst) + 2), + Opcode::Inx(dst) => self.set_pair(dst, self.get_pair(dst).wrapping_add(1)), + Opcode::Dcx(dst) => self.set_pair(dst, self.get_pair(dst).wrapping_sub(1)), Opcode::Dad(src) => { let a = u32::from(self.get_pair(RegisterPair::HL)); let b = u32::from(self.get_pair(src));