From 7f9847dd2dbf8ceb8a2a7b9f24024b77d0ffeb75 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 18 Aug 2022 00:03:32 +0200 Subject: [PATCH] Emulator: Add register variables to CPU class --- src/cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/cpu.h b/src/cpu.h index 5241a9a..403f0e5 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -7,10 +7,43 @@ #pragma once +#include // uint8_t, uint16_t + #include "processing-unit.h" class CPU final : public ProcessingUnit { public: CPU(); virtual ~CPU(); + + // 8-bit Arithmetic and Logic Instructions + + // 16-bit Arithmetic Instructions + + // Bit Operations Instructions + + // Bit Shift Instructions + + // Load Instructions + + // Jumps and Subroutines + + // Stack Operations Instructions + + // Miscellaneous Instructions + +private: + // 16-bit registers + uint16_t m_af { 0 }; // Accumulator & Flags + uint16_t m_bc { 0 }; // BC + uint16_t m_de { 0 }; // DE + uint16_t m_hl { 0 }; // HL + uint16_t m_sp { 0 }; // Stack Pointer + uint16_t m_pc { 0 }; // Program Counter + + // 8-bit registers (flags) + uint8_t m_z { 0 }; // Zero flag + uint8_t m_n { 0 }; // Subtraction flag (BCD) + uint8_t m_h { 0 }; // Half Carry flag (BCD) + uint8_t m_c { 0 }; // Carry flag };