mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Fix LODS: REP is not REPE.
This commit is contained in:
parent
8caad8b99d
commit
dab3dcaafb
@ -1360,7 +1360,7 @@ bool repetition_over(const InstructionT &instruction, AddressT &eCX) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename AddressT, typename InstructionT, typename FlowControllerT>
|
template <typename AddressT, typename InstructionT, typename FlowControllerT>
|
||||||
void repeat(const InstructionT &instruction, Status &status, AddressT &eCX, FlowControllerT &flow_controller) {
|
void repeat_ene(const InstructionT &instruction, Status &status, AddressT &eCX, FlowControllerT &flow_controller) {
|
||||||
if(
|
if(
|
||||||
instruction.repetition() == Repetition::None || // No repetition => stop.
|
instruction.repetition() == Repetition::None || // No repetition => stop.
|
||||||
!(--eCX) || // [e]cx is zero after being decremented => stop.
|
!(--eCX) || // [e]cx is zero after being decremented => stop.
|
||||||
@ -1372,6 +1372,17 @@ void repeat(const InstructionT &instruction, Status &status, AddressT &eCX, Flow
|
|||||||
flow_controller.repeat_last();
|
flow_controller.repeat_last();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename AddressT, typename InstructionT, typename FlowControllerT>
|
||||||
|
void repeat(const InstructionT &instruction, AddressT &eCX, FlowControllerT &flow_controller) {
|
||||||
|
if(
|
||||||
|
instruction.repetition() == Repetition::None || // No repetition => stop.
|
||||||
|
!(--eCX) // [e]cx is zero after being decremented => stop.
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
flow_controller.repeat_last();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
|
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
|
||||||
void cmps(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, AddressT &eDI, MemoryT &memory, Status &status, FlowControllerT &flow_controller) {
|
void cmps(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, AddressT &eDI, MemoryT &memory, Status &status, FlowControllerT &flow_controller) {
|
||||||
if(repetition_over<AddressT>(instruction, eCX)) {
|
if(repetition_over<AddressT>(instruction, eCX)) {
|
||||||
@ -1388,7 +1399,7 @@ void cmps(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, Address
|
|||||||
|
|
||||||
Primitive::sub<false, false>(lhs, rhs, status);
|
Primitive::sub<false, false>(lhs, rhs, status);
|
||||||
|
|
||||||
repeat<AddressT>(instruction, status, eCX, flow_controller);
|
repeat_ene<AddressT>(instruction, status, eCX, flow_controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
|
template <typename IntT, typename AddressT, typename InstructionT, typename MemoryT, typename FlowControllerT>
|
||||||
@ -1403,7 +1414,7 @@ void lods(const InstructionT &instruction, AddressT &eCX, AddressT &eSI, IntT &e
|
|||||||
eAX = memory.template access<IntT>(source_segment, eSI);
|
eAX = memory.template access<IntT>(source_segment, eSI);
|
||||||
eSI += status.direction<AddressT>() * sizeof(IntT);
|
eSI += status.direction<AddressT>() * sizeof(IntT);
|
||||||
|
|
||||||
repeat<AddressT>(instruction, status, eCX, flow_controller);
|
repeat<AddressT>(instruction, eCX, flow_controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ struct FailedExecution {
|
|||||||
// TODO: MOVS, SCAS, STOS
|
// TODO: MOVS, SCAS, STOS
|
||||||
*/
|
*/
|
||||||
// CMPS
|
// CMPS
|
||||||
// @"A6.json.gz", @"A7.json.gz",
|
@"A6.json.gz", @"A7.json.gz",
|
||||||
|
|
||||||
// LODS
|
// LODS
|
||||||
@"AC.json.gz", @"AD.json.gz",
|
@"AC.json.gz", @"AD.json.gz",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user