1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

LEA implies a word. Otherwise add TODOs.

So that's now 69 failures.
This commit is contained in:
Thomas Harte 2023-09-26 15:41:51 -04:00
parent f16ac603f2
commit cd072e1b57
3 changed files with 6 additions and 0 deletions

View File

@ -716,6 +716,8 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
case ModRegRMFormat::MemReg_Seg:
// The 16-bit chips have four segment registers;
// the 80386 onwards has six.
// TODO: the 8086, at least, decodes something. Probably just the low two bits?
if(!is_32bit(model) && reg > 3) {
undefined();
} else if(reg > 5) {

View File

@ -155,6 +155,7 @@ bool InstructionSet::x86::mnemonic_implies_data_size(Operation operation) {
case Operation::STOS:
case Operation::JMPrel:
case Operation::JMPfar:
case Operation::LEA:
return true;
}
}

View File

@ -98,6 +98,9 @@ std::string to_string(InstructionSet::x86::DataPointer pointer, const Instructio
}
[[fallthrough]];
case 2:
// TODO: this mismatches some tests because it doesn't eliminate sign extensions.
// But when is it permissible to eliminate sign extensions? Always for now, and deal
// with it when testing actual execution?
if(!(instruction.offset() & 0xff00)) {
stream << '+' << to_hex(instruction.offset(), 2);
break;