mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
UserspaceEmulator+LibX86: Implement the LEA instruction
This piggybacks nicely on Instruction's ModR/M resolution code. :^)
This commit is contained in:
parent
9257657340
commit
97f4cebc8d
2 changed files with 19 additions and 10 deletions
|
@ -218,6 +218,14 @@ public:
|
|||
template<typename CPU>
|
||||
u32 read32(CPU&, const Instruction&);
|
||||
|
||||
template<typename CPU>
|
||||
LogicalAddress resolve(const CPU& cpu, Optional<SegmentRegister> segment_prefix)
|
||||
{
|
||||
if (m_a32)
|
||||
return resolve32(cpu, segment_prefix);
|
||||
return resolve16(cpu, segment_prefix);
|
||||
}
|
||||
|
||||
private:
|
||||
MemoryOrRegisterReference() { }
|
||||
|
||||
|
@ -234,14 +242,6 @@ private:
|
|||
template<typename CPU>
|
||||
LogicalAddress resolve32(const CPU&, Optional<SegmentRegister>);
|
||||
|
||||
template<typename CPU>
|
||||
LogicalAddress resolve(const CPU& cpu, Optional<SegmentRegister> segment_prefix)
|
||||
{
|
||||
if (m_a32)
|
||||
return resolve32(cpu, segment_prefix);
|
||||
return resolve16(cpu, segment_prefix);
|
||||
}
|
||||
|
||||
template<typename CPU>
|
||||
u32 evaluate_sib(const CPU&, SegmentRegister& default_segment) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue