about summary refs log tree commit diff stats
path: root/miasm2/arch/msp430
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/arch/msp430')
-rw-r--r--miasm2/arch/msp430/arch.py12
-rw-r--r--miasm2/arch/msp430/sem.py54
2 files changed, 33 insertions, 33 deletions
diff --git a/miasm2/arch/msp430/arch.py b/miasm2/arch/msp430/arch.py
index 3248a4bc..1842f577 100644
--- a/miasm2/arch/msp430/arch.py
+++ b/miasm2/arch/msp430/arch.py
@@ -69,8 +69,8 @@ class msp430_arg(m_arg):
                 index = gpregs.str.index(name)
                 reg = gpregs.expr[index]
                 return reg
-            label = symbol_pool.getby_name_create(value.name)
-            return ExprLoc(label.loc_key, 16)
+            loc_key = symbol_pool.getby_name_create(value.name)
+            return ExprLoc(loc_key, 16)
         if isinstance(value, AstOp):
             args = [self.asm_ast_to_expr(tmp, symbol_pool) for tmp in value.args]
             if None in args:
@@ -107,9 +107,9 @@ class instruction_msp430(instruction):
             o = str(expr)
         elif isinstance(expr, ExprInt):
             o = str(expr)
-        elif expr.is_label():
+        elif expr.is_loc():
             if symbol_pool is not None:
-                return str(symbol_pool.loc_key_to_label(expr.loc_key))
+                return symbol_pool.str_loc_key(expr.loc_key)
             else:
                 return str(expr)
         elif isinstance(expr, ExprOp) and expr.op == "autoinc":
@@ -138,8 +138,8 @@ class instruction_msp430(instruction):
         else:
             addr = expr.arg + int(self.offset)
 
-        label = symbol_pool.getby_offset_create(addr)
-        self.args[0] = ExprLoc(label.loc_key, expr.size)
+        loc_key = symbol_pool.getby_offset_create(addr)
+        self.args[0] = ExprLoc(loc_key, expr.size)
 
     def breakflow(self):
         if self.name in conditional_branch + unconditional_branch:
diff --git a/miasm2/arch/msp430/sem.py b/miasm2/arch/msp430/sem.py
index 42f6474e..877c2a70 100644
--- a/miasm2/arch/msp430/sem.py
+++ b/miasm2/arch/msp430/sem.py
@@ -239,10 +239,10 @@ def push_w(ir, instr, a):
 def call(ir, instr, a):
     e, a, dummy = mng_autoinc(a, None, 16)
 
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
 
-    e.append(ExprAff(ExprMem(SP - ExprInt(2, 16), 16), lbl_next_expr))
+    e.append(ExprAff(ExprMem(SP - ExprInt(2, 16), 16), loc_next_expr))
     e.append(ExprAff(SP, SP - ExprInt(2, 16)))
     e.append(ExprAff(PC, a))
     e.append(ExprAff(ir.IRDst, a))
@@ -275,56 +275,56 @@ def cmp_b(ir, instr, a, b):
 
 
 def jz(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(zf, a, lbl_next_expr)))
-    e.append(ExprAff(ir.IRDst, ExprCond(zf, a, lbl_next_expr)))
+    e.append(ExprAff(PC, ExprCond(zf, a, loc_next_expr)))
+    e.append(ExprAff(ir.IRDst, ExprCond(zf, a, loc_next_expr)))
     return e, []
 
 
 def jnz(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(zf, lbl_next_expr, a)))
-    e.append(ExprAff(ir.IRDst, ExprCond(zf, lbl_next_expr, a)))
+    e.append(ExprAff(PC, ExprCond(zf, loc_next_expr, a)))
+    e.append(ExprAff(ir.IRDst, ExprCond(zf, loc_next_expr, a)))
     return e, []
 
 
 def jl(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(nf ^ of, a, lbl_next_expr)))
-    e.append(ExprAff(ir.IRDst, ExprCond(nf ^ of, a, lbl_next_expr)))
+    e.append(ExprAff(PC, ExprCond(nf ^ of, a, loc_next_expr)))
+    e.append(ExprAff(ir.IRDst, ExprCond(nf ^ of, a, loc_next_expr)))
     return e, []
 
 
 def jc(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(cf, a, lbl_next_expr)))
-    e.append(ExprAff(ir.IRDst, ExprCond(cf, a, lbl_next_expr)))
+    e.append(ExprAff(PC, ExprCond(cf, a, loc_next_expr)))
+    e.append(ExprAff(ir.IRDst, ExprCond(cf, a, loc_next_expr)))
     return e, []
 
 
 def jnc(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(cf, lbl_next_expr, a)))
-    e.append(ExprAff(ir.IRDst, ExprCond(cf, lbl_next_expr, a)))
+    e.append(ExprAff(PC, ExprCond(cf, loc_next_expr, a)))
+    e.append(ExprAff(ir.IRDst, ExprCond(cf, loc_next_expr, a)))
     return e, []
 
 
 def jge(ir, instr, a):
-    lbl_next = ir.get_next_label(instr)
-    lbl_next_expr = ExprLoc(lbl_next.loc_key, 16)
+    loc_next = ir.get_next_loc_key(instr)
+    loc_next_expr = ExprLoc(loc_next, 16)
     e = []
-    e.append(ExprAff(PC, ExprCond(nf ^ of, lbl_next_expr, a)))
-    e.append(ExprAff(ir.IRDst, ExprCond(nf ^ of, lbl_next_expr, a)))
+    e.append(ExprAff(PC, ExprCond(nf ^ of, loc_next_expr, a)))
+    e.append(ExprAff(ir.IRDst, ExprCond(nf ^ of, loc_next_expr, a)))
     return e, []