Chip8-Discord-Bot/instruction.py
2018-09-02 13:35:17 +02:00

10 lines
288 B
Python

class Opcode:
def __init__(self, opc: int):
self.op = opc
self.i = (opc & 0xF000) >> 12
self.nnn = opc & 0x0FFF
self.n = (opc & 0x000F)
self.x = (opc & 0x0F00) >> 8
self.y = (opc & 0x00F0) >> 4
self.kk = (opc & 0x00FF)