Пример #1
0
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()
Пример #2
0
    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")
Пример #3
0
 def exectute_next_instruction(self):
     instruction = Instruction(self.mem_stream, self, self.linux)
     instruction.execute()