Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)
Esempio n. 7
0
    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])
Esempio n. 8
0
    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])