mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-06 13:31:55 +00:00
Include missing context on JMP/CALL far.
Zero failing tests amongst official opcodes.
This commit is contained in:
parent
1a6c8a2aed
commit
ef5ee8cf94
@ -95,6 +95,7 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
|
|||||||
SetOperation(Operation::op); \
|
SetOperation(Operation::op); \
|
||||||
phase_ = Phase::DisplacementOrOperand; \
|
phase_ = Phase::DisplacementOrOperand; \
|
||||||
operand_size_ = DataSize::Word; \
|
operand_size_ = DataSize::Word; \
|
||||||
|
destination_ = Source::Immediate; \
|
||||||
displacement_size_ = data_size(default_address_size_)
|
displacement_size_ = data_size(default_address_size_)
|
||||||
|
|
||||||
/// Handles ENTER — a fixed three-byte operation.
|
/// Handles ENTER — a fixed three-byte operation.
|
||||||
|
@ -62,13 +62,13 @@ std::string InstructionSet::x86::to_string(Operation operation, DataSize size) {
|
|||||||
|
|
||||||
case Operation::CALLabs: return "call";
|
case Operation::CALLabs: return "call";
|
||||||
case Operation::CALLrel: return "call";
|
case Operation::CALLrel: return "call";
|
||||||
case Operation::CALLfar: return "callf far";
|
case Operation::CALLfar: return "callf";
|
||||||
case Operation::IRET: return "iret";
|
case Operation::IRET: return "iret";
|
||||||
case Operation::RETfar: return "retf";
|
case Operation::RETfar: return "retf";
|
||||||
case Operation::RETnear: return "retn";
|
case Operation::RETnear: return "retn";
|
||||||
case Operation::JMPabs: return "jmp";
|
case Operation::JMPabs: return "jmp";
|
||||||
case Operation::JMPrel: return "jmp";
|
case Operation::JMPrel: return "jmp";
|
||||||
case Operation::JMPfar: return "jmpf far";
|
case Operation::JMPfar: return "jmpf";
|
||||||
case Operation::JCXZ: return "jcxz";
|
case Operation::JCXZ: return "jcxz";
|
||||||
case Operation::INT: return "int";
|
case Operation::INT: return "int";
|
||||||
case Operation::INTO: return "into";
|
case Operation::INTO: return "into";
|
||||||
@ -155,7 +155,6 @@ bool InstructionSet::x86::mnemonic_implies_data_size(Operation operation) {
|
|||||||
case Operation::SCAS:
|
case Operation::SCAS:
|
||||||
case Operation::STOS:
|
case Operation::STOS:
|
||||||
case Operation::JMPrel:
|
case Operation::JMPrel:
|
||||||
case Operation::JMPfar:
|
|
||||||
case Operation::LEA:
|
case Operation::LEA:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ enum class Operation: uint8_t {
|
|||||||
CALLabs,
|
CALLabs,
|
||||||
/// Relative call; see displacement().
|
/// Relative call; see displacement().
|
||||||
CALLrel,
|
CALLrel,
|
||||||
/// Far call; see the segment() and offset() fields.
|
/// Far call; if destination is Source::Immediate then see the segment() and offset() fields; otherwise take segment and offset by indirection.
|
||||||
CALLfar,
|
CALLfar,
|
||||||
/// Return from interrupt.
|
/// Return from interrupt.
|
||||||
IRET,
|
IRET,
|
||||||
@ -106,7 +106,7 @@ enum class Operation: uint8_t {
|
|||||||
JMPabs,
|
JMPabs,
|
||||||
/// Near jump with a relative destination.
|
/// Near jump with a relative destination.
|
||||||
JMPrel,
|
JMPrel,
|
||||||
/// Far jump to the indicated segment and offset.
|
/// Far jump; if destination is Source::Immediate then see the segment() and offset() fields; otherwise take segment and offset by indirection.
|
||||||
JMPfar,
|
JMPfar,
|
||||||
/// Relative jump performed only if CX = 0; see the displacement.
|
/// Relative jump performed only if CX = 0; see the displacement.
|
||||||
JCXZ,
|
JCXZ,
|
||||||
|
@ -146,9 +146,6 @@ std::string to_string(
|
|||||||
- (NSArray<NSString *> *)testFiles {
|
- (NSArray<NSString *> *)testFiles {
|
||||||
NSString *path = [NSString stringWithUTF8String:TestSuiteHome];
|
NSString *path = [NSString stringWithUTF8String:TestSuiteHome];
|
||||||
NSSet *allowList = [NSSet setWithArray:@[
|
NSSet *allowList = [NSSet setWithArray:@[
|
||||||
// Failing CALL and JMP.
|
|
||||||
// @"FF.3.json.gz",
|
|
||||||
// @"FF.5.json.gz",
|
|
||||||
]];
|
]];
|
||||||
|
|
||||||
// Unofficial opcodes; ignored for now.
|
// Unofficial opcodes; ignored for now.
|
||||||
@ -237,10 +234,18 @@ std::string to_string(
|
|||||||
|
|
||||||
case Operation::CALLfar:
|
case Operation::CALLfar:
|
||||||
case Operation::JMPfar: {
|
case Operation::JMPfar: {
|
||||||
operation += " 0x";
|
switch(instruction.destination().source()) {
|
||||||
operation += to_hex(instruction.segment(), 4, false);
|
case Source::Immediate:
|
||||||
operation += ":0x";
|
operation += " far 0x";
|
||||||
operation += to_hex(instruction.offset(), 4, false);
|
operation += to_hex(instruction.segment(), 4, false);
|
||||||
|
operation += ":0x";
|
||||||
|
operation += to_hex(instruction.offset(), 4, false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
operation += " ";
|
||||||
|
operation += to_string(instruction.destination(), instruction, offsetLength, immediateLength);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case Operation::LDS:
|
case Operation::LDS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user