Exemplo n.º 1
0
def ind(cpu, arg1, arg2):
    int addrLSB = arg1 + (arg2 << 8)
    int addrMSB = ((arg1 + 1) & 0xFF) + (arg2 << 8)
    cpu.PC += 3
    return memory.read(addrLSB) + (memory.read(addrMSB) << 8)
Exemplo n.º 2
0
def abx(cpu, arg1, arg2):
    return memory.read(ABX(cpu,arg1,arg2))
Exemplo n.º 3
0
def aby(cpu, arg1, arg2):
    return memory.read(ABY(cpu,arg1,arg2))
Exemplo n.º 4
0
def zpy(cpu, arg1, arg2):
    return memory.read(ZPY(cpu,arg1,arg2))
Exemplo n.º 5
0
def abt(cpu, arg1, arg2):
    return memory.read(ABS(cpu,arg1,arg2))
Exemplo n.º 6
0
def INY(cpu, arg1, arg2):
    indirectAddress = memory.read(arg1) + (memory.read((arg1 + 1) & 0xFF) << 8)
    cpu.cycles += pageBoundaryCycles(indirectAddress, cpu.Y)
    cpu.PC += 2
    return (indirectAddress + cpu.Y) & 0xFFFF
Exemplo n.º 7
0
def RLA(cpu, value):
    ROL(cpu, value)
    AND(cpu, memory.read(value))
Exemplo n.º 8
0
def BRK(cpu, value):
    vector = memory.read(VECTOR_BRK) + memory.read(VECTOR_BRK+1)<<8
    processInterrupt(cpu,vector)
Exemplo n.º 9
0
def condRead(cpu, addr):
    if addr is -1:
        return cpu.A
    return memory.read(addr)
Exemplo n.º 10
0
def DCP(cpu, value):
    modMemory(cpu, value, -1)
    compareWithRegister(cpu, memory.read(value), cpu.A)
Exemplo n.º 11
0
def ISB(cpu, value):
    INC(cpu, value)
    SBC(cpu, memory.read(value))
Exemplo n.º 12
0
def modMemory(cpu, address, dVal):
    value = memory.read(address)
    value += dVal
    memory.write(address, value)
    cpu.setNZ(value)
Exemplo n.º 13
0
def popFromStack(cpu):
    cpu.S += 1
    return memory.read(0x100 | (cpu.S & 0xFF))
Exemplo n.º 14
0
def SRE(cpu, value):
    LSR(cpu, value)
    EOR(cpu, memory.read(value))
Exemplo n.º 15
0
def INX(cpu, arg1, arg2):
    zpAddr = (arg1 + cpu.X) & 0xFF
    indirectAddress = memory.read(zpAddress) + (memory.read((zpAddress + 1) & 0xFF) << 8)
    cpu.PC += 2
    return indirectAddress
Exemplo n.º 16
0
def zp(cpu, arg1, arg2):
    return memory.read(arg1)
Exemplo n.º 17
0
def inx(cpu, arg1, arg2):
    return memory.read(INX(cpu,arg1,arg2))
Exemplo n.º 18
0
def zpx(cpu, arg1, arg2):
    return memory.read(ZPX(cpu,arg1,arg2))
Exemplo n.º 19
0
def iny(cpu, arg1, arg2):
    return memory.read(INY(cpu,arg1,arg2))
Exemplo n.º 20
0
def SLO(cpu, value):
    ASL(cpu, value)
    ORA(cpu, memory.read(value))