diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2014-12-11 16:17:14 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2014-12-11 16:17:14 +0100 |
| commit | ae8fa157906b8a7039cce786b9ecdb05ea3d9f2f (patch) | |
| tree | e274c1b2a0254c403ae10e6dc6cd12cd6d712756 | |
| parent | 90aa4b8195cefddee192df3c4c674b648f21e228 (diff) | |
| download | miasm-ae8fa157906b8a7039cce786b9ecdb05ea3d9f2f.tar.gz miasm-ae8fa157906b8a7039cce786b9ecdb05ea3d9f2f.zip | |
X86: use explicit names in update flags functions
| -rw-r--r-- | miasm2/arch/x86/sem.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 2bad64fc..232b758f 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -134,12 +134,14 @@ def update_flag_add_of(op1, op2, res): # checked: ok for sbb add because b & c before +cf -def update_flag_sub_cf(a, b, c): - return ExprAff(cf, (((a ^ b) ^ c) ^ ((a ^ c) & (a ^ b))).msb()) +def update_flag_sub_cf(op1, op2, res): + "Compote CF in @res = @op1 - @op2" + return ExprAff(cf, (((op1 ^ op2) ^ res) ^ ((op1 ^ res) & (op1 ^ op2))).msb()) -def update_flag_sub_of(a, b, c): - return ExprAff(of, (((a ^ c) & (a ^ b))).msb()) +def update_flag_sub_of(op1, op2, res): + "Compote OF in @res = @op1 - @op2" + return ExprAff(of, (((op1 ^ res) & (op1 ^ op2))).msb()) # z = x+y (+cf?) |