diff options
| author | Camille Mougey <commial@gmail.com> | 2014-12-11 16:20:49 +0100 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2014-12-11 16:20:49 +0100 |
| commit | 57b686760de66ad26f80337f0acfb88ea368845f (patch) | |
| tree | e274c1b2a0254c403ae10e6dc6cd12cd6d712756 /miasm2/arch/x86/sem.py | |
| parent | 57c355814bfc83131fa63b4b54aaba0a009afd95 (diff) | |
| parent | ae8fa157906b8a7039cce786b9ecdb05ea3d9f2f (diff) | |
| download | miasm-57b686760de66ad26f80337f0acfb88ea368845f.tar.gz miasm-57b686760de66ad26f80337f0acfb88ea368845f.zip | |
Merge pull request #20 from serpilliere/fix_arm_sem
Fix arm sem
Diffstat (limited to 'miasm2/arch/x86/sem.py')
| -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?) |