mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Add test for switch to Source::IndirectNoBase.
This commit is contained in:
parent
673ffc50da
commit
a2ae3771eb
@ -830,7 +830,6 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
|
||||
|
||||
if(expects_sib && (source_ == Source::Indirect | destination_ == Source::Indirect)) {
|
||||
phase_ = Phase::ScaleIndexBase;
|
||||
// TODO: test for IndirectNoBase.
|
||||
} else {
|
||||
phase_ = (displacement_size_ != DataSize::None || operand_size_ != DataSize::None) ? Phase::DisplacementOrOperand : Phase::ReadyToPost;
|
||||
}
|
||||
@ -845,6 +844,12 @@ std::pair<int, typename Decoder<model>::InstructionT> Decoder<model>::decode(con
|
||||
++source;
|
||||
++consumed_;
|
||||
|
||||
// Potentially record the lack of a base.
|
||||
if(displacement_size_ == DataSize::None && (uint8_t(sib_)&7) == 5) {
|
||||
source_ = (source_ == Source::Indirect) ? Source::IndirectNoBase : source_;
|
||||
destination_ = (destination_ == Source::Indirect) ? Source::IndirectNoBase : destination_;
|
||||
}
|
||||
|
||||
phase_ = (displacement_size_ != DataSize::None || operand_size_ != DataSize::None) ? Phase::DisplacementOrOperand : Phase::ReadyToPost;
|
||||
}
|
||||
|
||||
|
@ -539,7 +539,7 @@ std::vector<typename InstructionSet::x86::Decoder<model>::InstructionT> decode(c
|
||||
test(instructions[63], Operation::JPCX, 0, 0xd4 - 0x9d);
|
||||
}
|
||||
|
||||
- (void)testSourceSIB1 {
|
||||
- (void)testSourceModRegRM1 {
|
||||
const auto instructions = decode<Model::i80386>({
|
||||
0x62, 0x90, 0x90, 0xdf, 0xcd, 0xf9
|
||||
}, true);
|
||||
@ -548,7 +548,7 @@ std::vector<typename InstructionSet::x86::Decoder<model>::InstructionT> decode(c
|
||||
test(instructions[0], DataSize::DWord, Operation::BOUND, ScaleIndexBase(Source::eAX), Source::eDX, 0, -0x6322070);
|
||||
}
|
||||
|
||||
- (void)testSourceSIB2 {
|
||||
- (void)testSourceModRegRM2 {
|
||||
const auto instructions = decode<Model::i80386>({
|
||||
0x81, 0x47, 0xbe, 0xa9, 0x3a, 0x68, 0x9f
|
||||
}, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user