Example #1
0
 def __init__(self):
     self.mem = MEMORY(SICXE_SIZE_MEMORY)
     self.devices = Devices(SICXE_SIZE_DEVICES)
     self.registers = reg.registers
     self.cu = CU(self)
Example #2
0
File: alu.py Project: ekareem/SICXE
def compfrm(register: FLOAT, sw: INT, mem: MEMORY, addr, isImmediate=False):
    operand = addr if isImmediate else mem.getfloat(addr)
    cc = SICXE_CC_GT if register > operand else SICXE_CC_LT if register < operand else SICXE_CC_EQ
    sw.setbits(cc, (6, 8), BIG)
Example #3
0
File: alu.py Project: ekareem/SICXE
def addrm(register: INT, mem: MEMORY, addr, isImmediate=False):
    operand = addr if isImmediate else mem.getword(addr, True)
    register.add(operand, setSelf=True)
Example #4
0
File: alu.py Project: ekareem/SICXE
def stch(register: INT, mem: MEMORY, addr):
    mem.setbyte(addr, register.getbits((0, 8), False, LITTLE))
Example #5
0
File: alu.py Project: ekareem/SICXE
def divfrm(register: FLOAT, mem: MEMORY, addr, isImmediate=False):
    operand = addr if isImmediate else mem.getfloat(addr)
    register.truediv(operand, setSelf=True)
Example #6
0
File: alu.py Project: ekareem/SICXE
def stf(register: FLOAT, mem: MEMORY, addr):
    mem.set(addr, register.dec, 6)
Example #7
0
File: alu.py Project: ekareem/SICXE
def st(register: INT, mem: MEMORY, addr):
    mem.setword(addr, register)
Example #8
0
File: alu.py Project: ekareem/SICXE
def ldch(register: INT, mem: MEMORY, addr, isImmediate=False):
    operand = addr if isImmediate else mem.getbyte(addr)
    if operand < 0 or operand > 0xff:
        raise Exception('cannot be longer the a byte')
    register.setbits(operand, (0, 8), LITTLE)
Example #9
0
File: alu.py Project: ekareem/SICXE
def ldf(register: FLOAT, mem: MEMORY, addr, isImmediate=False):
    if isImmediate:
        register.set(addr)
    else:
        register.dec = mem.get(addr, 6)
Example #10
0
File: alu.py Project: ekareem/SICXE
def ld(register: INT, mem: MEMORY, addr, isImmediate=False):
    operand = addr if isImmediate else mem.getword(addr, False)
    register.set(operand)