Example #1
0
 def op_Cxkk(self):
     # print("Cxkk")
     x = get_x(self.opcode)
     kk = get_kk(self.opcode)
     rand = randint(0, 255)
     self.register[x] = kk & rand
Example #2
0
 def op_7xkk(self):
     # print("7xkk")
     x = get_x(self.opcode)
     kk = get_kk(self.opcode)
     self.register[x] = (kk + self.register[x]) & 0xFF
Example #3
0
 def op_4xkk(self):
     # print("4xkk")
     x = get_x(self.opcode)
     kk = get_kk(self.opcode)
     if self.register[x] != kk:
         self.pc += 2
Example #4
0
 def op_6xkk(self):
     x = get_x(self.opcode)
     kk = get_kk(self.opcode)
     # print("6xkk", f"x={hex(x)}", f"kk={hex(kk)}")
     self.register[x] = kk
Example #5
0
 def op_3xkk(self):
     x = get_x(self.opcode)
     kk = get_kk(self.opcode)
     # print("3xkk", f"x={hex(x)}", f"kk={hex(kk)}")
     if self.register[x] == kk:
         self.pc += 2