diff options
| author | Raymaekers Luca <luca@spacehb.net> | 2025-11-12 18:52:38 +0100 |
|---|---|---|
| committer | Raymaekers Luca <luca@spacehb.net> | 2025-11-12 18:52:38 +0100 |
| commit | d4f6774c172ac1e7c193fc4e89230c873d179c2b (patch) | |
| tree | 049b855ac7b68482dc9e1e35b339f5b4d18d675b /src/libs/reference_decoder/sim86_lib.cpp | |
| parent | e20d69ffb1f5676bb7960ac4d71c1013e4582149 (diff) | |
checkpoint
Diffstat (limited to 'src/libs/reference_decoder/sim86_lib.cpp')
| -rw-r--r-- | src/libs/reference_decoder/sim86_lib.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/libs/reference_decoder/sim86_lib.cpp b/src/libs/reference_decoder/sim86_lib.cpp deleted file mode 100644 index 6971eb2..0000000 --- a/src/libs/reference_decoder/sim86_lib.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - - (C) Copyright 2023 by Molly Rocket, Inc., All Rights Reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Please see https://computerenhance.com for more information - - ======================================================================== */ - -#define assert(...) - -#include "sim86.h" - -#include "sim86_instruction.h" -#include "sim86_instruction_table.h" -#include "sim86_memory.h" -#include "sim86_decode.h" - -#include "sim86_instruction.cpp" -#include "sim86_instruction_table.cpp" -#include "sim86_memory.cpp" -#include "sim86_decode.cpp" -#include "sim86_text_table.cpp" - -extern "C" u32 Sim86_GetVersion(void) -{ - u32 Result = SIM86_VERSION; - return Result; -} - -extern "C" void Sim86_Decode8086Instruction(u32 SourceSize, u8 *Source, instruction *Dest) -{ - instruction_table Table = Get8086InstructionTable(); - - // NOTE(casey): The 8086 decoder requires the ability to read up to 15 bytes (the maximum - // allowable instruction size) - assert(Table.MaxInstructionByteCount == 15); - u8 GuardBuffer[16] = {}; - if(SourceSize < Table.MaxInstructionByteCount) - { - // NOTE(casey): I replaced the memcpy here with a manual copy to make it easier for - // people compiling on things like WebAssembly who do not want to use Emscripten. - for(u32 I = 0; I < SourceSize; ++I) - { - GuardBuffer[I] = Source[I]; - } - - Source = GuardBuffer; - } - - segmented_access At = FixedMemoryPow2(4, Source); - *Dest = DecodeInstruction(Table, At); -} - -extern "C" char const *Sim86_RegisterNameFromOperand(register_access *RegAccess) -{ - char const *Result = GetRegName(*RegAccess); - return Result; -} - -extern "C" char const *Sim86_MnemonicFromOperationType(operation_type Type) -{ - char const *Result = GetMnemonic(Type); - return Result; -} - -extern "C" void Sim86_Get8086InstructionTable(instruction_table *Dest) -{ - *Dest = Get8086InstructionTable(); -}
\ No newline at end of file |
