about summary refs log tree commit diff stats
path: root/miasm2/arch/arm/sem.py
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2014-08-01 14:53:29 +0200
committerserpilliere <devnull@localhost>2014-08-01 14:53:29 +0200
commita845de1faf31228bd8279d11d780f80def64af9d (patch)
tree8218b8640a384aee020f715a73c0c62bb8a04a12 /miasm2/arch/arm/sem.py
parenta38102f1a05a36e95950785e1b2a9354eeef02f2 (diff)
downloadmiasm-a845de1faf31228bd8279d11d780f80def64af9d.tar.gz
miasm-a845de1faf31228bd8279d11d780f80def64af9d.zip
Arm arch: add sxtb/sxth (tx to t.pourcelot)
Diffstat (limited to 'miasm2/arch/arm/sem.py')
-rw-r--r--miasm2/arch/arm/sem.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/miasm2/arch/arm/sem.py b/miasm2/arch/arm/sem.py
index 07db3cfb..9608c1f0 100644
--- a/miasm2/arch/arm/sem.py
+++ b/miasm2/arch/arm/sem.py
@@ -826,6 +826,23 @@ def uxth(ir, instr, a, b):
         dst = PC
     return dst, e
 
+def sxtb(ir, instr, a, b):
+    e = []
+    e.append(ExprAff(a, b[:8].signExtend(32)))
+    dst = None
+    if PC in a.get_r():
+        dst = PC
+    return dst, e
+
+def sxth(ir, instr, a, b):
+    e = []
+    e.append(ExprAff(a, b[:16].signExtend(32)))
+    dst = None
+    if PC in a.get_r():
+        dst = PC
+    return dst, e
+
+
 def ubfx(ir, instr, a, b, c, d):
     e = []
     c = int(c.arg)
@@ -966,6 +983,8 @@ mnemo_condm0 = {'add': add,
                 'ldsh': ldrsh,
                 'uxtb': uxtb,
                 'uxth': uxth,
+                'sxtb': sxtb,
+                'sxth': sxth,
                 'ubfx': ubfx,
                 }