class InstructionTest(unittest.TestCase): def setUp(self): self.instruction = Instruction("instruction inicial",False,False) self.instructionFinal = Instruction("instruction final y de io",True,True) def test_execute_noFinal(self): assert not self.instruction.execute() def test_execute_final(self): assert self.instructionFinal.execute()
def instructions_executer(self): terminated = False while self.controller.pc < len(self.instruction_set): print(self.controller.reg) instruction = Instruction(self.controller) self.controller = instruction.execute() print(self.controller.reg) print() print("program terminated")
def exectute_next_instruction(self): instruction = Instruction(self.mem_stream, self, self.linux) instruction.execute()