@@ -0,0 +1,1779 @@
+class Register(object):%0A    def __init__(self, name, bitwidth):%0A        self.name = name%0A        self.value = 0%0A        self.past = %5B0%5D # maybe for rewind?%0A        self.symbVal = %5Bz3.BitVec(self.name, bitwidth)%5D # maybe for %0A                                                        # symbolic%0A                                                        # execution?%0A    def GetValue(self):%0A        return self.value%0A    %0A    def SetValue(self, value):%0A        self.value = value%0A%0A    def GetCurrentSymb(self):%0A        return self.symbVal%5B-1%5D%0A%0A    def GetInitialSymb(self):%0A        return self.symbVal%5B0%5D%0A%0A    def SetInitialSymb(self, value):%0A        self.symbVal%5B0%5D = value%0A%0A%0Aclass CPU(object):%0A    def __init__(self, bitwidth, baseAddress):%0A        self.regs = %7B  'A': Register('A', bitwidth),%0A                       'X': Register('X', bitwidth),%0A                       'Y': Register('Y', bitwidth),%0A                       'PC': Register('PC', bitwidth * 2),%0A                       'S': Register('S', bitwidth),%0A                       'P': Register('P', bitwidth)%7D%0A%0A        self.bitwidth = bitwidth%0A        self.ptrSize = 2 # 2 bytes for PC%0A        self.memory = %5B%5D%0A        self.pastMemory = %5B%5D%0A        self.symbMemory = z3Array('mem', z3.BitVecSort(bitwidth), z3.BitVecSort(8))%0A%0A        if (baseAddress):%0A            self.regs%5B'PC'%5D.SetValue(baseAddress)%0A%0A        def ReadMemory(self, address): # always read 1 byte%0A            return self.memory%5Baddress%5D%0A%0A        def SetMemory(self, address, value): # always write 1 byte%0A            self.memory%5Baddress%5D = value%0A            return value%0A%0A        def GetRegister(name):%0A            return self.regs%5Bname%5D.GetValue()%0A%0A        def SetRegister(self, name, value):%0A            self.regs%5Bname%5D.SetValue(value)%0A            return value%0A

Add register and CPU stuff