Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
def ld_ic_a(): # LD (C), A
    cpu.add_ticks(8)
    memory.write(0xFF00 + cpu.registers.C, cpu.registers.A)
Exemplo n.º 5
0
Arquivo: cpu.py Projeto: Osmose/snoboy
 def set(self, value):
     memory.write(reg.fget(None), value)