#include "ExecutorCases.h" #include "DataTransfer.h" #include "ControlFlow.h" #include "Arithmetic.h" #include "Misc.h" #include "Instruction.h" #include "Bus.h" #include #include CPUContext::CPUContext(Instruction& i, uint32_t& ip, uint32_t& flags, uint32_t* reg, std::shared_ptr& bus, bool& isHalted) : m_Instruction(i), m_InstructionPointer(ip), m_Flags(flags), m_Registers(reg), m_Bus(bus), m_IsHalted(isHalted) { } CPUContext::~CPUContext() = default; constexpr std::array GenerateExecutorTable(){ std::array table{}; table[Opcode::NOP] = executor_cases::Nop; table[Opcode::HLT] = executor_cases::Hlt; table[Opcode::MOV_R32_IMM32] = executor_cases::Mov_r32_imm32; table[Opcode::ADD_RM32_R32] = executor_cases::Add_rm32_r32; return table; } static constexpr std::array s_ExecutorTable = GenerateExecutorTable(); const std::array& GetExecutorTable() { return s_ExecutorTable; }