diff options
| author | 0x221E <0x221E@0xinfinity.dev> | 2026-04-12 16:59:40 +0200 |
|---|---|---|
| committer | 0x221E <0x221E@0xinfinity.dev> | 2026-04-12 16:59:40 +0200 |
| commit | a66c7433c2c11b8b6c99142277ed4e16b1a2a465 (patch) | |
| tree | e54bcfb59c303acf6118fd11f06d5c0bd5f24e5d /src/DataTransfer.h | |
Diffstat (limited to 'src/DataTransfer.h')
| -rw-r--r-- | src/DataTransfer.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/DataTransfer.h b/src/DataTransfer.h new file mode 100644 index 0000000..a8ee9a1 --- /dev/null +++ b/src/DataTransfer.h @@ -0,0 +1,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); +} |
