def test_subtraction_overflow_flag_2(self): res = util.subtract8_check_overflow(util.make_8bit_twos_comp(-10), util.make_8bit_twos_comp(10), self.registers) self.assertEqual(util.get_8bit_twos_comp(res), -20) self.assertFalse(self.registers.condition.PV) self.assertTrue(self.registers.condition.S)
def test_subtraction_overflow_flag_5(self): res = util.subtract8_check_overflow(util.make_8bit_twos_comp(100), util.make_8bit_twos_comp(-100), self.registers) self.assertTrue(self.registers.condition.PV)
def test_subtraction_overflow_flag_3(self): res = util.subtract8_check_overflow(util.make_8bit_twos_comp(-10), util.make_8bit_twos_comp(-10), self.registers) self.assertEqual(util.get_8bit_twos_comp(res), 0) self.assertFalse(self.registers.condition.PV)