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
def op_7xkk(self): # print("7xkk") x = get_x(self.opcode) kk = get_kk(self.opcode) self.register[x] = (kk + self.register[x]) & 0xFF
def op_4xkk(self): # print("4xkk") x = get_x(self.opcode) kk = get_kk(self.opcode) if self.register[x] != kk: self.pc += 2
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
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