blob: a8ee9a140974b1818384590b4705ac75c2aa035a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
#include <type_traits>
#include <cstdint>
#include <iostream>
#include <cstring>
#include "CPUContext.h"
#include "Instruction.h"
namespace executor_cases {
template<typename T, int O>
void Mov_rX_immX(CPUContext& cc) {
static_assert(std::is_unsigned_v<T>, "Mov_rX_immX requires an unsigned type!");
uint8_t reg = cc.m_Instruction.m_Opcode - O;
std::cout << "[Instruction] mov " << x86::Register2Str((x86::Register)reg) << ", " << std::hex << cc.m_Instruction.m_Operand1 << std::endl;
std::memcpy(&cc.m_Registers[reg], &cc.m_Instruction.m_Operand1, sizeof(T));
}
void Mov_rm32_r32(CPUContext& cc);
}
|