Chip8-Discord-Bot/instruction.py

10 lines
288 B
Python
Raw Normal View History

2018-09-02 11:35:17 +00:00
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)