diff options
| author | Ajax <commial@gmail.com> | 2017-03-29 15:44:15 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-03-30 16:04:40 +0200 |
| commit | f81c3e4b42d0ce487101b8e0802e43b32b261b1d (patch) | |
| tree | 91fcd0b4317685bc4685acbb17affc3ec0f78afc /miasm2/arch/msp430/sem.py | |
| parent | fd76e24c84825072ce18cab33fbcc496bd4d8d65 (diff) | |
| download | miasm-f81c3e4b42d0ce487101b8e0802e43b32b261b1d.tar.gz miasm-f81c3e4b42d0ce487101b8e0802e43b32b261b1d.zip | |
Replace ExprInt[num](x) -> ExprInt(x, num)
Diffstat (limited to 'miasm2/arch/msp430/sem.py')
| -rw-r--r-- | miasm2/arch/msp430/sem.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/miasm2/arch/msp430/sem.py b/miasm2/arch/msp430/sem.py index e8eb91cc..5bf2999f 100644 --- a/miasm2/arch/msp430/sem.py +++ b/miasm2/arch/msp430/sem.py @@ -53,7 +53,7 @@ def update_flag_zn_r(a): def update_flag_sub_cf(a, b, c): return [ExprAff(cf, - ((((a ^ b) ^ c) ^ ((a ^ c) & (a ^ b))).msb()) ^ ExprInt1(1))] + ((((a ^ b) ^ c) ^ ((a ^ c) & (a ^ b))).msb()) ^ ExprInt(1, 1))] def update_flag_add_cf(a, b, c): @@ -77,7 +77,7 @@ def mng_autoinc(a, b, size): e.append(ExprAff(a_r, a_r + ExprInt(size / 8, a_r.size))) a = ExprMem(a_r, size) if isinstance(b, ExprMem) and a_r in b.arg: - b = ExprMem(b.arg + ExprInt16(size / 8), b.size) + b = ExprMem(b.arg + ExprInt(size / 8, 16), b.size) return e, a, b # Mnemonics @@ -108,7 +108,7 @@ def and_b(ir, instr, a, b): e.append(ExprAff(b, c.zeroExtend(16))) e += update_flag_zn_r(c) e += update_flag_cf_inv_zf(c) - e += [ExprAff(of, ExprInt1(0))] + e += [ExprAff(of, ExprInt(0, 1))] return e, [] @@ -118,13 +118,13 @@ def and_w(ir, instr, a, b): e.append(ExprAff(b, c)) e += update_flag_zn_r(c) e += update_flag_cf_inv_zf(c) - e += [ExprAff(of, ExprInt1(0))] + e += [ExprAff(of, ExprInt(0, 1))] return e, [] def bic_b(ir, instr, a, b): e, a, b = mng_autoinc(a, b, 8) - c = (a[:8] ^ ExprInt8(0xff)) & b[:8] + c = (a[:8] ^ ExprInt(0xff, 8)) & b[:8] c = c.zeroExtend(b.size) e.append(ExprAff(b, c)) return e, [] @@ -132,7 +132,7 @@ def bic_b(ir, instr, a, b): def bic_w(ir, instr, a, b): e, a, b = mng_autoinc(a, b, 16) - c = (a ^ ExprInt16(0xffff)) & b + c = (a ^ ExprInt(0xffff, 16)) & b e.append(ExprAff(b, c)) return e, [] @@ -149,7 +149,7 @@ def bit_w(ir, instr, a, b): c = a & b e += update_flag_zn_r(c) e += update_flag_cf_inv_zf(c) - e.append(ExprAff(of, ExprInt1(0))) + e.append(ExprAff(of, ExprInt(0, 1))) return e, [] """ @@ -231,16 +231,16 @@ def xor_w(ir, instr, a, b): def push_w(ir, instr, a): e = [] - e.append(ExprAff(ExprMem(SP - ExprInt16(2), 16), a)) - e.append(ExprAff(SP, SP - ExprInt16(2))) + e.append(ExprAff(ExprMem(SP - ExprInt(2, 16), 16), a)) + e.append(ExprAff(SP, SP - ExprInt(2, 16))) return e, [] def call(ir, instr, a): e, a, dummy = mng_autoinc(a, None, 16) n = ExprId(ir.get_next_label(instr), 16) - e.append(ExprAff(ExprMem(SP - ExprInt16(2), 16), n)) - e.append(ExprAff(SP, SP - ExprInt16(2))) + e.append(ExprAff(ExprMem(SP - ExprInt(2, 16), 16), n)) + e.append(ExprAff(SP, SP - ExprInt(2, 16))) e.append(ExprAff(PC, a)) e.append(ExprAff(ir.IRDst, a)) return e, [] @@ -338,7 +338,7 @@ def rrc_w(ir, instr, a): # e += update_flag_nf(a) e += reset_sr_res() - e.append(ExprAff(of, ExprInt1(0))) + e.append(ExprAff(of, ExprInt(0, 1))) return e, [] @@ -355,7 +355,7 @@ def rra_w(ir, instr, a): # e += update_flag_nf(a) e += reset_sr_res() - e.append(ExprAff(of, ExprInt1(0))) + e.append(ExprAff(of, ExprInt(0, 1))) return e, [] @@ -366,7 +366,7 @@ def sxt(ir, instr, a): e += update_flag_zn_r(c) e += update_flag_cf_inv_zf(c) - e.append(ExprAff(of, ExprInt1(0))) + e.append(ExprAff(of, ExprInt(0, 1))) return e, [] @@ -441,7 +441,7 @@ class ir_msp430(IntermediateRepresentation): instr_ir[i:i+1] = xx for i, x in enumerate(instr_ir): x = ExprAff(x.dst, x.src.replace_expr( - {self.pc: ExprInt16(instr.offset + instr.l)})) + {self.pc: ExprInt(instr.offset + instr.l, 16)})) instr_ir[i] = x if extra_ir: |