1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 02:55:07 +00:00

Implement STOS with one failure.

This commit is contained in:
Thomas Harte 2023-10-20 21:54:30 -04:00
parent 4efc181f07
commit c2ebbe5ad9
2 changed files with 20 additions and 0 deletions

View File

@ -1402,6 +1402,20 @@ void cmps(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, Address
repeat_ene<AddressT>(instruction, status, eCX, flow_controller);
}
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
void scas(const InstructionT &instruction, AddressT &eCX, AddressT &eDI, IntT &eAX, MemoryT &memory, Status &status, FlowControllerT &flow_controller) {
if(repetition_over<AddressT>(instruction, eCX)) {
return;
}
const IntT rhs = memory.template access<IntT>(Source::ES, eDI);
eDI += status.direction<AddressT>() * sizeof(IntT);
Primitive::sub<false, false>(eAX, rhs, status);
repeat_ene<AddressT>(instruction, status, eCX, flow_controller);
}
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
void lods(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, IntT &eAX, MemoryT &memory, Status &status, FlowControllerT &flow_controller) {
if(repetition_over<AddressT>(instruction, eCX)) {
@ -1698,6 +1712,9 @@ template <
case Operation::STOS:
Primitive::stos<IntT, AddressT>(instruction, eCX(), eDI(), pair_low(), memory, status, flow_controller);
break;
case Operation::SCAS:
Primitive::scas<IntT, AddressT>(instruction, eCX(), eDI(), pair_low(), memory, status, flow_controller);
break;
}
// Write to memory if required to complete this operation.

View File

@ -414,6 +414,9 @@ struct FailedExecution {
// STOS
@"AA.json.gz", @"AB.json.gz",
// SCAS
@"AE.json.gz", @"AF.json.gz",
/*
@"E0.json.gz", // LOOPNE
@"E1.json.gz", // LOOPE