from ctypes import c_uint32 class Instruction: size = 4 # Instruction size in bytes def __init__(self): pass def compile(self): # return the binstream of the instruction in a c_uint32 pass def execute(self): # executes the instruction and returns the next program counter return class InstructionSet: def __init__(self, init=None): self.data = dict() def add_instruction(self, ins): if ins.name not in self.data: self.data[ins.name] = ins if __name__ == "__main__": # TODO This is the interface i'd love to have addins = add("x5","x2","zero") j("labelName")