Exemple #1
0
 def executeProgram(self, instructions: bytes):
     self.instructions = instructions
     self.PC = 0
     instructionArr = [Instruction.ADC(), Instruction.ORA()]
     print("Running program: \n" + str(instructions))
     while (self.PC >= 0 and self.PC < len(instructions)):
         print("Current instruction: " + str(self.PC) + " : " +
               str(int(instructions[self.PC])))
         instructionArr[0].execute(instructions[self.PC], self)