def test_ex_af_afprim_exchanges_correctly(self): cpu = CPU(ROM(b'\x08')) cpu.AF = 0x11 cpu.AFPrim = 0x22 cpu.readOp() self.assertEqual(0x22, cpu.AF) self.assertEqual(0x11, cpu.AFPrim)
def test_ex_af_afprim_exchanges_correctly(self): cpu = CPU(ROM('\x08')) cpu.AF = 0x11 cpu.AFPrim = 0x22 cpu.readOp() self.assertEqual(0x22, cpu.AF) self.assertEqual(0x11, cpu.AFPrim)
def test_push_takes_11_t_states(self): ram = RAM() cpu = CPU(ROM('\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(11, cpu.t_states)
def test_push_takes_3_m_cycles(self): ram = RAM() cpu = CPU(ROM('\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(3, cpu.m_cycles)
def test_push_takes_11_t_states(self): ram = RAM() cpu = CPU(ROM(b'\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(11, cpu.t_states)
def test_push_takes_3_m_cycles(self): ram = RAM() cpu = CPU(ROM(b'\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(3, cpu.m_cycles)
def test_push_correctly_stores_af_on_stack(self): ram = RAM() cpu = CPU(ROM('\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(0x22, ram[0x1006]) self.assertEqual(0x33, ram[0x1005])
def test_push_correctly_stores_af_on_stack(self): ram = RAM() cpu = CPU(ROM(b'\xF5'), ram) cpu.AF = 0x2233 cpu.SP = 0x1007 cpu.readOp() self.assertEqual(0x22, ram[0x1006]) self.assertEqual(0x33, ram[0x1005])