X86: Implement the LIDT instruction.

--HG--
extra : convert_revision : 380515e985318311632e00b13000585afb052e3b
This commit is contained in:
Gabe Black 2007-12-01 23:01:31 -08:00
parent 62c79ca637
commit 557bc80647
2 changed files with 66 additions and 1 deletions

View file

@ -118,7 +118,15 @@
default: Inst::LGDT(M);
}
}
0x3: lidt_Ms();
0x3: decode MODE_SUBMODE {
0x0: Inst::LIDT(M);
default: decode OPSIZE {
// 16 bit operand sizes are special, but only
// in legacy and compatability modes.
0x2: Inst::LIDT_16(M);
default: Inst::LIDT(M);
}
}
0x4: smsw_Mw();
0x6: lmsw_Mw();
0x7: invlpg_M();

View file

@ -110,4 +110,61 @@ def macroop LGDT_16_P
wrbase gdtr, t2
wrlimit gdtr, t1
};
def macroop LIDT_M
{
.adjust_env oszForPseudoDesc
# Get the limit
ld t1, seg, sib, disp, dataSize=2
# Get the base
ld t2, seg, sib, 'adjustedDisp + 2'
wrbase idtr, t2
wrlimit idtr, t1
};
def macroop LIDT_P
{
.adjust_env oszForPseudoDesc
rdip t7
# Get the limit
ld t1, seg, riprel, disp, dataSize=2
# Get the base
ld t2, seg, riprel, 'adjustedDisp + 2'
wrbase idtr, t2
wrlimit idtr, t1
};
#
# These versions are for when the original data size was 16 bits. The base is
# still 32 bits, but the top byte is zeroed before being used.
#
def macroop LIDT_16_M
{
.adjust_env oszForPseudoDesc
# Get the limit
ld t1, seg, sib, disp, dataSize=2
# Get the base
ld t2, seg, sib, 'adjustedDisp + 2', dataSize=4
zexti t2, t2, 23
wrbase idtr, t2
wrlimit idtr, t1
};
def macroop LIDT_16_P
{
.adjust_env oszForPseudoDesc
rdip t7
# Get the limit
ld t1, seg, riprel, disp, dataSize=2
# Get the base
ld t2, seg, riprel, 'adjustedDisp + 2', dataSize=4
zexti t2, t2, 23
wrbase idtr, t2
wrlimit idtr, t1
};
'''