diff options
Diffstat (limited to 'miasm2/arch/sh4/arch.py')
| -rw-r--r-- | miasm2/arch/sh4/arch.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/miasm2/arch/sh4/arch.py b/miasm2/arch/sh4/arch.py index 634cbf43..3d0eee00 100644 --- a/miasm2/arch/sh4/arch.py +++ b/miasm2/arch/sh4/arch.py @@ -38,7 +38,7 @@ def ast_id2expr(t): return mn_sh4.regs.all_regs_ids_byname.get(t, t) def ast_int2expr(a): - return ExprInt32(a) + return ExprInt(a, 32) my_var_parser = ParseAst(ast_id2expr, ast_int2expr) @@ -219,7 +219,7 @@ class sh4_dgpreg_imm(sh4_dgpreg): p = self.parent r = gpregs.expr[v] s = self.sz - d = ExprInt32(p.disp.value * s / 8) + d = ExprInt(p.disp.value * s / 8, 32) e = ExprMem(r + d, s) self.expr = e return True @@ -263,7 +263,7 @@ class sh4_simm(sh4_imm): def decode(self, v): v = sign_ext(v, self.l, 32) v = self.decodeval(v) - self.expr = ExprInt32(v) + self.expr = ExprInt(v, 32) return True def encode(self): @@ -281,7 +281,7 @@ class sh4_dpc16imm(sh4_dgpreg): parser = deref_pc def decode(self, v): - self.expr = ExprMem(PC + ExprInt32(v * 2 + 4), 16) + self.expr = ExprMem(PC + ExprInt(v * 2 + 4, 32), 16) return True def calcdisp(self, v): @@ -308,7 +308,7 @@ class sh4_dgbrimm8(sh4_dgpreg): def decode(self, v): s = self.sz - self.expr = ExprMem(GBR + ExprInt32(v * s / 8), s) + self.expr = ExprMem(GBR + ExprInt(v * s / 8, 32), s) return True def encode(self): @@ -331,7 +331,7 @@ class sh4_dpc32imm(sh4_dpc16imm): def decode(self, v): self.expr = ExprMem( - (PC & ExprInt32(0xfffffffc)) + ExprInt32(v * 4 + 4)) + (PC & ExprInt(0xfffffffc, 32)) + ExprInt(v * 4 + 4, 32)) return True def calcdisp(self, v): @@ -342,7 +342,7 @@ class sh4_dpc32imm(sh4_dpc16imm): def encode(self): res = MatchExpr( - self.expr, ExprMem((PC & ExprInt32(0xFFFFFFFC)) + jra, 32), [jra]) + self.expr, ExprMem((PC & ExprInt(0xFFFFFFFC, 32)) + jra, 32), [jra]) if not res: return False if not isinstance(res[jra], ExprInt): @@ -358,11 +358,11 @@ class sh4_pc32imm(m_arg): parser = pcdisp def decode(self, v): - self.expr = (PC & ExprInt32(0xfffffffc)) + ExprInt32(v * 4 + 4) + self.expr = (PC & ExprInt(0xfffffffc, 32)) + ExprInt(v * 4 + 4, 32) return True def encode(self): - res = MatchExpr(self.expr, (PC & ExprInt32(0xfffffffc)) + jra, [jra]) + res = MatchExpr(self.expr, (PC & ExprInt(0xfffffffc, 32)) + jra, [jra]) if not res: return False if not isinstance(res[jra], ExprInt): @@ -455,7 +455,7 @@ class instruction_sh4(instruction): print hex(off) if int(off % 4): raise ValueError('strange offset! %r' % off) - self.args[0] = ExprInt32(off) + self.args[0] = ExprInt(off, 32) print 'final', self.args[0] def get_args_expr(self): |