#ifndef CHIP8_INSTRUCTION_H #define CHIP8_INSTRUCTION_H /** * The instruction class stores the opcode and allows easier access to the Chip8 values */ class Instruction { private: /** * The basic opcode */ const unsigned short opcode; public: explicit Instruction(unsigned short opcode); /** * Gets the NNN Chip8 value * @return */ [[nodiscard]] unsigned short nnn() const; /** * Gets the N Chip8 value * @return */ [[nodiscard]] unsigned char n() const; /** * Gets the KK/Byte/NN Chip8 value * @return */ [[nodiscard]] unsigned short kk() const; /** * Gets the X Chip8 value * @return */ [[nodiscard]] unsigned char x() const; /** * Gets the Y Chip8 value * @return */ [[nodiscard]] unsigned char y() const; }; #endif //CHIP8_INSTRUCTION_H