1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Resolve LOOPNE, LOOPE, etc.

This commit is contained in:
Thomas Harte 2023-09-19 13:55:19 -04:00
parent 9b3199d97b
commit a7cf7d3183
2 changed files with 15 additions and 9 deletions

View File

@ -344,14 +344,17 @@ constexpr bool has_displacement(Operation operation) {
switch(operation) {
default: return false;
case Operation::JO: case Operation::JNO:
case Operation::JB: case Operation::JNB:
case Operation::JZ: case Operation::JNZ:
case Operation::JBE: case Operation::JNBE:
case Operation::JS: case Operation::JNS:
case Operation::JP: case Operation::JNP:
case Operation::JL: case Operation::JNL:
case Operation::JLE: case Operation::JNLE:
case Operation::JO: case Operation::JNO:
case Operation::JB: case Operation::JNB:
case Operation::JZ: case Operation::JNZ:
case Operation::JBE: case Operation::JNBE:
case Operation::JS: case Operation::JNS:
case Operation::JP: case Operation::JNP:
case Operation::JL: case Operation::JNL:
case Operation::JLE: case Operation::JNLE:
case Operation::LOOPNE: case Operation::LOOPE:
case Operation::LOOP: case Operation::JPCX:
case Operation::CALLrel: case Operation::JMPrel:
return true;
}
}
@ -379,6 +382,9 @@ constexpr int num_operands(Operation operation) {
case Operation::JP: case Operation::JNP:
case Operation::JL: case Operation::JNL:
case Operation::JLE: case Operation::JNLE:
case Operation::LOOPNE: case Operation::LOOPE:
case Operation::LOOP: case Operation::JPCX:
case Operation::CALLrel: case Operation::JMPrel:
// Genuine zero-operand instructions:
case Operation::CMPS: case Operation::LODS:
case Operation::MOVS: case Operation::SCAS:

View File

@ -98,7 +98,7 @@ constexpr char TestSuiteHome[] = "/Users/tharte/Projects/ProcessorTests/8088/v1"
using Repetition = InstructionSet::x86::Repetition;
switch(decoded.second.repetition()) {
case Repetition::None: break;
case Repetition::RepE: operation += "repe "; break;
case Repetition::RepE: operation += "rep "; break;
case Repetition::RepNE: operation += "repne "; break;
}