コード例 #1
0
ファイル: sim.py プロジェクト: stefanct/aua
                     reg = int(input[1][1:], 10)
                     if reg < 0 or reg > 31:
                         print "Valid registers: r0..r31"
                     else:
                         print hex(c.get_reg(reg))
                 except:
                     print "No valid register specified."
                 
         else: # Speicher ausgeben
             try:
                 addr = int(input[1], 0)
                 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()