diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 19bd32de3..74df69705 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -814,7 +814,7 @@ void ld( template void lea( - InstructionT &instruction, + const InstructionT &instruction, IntT &destination, MemoryT &memory, RegistersT ®isters @@ -823,6 +823,23 @@ void lea( destination = IntT(address(instruction, instruction.source(), registers, memory)); } +template +void xlat( + const InstructionT &instruction, + MemoryT &memory, + RegistersT ®isters +) { + Source source_segment = instruction.segment_override(); + if(source_segment == Source::None) source_segment = Source::DS; + + AddressT address; + if constexpr (std::is_same_v) { + address = registers.bx() + registers.al(); + } + + registers.al() = memory.template access(source_segment, address); +} + template void mov(IntT &destination, IntT source) { destination = source; @@ -903,9 +920,7 @@ void setmo(IntT &destination, Status &status) { template void setmoc(IntT &destination, uint8_t cl, Status &status) { - if(cl) { - setmo(destination, status); - } + if(cl) setmo(destination, status); } } @@ -1085,6 +1100,8 @@ template < // TODO. } return; + + case Operation::XLAT: Primitive::xlat(instruction, memory, registers); return; } // Write to memory if required to complete this operation. diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index dd217b15a..bc61250b5 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -441,16 +441,14 @@ struct FailedExecution { @"86.json.gz", @"87.json.gz", @"91.json.gz", @"92.json.gz", @"93.json.gz", @"94.json.gz", @"95.json.gz", @"96.json.gz", @"97.json.gz", - - // TODO: XLAT */ - @"D6.json.gz", // SALC - - // SETMO - @"D0.6.json.gz", @"D1.6.json.gz", - // SETMOC - @"D2.6.json.gz", @"D3.6.json.gz", + @"D7.json.gz", // XLAT +/* + @"D6.json.gz", // SALC + @"D0.6.json.gz", @"D1.6.json.gz", // SETMO + @"D2.6.json.gz", @"D3.6.json.gz", // SETMOC +*/ ]]; NSSet *ignoreList = nil;