diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-12 16:04:13 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-12 16:19:48 +0100 |
| commit | 5c45840909c9ef005bda6952ad270f70953f6d74 (patch) | |
| tree | a9b30c494b3e0c6d4df136ac4b44e47a09694a15 /miasm2/arch/arm/sem.py | |
| parent | 328c0f8f1c08a6412fe2083bfdc09f941f5ceb2e (diff) | |
| download | miasm-5c45840909c9ef005bda6952ad270f70953f6d74.tar.gz miasm-5c45840909c9ef005bda6952ad270f70953f6d74.zip | |
Arm: add instruction bfc
Diffstat (limited to 'miasm2/arch/arm/sem.py')
| -rw-r--r-- | miasm2/arch/arm/sem.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/miasm2/arch/arm/sem.py b/miasm2/arch/arm/sem.py index 751891ca..1ef0b624 100644 --- a/miasm2/arch/arm/sem.py +++ b/miasm2/arch/arm/sem.py @@ -871,6 +871,28 @@ def ubfx(ir, instr, a, b, c, d): e.append(ExprAff(ir.IRDst, r)) return e +def bfc(ir, instr, a, b, c): + e = [] + start = int(b.arg) + stop = start + int(c.arg) + out = [] + last = 0 + if start: + out.append((a[:start], 0, start)) + last = start + if stop - start: + out.append((ExprInt32(0)[last:stop], last, stop)) + last = stop + if last < 32: + out.append((a[last:], last, 32)) + r = ExprCompose(out) + e.append(ExprAff(a, r)) + dst = None + if PC in a.get_r(): + dst = PC + e.append(ExprAff(ir.IRDst, r)) + return e + COND_EQ = 0 @@ -1009,6 +1031,7 @@ mnemo_condm0 = {'add': add, 'sxtb': sxtb, 'sxth': sxth, 'ubfx': ubfx, + 'bfc': bfc, } mnemo_condm1 = {'adds': add, |