mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-27 15:29:34 +00:00
Add a formal SIB test.
This commit is contained in:
parent
a954f23642
commit
0cbb481fa4
@ -330,4 +330,16 @@ std::vector<typename InstructionSet::x86::Decoder<model>::InstructionT> decode(c
|
||||
run_test(true, DataSize::DWord);
|
||||
}
|
||||
|
||||
- (void)testSIB {
|
||||
const auto instructions = decode<Model::i80386>({
|
||||
// add edx, -0x7d(ebp + eax*2)
|
||||
0x01, 0x54, 0x45, 0x83
|
||||
}, true);
|
||||
|
||||
XCTAssertEqual(instructions.size(), 1);
|
||||
test(instructions[0], DataSize::DWord, Operation::ADD, Source::eDX, ScaleIndexBase(1, Source::eAX, Source::eBP), 0x00, -125);
|
||||
// Noting that a multiplier of 2 is a scale of 1,
|
||||
// since the scale is in log2.
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user