if addr < 0 or addr > (1 << 16): print "Address out of range. Valid addresses must be within 0..", hex(1 << 16) else: addr &= 0xfffe print hex(addr), ":", hex(c.get_mem(addr)) except: print "No valid address specified." else: print "No register/address specified." elif input[0] == "r" or input[0] == "run": c.reset() c.run() elif input[0] == "regs": c.print_regs() elif input[0] == "reset": c.reset() elif input[0] == "t" or input[0] == "trace": if len(input) > 1: if input[1] == "on" or input[1] == "On" or input[1] == "1": c.set_trace(1) print "Trace is now on." elif input[1] == "off" or input[1] == "Off" or input[1] == "0": c.set_trace(0) print "Trace is now off." else: print "You must set trace to \"on\" or \"off\"."