class IA32(Xenostone.GuestArch): class Inst(Xenostone.Inst): def __init__(self, opcode, format, callback=False): self.opcode = opcode self.format = self.decodeFormat(format) self.callback = callback def decodeFormat(self, format): """ This would change things like 'MOV rAX,Ov' into its appropriate C form. """ pass add02 = Inst(0x02, 'ADD Gb,Eb') movA1 = Inst(0xA1, 'MOV rAX,Ov', 'movHandler') # This has a C handler @Intermediary(add02) def add02Handler(dest, src): """ This is the handler for the 0x02 (add) opcode By using dummy variables, we can track what the function does to the operands to the instruction and generate the appropriate intermediary code. """ dest += src