diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-09-10 16:13:32 +0200 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-10-09 15:26:04 +0000 |
| commit | 208469b489bde74acdefe7dd625fab47299b5de4 (patch) | |
| tree | 5805ed72a2e6c4da55ec398514da8abf328afbc9 /miasm/arch/x86/sem.py | |
| parent | d249a6bb1b58b6e6049ef2633760749a10b58c74 (diff) | |
| download | focaccia-miasm-208469b489bde74acdefe7dd625fab47299b5de4.tar.gz focaccia-miasm-208469b489bde74acdefe7dd625fab47299b5de4.zip | |
Add support for ANDN instruction
Diffstat (limited to 'miasm/arch/x86/sem.py')
| -rw-r--r-- | miasm/arch/x86/sem.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/miasm/arch/x86/sem.py b/miasm/arch/x86/sem.py index 549e2f79..46b7a019 100644 --- a/miasm/arch/x86/sem.py +++ b/miasm/arch/x86/sem.py @@ -4387,6 +4387,21 @@ def blsi(_, instr, dst, src): e.append(m2_expr.ExprAssign(dst, result)) return e, [] +def andn(_, instr, dst, src1, src2): + e = [] + + arg1 = m2_expr.ExprInt(0, src1.size) + neg_src1 = arg1 - src1 + result = neg_src1 & src2 + + e += update_flag_zf(result) + e += update_flag_nf(result) + e.append(m2_expr.ExprAssign(of, m2_expr.ExprInt(0, of.size))) + e.append(m2_expr.ExprAssign(cf, m2_expr.ExprInt(0, cf.size))) + + e.append(m2_expr.ExprAssign(dst, result)) + return e, [] + def pshufb(_, instr, dst, src): e = [] if dst.size == 64: @@ -5519,6 +5534,7 @@ mnemo_func = {'mov': mov, # BMI operations "blsi": blsi, + "andn": andn, # # MMX/AVX/SSE operations |