diff --git a/InstructionSets/x86/Decoder.cpp b/InstructionSets/x86/Decoder.cpp index 75be5cdc1..f354816bd 100644 --- a/InstructionSets/x86/Decoder.cpp +++ b/InstructionSets/x86/Decoder.cpp @@ -716,6 +716,8 @@ std::pair::InstructionT> Decoder::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) { diff --git a/InstructionSets/x86/Instruction.cpp b/InstructionSets/x86/Instruction.cpp index 1a2b36e20..57b76c04a 100644 --- a/InstructionSets/x86/Instruction.cpp +++ b/InstructionSets/x86/Instruction.cpp @@ -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; } } diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 184fd8874..4fe2d2bee 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -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;