diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-09-11 15:05:50 +0200 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-10-09 15:26:04 +0000 |
| commit | 1d230574c81113e15013f77db8d1bcdd45330d20 (patch) | |
| tree | 4ab3a71b51ebb896194f4585363a46623d084ef8 /miasm/arch/x86/sem.py | |
| parent | 08c22a46cc54da3cf4670ae0f263182d24ccdd86 (diff) | |
| download | focaccia-miasm-1d230574c81113e15013f77db8d1bcdd45330d20.tar.gz focaccia-miasm-1d230574c81113e15013f77db8d1bcdd45330d20.zip | |
Add BLSR instruction
Diffstat (limited to 'miasm/arch/x86/sem.py')
| -rw-r--r-- | miasm/arch/x86/sem.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/miasm/arch/x86/sem.py b/miasm/arch/x86/sem.py index c4120566..ff220471 100644 --- a/miasm/arch/x86/sem.py +++ b/miasm/arch/x86/sem.py @@ -4434,6 +4434,23 @@ def blsmsk(_, instr, dst, src): e.append(m2_expr.ExprAssign(dst, result)) return e, [] +def blsr(_, instr, dst, src): + e = [] + + tmp = src - m2_expr.ExprInt(1, src.size) + result = tmp & src + + 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.ExprCond(src, + m2_expr.ExprInt(0, 1), + m2_expr.ExprInt(1, 1)))) + + e.append(m2_expr.ExprAssign(dst, result)) + return e, [] + def pshufb(_, instr, dst, src): e = [] if dst.size == 64: @@ -5569,6 +5586,7 @@ mnemo_func = {'mov': mov, "andn": andn, "bextr": bextr, "blsmsk": blsmsk, + "blsr": blsr, # # MMX/AVX/SSE operations |