Beispiel #1
0
def lda_imm(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum = data
Beispiel #2
0
def lda2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum = data
Beispiel #3
0
def ldy_imm(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.regy = data
Beispiel #4
0
def ldy2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.regy = data
Beispiel #5
0
def ldx(comp: Computer):
    ptr = getat_pages(comp)
    data = comp.getat(ptr)
    comp.regx = data
Beispiel #6
0
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)
Beispiel #7
0
def sub2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum -= data
    comp.overflow = comp.accum < 0
    comp.accum %= 256
Beispiel #8
0
def sbi(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum -= data
    comp.overflow = comp.accum < 0
    comp.accum %= 256
Beispiel #9
0
def add2(comp: Computer):
    ptr = getat_pages(comp, True)
    data = comp.getat(ptr)
    comp.accum += data
    comp.overflow = comp.accum > 255
    comp.accum %= 256
Beispiel #10
0
def adi(comp: Computer):
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.accum += data
    comp.overflow = comp.accum > 255
    comp.accum %= 256
Beispiel #11
0
def sti2(comp: Computer):
    ptr = getat_pages(comp, True)
    comp.pc += 1
    data = comp.getat(comp.pc)
    comp.setat(ptr, data)