about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/arch/x86/arch.py2
-rw-r--r--miasm2/arch/x86/sem.py4
-rw-r--r--test/arch/x86/arch.py6
3 files changed, 8 insertions, 4 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index ff7dc1ee..28cac255 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -3879,7 +3879,7 @@ addop("shrd", [bs8(0x0f), bs8(0xac)] +
 addop("shrd", [bs8(0x0f), bs8(0xad)] +
       rmmod(rmreg) + [d_cl], [rm_arg, rmreg, d_cl])
 addop("sidt", [bs8(0x0f), bs8(0x01)] + rmmod(d1, modrm=mod_mem))
-addop("sldt", [bs8(0x0f), bs8(0x00)] + rmmod(d0, modrm=mod_mem))
+addop("sldt", [bs8(0x0f), bs8(0x00)] + rmmod(d0, rm_arg_x=rm_arg_reg_m16))
 addop("smsw", [bs8(0x0f), bs8(0x01)] + rmmod(d4))
 addop("stc", [bs8(0xf9)])
 addop("std", [bs8(0xfd)])
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index 565e63c5..17965fdc 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -2778,8 +2778,8 @@ def sidt(ir, instr, a):
 
 
 def sldt(ir, instr, a):
-    # XXX TOOD
-    e = [m2_expr.ExprAff(exception_flags, m2_expr.ExprInt32(EXCEPT_PRIV_INSN))]
+    print "DEFAULT SLDT ADDRESS %s!!" % str(a)
+    e = [m2_expr.ExprAff(a, m2_expr.ExprInt(0, a.size))]
     return e, []
 
 
diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py
index 80a8563d..e6797da2 100644
--- a/test/arch/x86/arch.py
+++ b/test/arch/x86/arch.py
@@ -2128,8 +2128,12 @@ reg_tests = [
 
     (m32, "00000000    SIDT       DWORD PTR [EAX]",
      "0f0108"),
-    (m32, "00000000    SLDT       DWORD PTR [EAX]",
+    (m32, "00000000    SLDT       WORD PTR [EAX]",
      "0f0000"),
+    (m32, "00000000    SLDT       EAX",
+     "0f00C0"),
+    (m32, "00000000    SLDT       AX",
+     "660f00C0"),
 
 
     (m32, "00000000    LGDT       DWORD PTR [EAX]",