def test_iHL(): cpu.registers.HL = 0xC000 memory.write(0xC000,0x54) eq_(cpu.registers.iHL, 0x54) cpu.registers.iHL = 0x32 eq_(memory.read(0xC000), 0x32)
def test_jmp(): # write address 0xC005 memory.write(0xC000, 0x05) memory.write(0xC001, 0xC0) eq_(memory.read(0xC000), 0x05) eq_(memory.read(0xC001), 0xC0) cpu.registers.PC = 0xC000 instructions.jp_a16() eq_(cpu.registers.PC, 0xC005)
def ldh_n_a(): cpu.add_ticks(12) n = memory.read(cpu.registers.PC) cpu.registers.PC += 1 memory.write(0xFF00+n, cpu.registers.A)
def ld_ic_a(): # LD (C), A cpu.add_ticks(8) memory.write(0xFF00 + cpu.registers.C, cpu.registers.A)
def set(self, value): memory.write(reg.fget(None), value)