about summary refs log tree commit diff stats
path: root/miasm2/arch/msp430/ira.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-04-01 15:58:29 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-04-01 23:47:37 +0200
commit53d82c13f7da6851196e69c67841af24bcf218b2 (patch)
tree36a74eb31953b449544dfc6eedd8e61a1be7a5eb /miasm2/arch/msp430/ira.py
parent5a6145c5ea3a1df1e666224962dc3ba685327a12 (diff)
downloadmiasm-53d82c13f7da6851196e69c67841af24bcf218b2.tar.gz
miasm-53d82c13f7da6851196e69c67841af24bcf218b2.zip
Cpu: modify instructions' offset relative encoding
The assembler will automatically use instruction len in offset computation

In the following instruction:
0x10: EB 02   JMP 0x14

If we assemble this instruction, the requested instruction send to the assembler
engine will be:
JMP +0x4

And will be encoded to:
EB 02

Previously, the assembly of:
JMP +0x4
was:
EB 04
Diffstat (limited to 'miasm2/arch/msp430/ira.py')
-rw-r--r--miasm2/arch/msp430/ira.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/miasm2/arch/msp430/ira.py b/miasm2/arch/msp430/ira.py
index ea8bdc2c..26a53a1e 100644
--- a/miasm2/arch/msp430/ira.py
+++ b/miasm2/arch/msp430/ira.py
@@ -65,7 +65,7 @@ class ir_a_msp430(ir_a_msp430_base):
             lbl = bloc.get_next()
             new_lbl = self.gen_label()
             irs = self.call_effects(pc_val)
-            irs.append([ExprAff(IRDst, ExprId(lbl, size=self.pc.size))])
+            irs.append([ExprAff(self.IRDst, ExprId(lbl, size=self.pc.size))])
             nbloc = irbloc(new_lbl, irs)
             nbloc.lines = [l]
             self.blocs[new_lbl] = nbloc