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

Make better guess at CALL/JMP size; apply same sizing-logic as offset for disassembly matching.

13 failures.
This commit is contained in:
Thomas Harte 2023-09-28 14:52:42 -04:00
parent 86f12f4d4c
commit 960cca163e
2 changed files with 8 additions and 7 deletions

View File

@ -420,10 +420,10 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
case 0xe6: AddrReg(OUT, eAX, DataSize::Byte, DataSize::Byte); break;
case 0xe7: AddrReg(OUT, eAX, data_size_, DataSize::Byte); break;
case 0xe8: Displacement(CALLrel, data_size_); break;
case 0xe9: Displacement(JMPrel, data_size_); break;
case 0xea: Far(JMPfar); break;
case 0xeb: Displacement(JMPrel, DataSize::Byte); break;
case 0xe8: Displacement(CALLrel, data_size(address_size_)); break;
case 0xe9: Displacement(JMPrel, data_size(address_size_)); break;
case 0xea: Far(JMPfar); break;
case 0xeb: Displacement(JMPrel, DataSize::Byte); break;
case 0xec: Complete(IN, eDX, eAX, DataSize::Byte); break;
case 0xed: Complete(IN, eDX, eAX, data_size_); break;

View File

@ -146,7 +146,8 @@ std::string to_string(
- (NSArray<NSString *> *)testFiles {
NSString *path = [NSString stringWithUTF8String:TestSuiteHome];
NSSet *allowList = [NSSet setWithArray:@[
// @"C4.json.gz",
// @"E8.json.gz",
// @"E9.json.gz",
]];
// Unofficial opcodes; ignored for now.
@ -229,7 +230,7 @@ std::string to_string(
operation += to_string(instruction.source(), instruction, offsetLength, immediateLength);
}
if(displacement) {
operation += to_hex(instruction.displacement(), 2);
operation += to_hex(instruction.displacement(), offsetLength);
}
} break;
@ -278,7 +279,7 @@ std::string to_string(
}
}
if(displacement) {
operation += to_hex(instruction.displacement(), 2);
operation += to_hex(instruction.displacement(), offsetLength);
}
break;
}