示例#1
0
文件: ops.py 项目: Gaming32/8bit
def lda_imm(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum = data
示例#2
0
文件: ops.py 项目: Gaming32/8bit
def lda2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum = data
示例#3
0
文件: ops.py 项目: Gaming32/8bit
def ldy_imm(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.regy = data
示例#4
0
文件: ops.py 项目: Gaming32/8bit
def ldy2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.regy = data
示例#5
0
文件: ops.py 项目: Gaming32/8bit
def ldx(comp: Computer):
    ptr = getat_pages(comp)
    data = comp.getat(ptr)
    comp.regx = data
示例#6
0
文件: ops.py 项目: Gaming32/8bit
def getat_pages(comp: Computer, pageswitch: bool = False):
    if pageswitch:
        comp.pc += 2
        return comp.getat(comp.pc - 1) * 256 + comp.getat(comp.pc)
    comp.pc += 1
    return comp.getat(comp.pc)
示例#7
0
文件: ops.py 项目: Gaming32/8bit
def sub2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum -= data
    comp.overflow = comp.accum < 0
    comp.accum %= 256
示例#8
0
文件: ops.py 项目: Gaming32/8bit
def sbi(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum -= data
    comp.overflow = comp.accum < 0
    comp.accum %= 256
示例#9
0
文件: ops.py 项目: Gaming32/8bit
def add2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum += data
    comp.overflow = comp.accum > 255
    comp.accum %= 256
示例#10
0
文件: ops.py 项目: Gaming32/8bit
def adi(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum += data
    comp.overflow = comp.accum > 255
    comp.accum %= 256
示例#11
0
文件: ops.py 项目: Gaming32/8bit
def sti2(comp: Computer):
    ptr = getat_pages(comp, True)
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.setat(ptr, data)