コード例 #1
0
 def run_prog(self):
     print(">Running program")
     self.stop_button["state"] = "normal"
     self.reset_button["state"] = "normal"
     for inst in self.program.instructions:
         inst.execute()
         ui.unlock_text(self)
         ui.update_stack(self)
         ui.update_registers(self)
         ui.lock_text(self)
コード例 #2
0
 def step_once(self):
     print(">Stepping once")
     self.reset_button["state"] = "normal"
     if(len(self.program.instructions) != 0):
         inst = self.program.instructions.pop(0)
         inst.execute()
     ui.unlock_text(self)
     ui.update_stack(self)
     ui.update_registers(self)
     ui.lock_text(self)
コード例 #3
0
 def load_input_file(self):
     filename = lf.get_file(self)
     lines = lf.get_lines(self, filename)
     self.program = mips.Program(lines)
     ui.unlock_text(self)
     ui.update_bin(self)
     ui.update_stack(self)
     ui.update_registers(self)
     ui.lock_text(self)
     self.step_button["state"] = "normal"
     self.run_button["state"] = "normal"