From 239ce75db6cf4542d17a1a6fe840f4845bdaefde Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 24 Oct 2023 22:35:13 -0400 Subject: [PATCH] Fix IN and OUT conversion. --- InstructionSets/x86/Instruction.cpp | 11 +++++++++-- OSBindings/Mac/Clock SignalTests/8088Tests.mm | 4 ---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/InstructionSets/x86/Instruction.cpp b/InstructionSets/x86/Instruction.cpp index 9a039dbc3..008dbfa08 100644 --- a/InstructionSets/x86/Instruction.cpp +++ b/InstructionSets/x86/Instruction.cpp @@ -323,6 +323,13 @@ std::string to_hex(int value, int digits, bool with_suffix = true) { return stream.str(); }; +template +std::string to_hex(IntT value) { + auto stream = std::stringstream(); + stream << std::uppercase << std::hex << +value << 'h'; + return stream.str(); +}; + } template @@ -532,7 +539,7 @@ std::string InstructionSet::x86::to_string( operation += ", "; switch(instruction.source().source()) { case Source::DirectAddress: - operation += to_hex(instruction.offset(), 2, true); + operation += to_hex(uint8_t(instruction.offset())); break; default: operation += to_string(instruction.source(), instruction, offset_length, immediate_length, InstructionSet::x86::DataSize::Word); @@ -543,7 +550,7 @@ std::string InstructionSet::x86::to_string( case Operation::OUT: switch(instruction.destination().source()) { case Source::DirectAddress: - operation += to_hex(instruction.offset(), 2, true); + operation += to_hex(uint8_t(instruction.offset())); break; default: operation += to_string(instruction.destination(), instruction, offset_length, immediate_length, InstructionSet::x86::DataSize::Word); diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 77a7391ef..e27e8a67b 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -354,10 +354,6 @@ struct FailedExecution { @"E1.json.gz", @"E2.json.gz", @"E3.json.gz", - @"E4.json.gz", - @"E5.json.gz", - @"E6.json.gz", - @"E7.json.gz", @"E8.json.gz", @"E9.json.gz", @"EB.json.gz",