about summary refs log tree commit diff stats
path: root/miasm2/arch/x86/sem.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2014-09-19 14:43:41 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2014-09-19 14:43:41 +0200
commit1ba1190d96d2d48a61743cb8d0c7cdf825794188 (patch)
treed90ec0cc4e54208a70bd5d1efc6a05c9db90a2ed /miasm2/arch/x86/sem.py
parent09b30f6b7a62ac44c86666e0d8156a8607f2c07c (diff)
downloadmiasm-1ba1190d96d2d48a61743cb8d0c7cdf825794188.tar.gz
miasm-1ba1190d96d2d48a61743cb8d0c7cdf825794188.zip
x86: fix movs scas
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/sem.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index 46302de3..781b3321 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -3377,17 +3377,14 @@ class ir_x86_16(ir):
             if e.dst == zf:
                 zf_val = e.src
 
+        cond_dec = ExprCond(c_reg - ExprInt_from(c_reg, 1), ExprInt1(0), ExprInt1(1))
         # end condition
         if zf_val is None:
-            c_cond = ExprCond(c_reg, ExprInt1(0), ExprInt1(1))
+            c_cond = cond_dec
         elif instr.additional_info.g1.value & 2:  # REPNE
-            # c_cond = ExprCond(c_reg, ExprInt1(0), ExprInt1(1)) | (zf_val)
-            c_cond = ExprCond(c_reg, ExprInt1(0), ExprInt1(1)) | (zf)
+            c_cond = cond_dec | zf
         elif instr.additional_info.g1.value & 4:  # REP
-            # c_cond = ExprCond(c_reg, ExprInt1(0), ExprInt1(1)) |
-            # (zf_val^ExprInt32(1))
-            c_cond = ExprCond(
-                c_reg, ExprInt1(0), ExprInt1(1)) | (zf ^ ExprInt1(1))
+            c_cond = cond_dec | (zf ^ ExprInt1(1))
 
         # gen while
         lbl_do = ExprId(self.gen_label(), instr.mode)