about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2015-11-09 14:27:28 +0100
committerserpilliere <serpilliere@users.noreply.github.com>2015-11-09 14:27:28 +0100
commit82009afe2e94a4e9a6ac6200969936cb3285ec63 (patch)
tree124e8be31ae9bb923221bc79269be01e1d92f6f0
parent29a00f31d46e49333df450b85580af152aae2668 (diff)
parentdcfdeae898b6c812107bc8384428a698a13a0b19 (diff)
downloadmiasm-82009afe2e94a4e9a6ac6200969936cb3285ec63.tar.gz
miasm-82009afe2e94a4e9a6ac6200969936cb3285ec63.zip
Merge pull request #259 from commial/fix-aflag
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):