diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-08-05 17:08:02 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-08-06 18:58:07 +0200 |
| commit | 6371ea954eedb31ab723f1a396c303cda94742fb (patch) | |
| tree | ebd5cf3da882237e56840f2461d53054c8019673 | |
| parent | f2f40b1e42ce79fc3ffcf13b83c971e8a26f6bda (diff) | |
| download | miasm-6371ea954eedb31ab723f1a396c303cda94742fb.tar.gz miasm-6371ea954eedb31ab723f1a396c303cda94742fb.zip | |
ARM: add msr/mrs for eflag
| -rw-r--r-- | miasm2/arch/arm/sem.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/miasm2/arch/arm/sem.py b/miasm2/arch/arm/sem.py index 86b3721f..4e99e720 100644 --- a/miasm2/arch/arm/sem.py +++ b/miasm2/arch/arm/sem.py @@ -513,6 +513,33 @@ def mvns(ir, instr, a, b): return e, [] + +def mrs(ir, instr, a, b): + e = [] + if b.is_id('CPSR_cxsf'): + out = [] + out.append(ExprInt(0x10, 28)) + out.append(of) + out.append(cf) + out.append(zf) + out.append(nf) + e.append(ExprAff(a, ExprCompose(*out))) + else: + raise NotImplementedError("MSR not implemented") + return e, [] + +def msr(ir, instr, a, b): + e = [] + if a.is_id('CPSR_cf'): + e.append(ExprAff(nf, b[31:32])) + e.append(ExprAff(zf, b[30:31])) + e.append(ExprAff(cf, b[29:30])) + e.append(ExprAff(of, b[28:29])) + else: + raise NotImplementedError("MRS not implemented") + return e, [] + + def neg(ir, instr, a, b): e = [] r = - b @@ -1504,6 +1531,10 @@ mnemo_condm1 = {'adds': add, 'movs': movs, 'bics': bics, 'mvns': mvns, + + 'mrs': mrs, + 'msr': msr, + 'negs': negs, 'muls': muls, |