about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2015-11-09 15:06:52 +0100
committerAjax <commial@gmail.com>2015-11-09 15:06:52 +0100
commitdcfdeae898b6c812107bc8384428a698a13a0b19 (patch)
tree3564c0f6df8f967a72a5e3146eae131e7c7b27e7
parent7681a432c7c98df9d075701a172df0d5f311f753 (diff)
downloadmiasm-dcfdeae898b6c812107bc8384428a698a13a0b19.tar.gz
miasm-dcfdeae898b6c812107bc8384428a698a13a0b19.zip
x86/sem: unify the way aflag is computed (like popfd/w, sahf)
-rw-r--r--miasm2/arch/x86/sem.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index e511a534..1a4d7168 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -73,11 +73,8 @@ def update_flag_pf(a):
                                            a & m2_expr.ExprInt_from(a, 0xFF)))]
 
 
-def update_flag_af(a):
-    return [m2_expr.ExprAff(af,
-                            m2_expr.ExprCond((a & m2_expr.ExprInt_from(a,0x10)),
-                                             m2_expr.ExprInt_from(af, 1),
-                                             m2_expr.ExprInt_from(af, 0)))]
+def update_flag_af(expr):
+    return [m2_expr.ExprAff(af, expr[4:5])]
 
 
 def update_flag_znp(a):