1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Fix IN and OUT conversion.

This commit is contained in:
Thomas Harte 2023-10-24 22:35:13 -04:00
parent cc9e8117ab
commit 239ce75db6
2 changed files with 9 additions and 6 deletions

View File

@ -323,6 +323,13 @@ std::string to_hex(int value, int digits, bool with_suffix = true) {
return stream.str();
};
template <typename IntT>
std::string to_hex(IntT value) {
auto stream = std::stringstream();
stream << std::uppercase << std::hex << +value << 'h';
return stream.str();
};
}
template <bool is_32bit>
@ -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);

View File

@ -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",