mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-31 02:33:02 +00:00
Implement XLAT.
This commit is contained in:
parent
d35377c776
commit
bf832768e6
@ -814,7 +814,7 @@ void ld(
|
||||
|
||||
template <Model model, typename IntT, typename InstructionT, typename MemoryT, typename RegistersT>
|
||||
void lea(
|
||||
InstructionT &instruction,
|
||||
const InstructionT &instruction,
|
||||
IntT &destination,
|
||||
MemoryT &memory,
|
||||
RegistersT ®isters
|
||||
@ -823,6 +823,23 @@ void lea(
|
||||
destination = IntT(address<model, uint16_t>(instruction, instruction.source(), registers, memory));
|
||||
}
|
||||
|
||||
template <typename AddressT, typename InstructionT, typename MemoryT, typename RegistersT>
|
||||
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<AddressT, uint16_t>) {
|
||||
address = registers.bx() + registers.al();
|
||||
}
|
||||
|
||||
registers.al() = memory.template access<uint8_t>(source_segment, address);
|
||||
}
|
||||
|
||||
template <typename IntT>
|
||||
void mov(IntT &destination, IntT source) {
|
||||
destination = source;
|
||||
@ -903,9 +920,7 @@ void setmo(IntT &destination, Status &status) {
|
||||
|
||||
template <typename IntT>
|
||||
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<uint16_t>(instruction, memory, registers); return;
|
||||
}
|
||||
|
||||
// Write to memory if required to complete this operation.
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user