diff options
Diffstat (limited to 'src/arch/arm/v7/opdefs')
26 files changed, 1721 insertions, 0 deletions
diff --git a/src/arch/arm/v7/opdefs/Makefile.am b/src/arch/arm/v7/opdefs/Makefile.am index d576782..629cf1a 100644 --- a/src/arch/arm/v7/opdefs/Makefile.am +++ b/src/arch/arm/v7/opdefs/Makefile.am @@ -21,8 +21,33 @@ D2C_MACROS = \ -M SignExtend=sign_extend_armv7_imm ARMV7_DEFS = \ + adc_A881.d \ + add_A885.d \ + and_A8813.d \ + bic_A8821.d \ bl_A8825.d \ + bx_A8827.d \ + cmn_A8834.d \ + cmp_A8837.d \ + eor_A8846.d \ + mla_A88100.d \ + mls_A88101.d \ mov_A88104.d \ + mul_A88114.d \ + mvn_A88115.d \ + orr_A88122.d \ + rsb_A88152.d \ + rsc_A88155.d \ + sbc_A88161.d \ + smlal_A88178.d \ + smull_A88189.d \ + sub_A88222.d \ + teq_A88237.d \ + tst_A88240.d \ + umaal_A88255.d \ + umlal_A88256.d \ + umull_A88257.d \ + yield_A88426.d \ subs_B9320.d diff --git a/src/arch/arm/v7/opdefs/adc_A881.d b/src/arch/arm/v7/opdefs/adc_A881.d new file mode 100644 index 0000000..ff37ea0 --- /dev/null +++ b/src/arch/arm/v7/opdefs/adc_A881.d @@ -0,0 +1,71 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title ADC (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 1 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm(i:imm3:imm8) + + } + + @rules { + + //if ((d IN {13,15}) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 0 1 0 1 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/add_A885.d b/src/arch/arm/v7/opdefs/add_A885.d new file mode 100644 index 0000000..bacddc8 --- /dev/null +++ b/src/arch/arm/v7/opdefs/add_A885.d @@ -0,0 +1,51 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title ADD (immediate, ARM) + +@encoding(A1) { + + @word cond(4) 0 0 1 0 1 0 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rn == '1111') && (S == '0')) ; see ADR + //if (Rn == '1101') ; see ADD (SP plus immediate) + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + + } + +} diff --git a/src/arch/arm/v7/opdefs/and_A8813.d b/src/arch/arm/v7/opdefs/and_A8813.d new file mode 100644 index 0000000..f0a1740 --- /dev/null +++ b/src/arch/arm/v7/opdefs/and_A8813.d @@ -0,0 +1,72 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title AND (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 0 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see TST (immediate) + //if ((d == 13) || ((d == 15) && (S == '0')) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 0 0 0 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/bic_A8821.d b/src/arch/arm/v7/opdefs/bic_A8821.d new file mode 100644 index 0000000..6f5bd46 --- /dev/null +++ b/src/arch/arm/v7/opdefs/bic_A8821.d @@ -0,0 +1,71 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title BIC (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 0 0 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if ((d IN {13,15}) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 1 1 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/bx_A8827.d b/src/arch/arm/v7/opdefs/bx_A8827.d new file mode 100644 index 0000000..5acf969 --- /dev/null +++ b/src/arch/arm/v7/opdefs/bx_A8827.d @@ -0,0 +1,54 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title BX + +@encoding(T1) { + + + @half 0 1 0 0 0 1 1 1 0 Rm(4) 0 0 0 + + @syntax <Rm> + + @conv { + + Rm = Register(Rm) + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 Rm(4) + + @syntax {c} <Rm> + + @conv { + + c = Condition(cond) + Rm = Register(Rm) + + } + +} diff --git a/src/arch/arm/v7/opdefs/cmn_A8834.d b/src/arch/arm/v7/opdefs/cmn_A8834.d new file mode 100644 index 0000000..ff403f3 --- /dev/null +++ b/src/arch/arm/v7/opdefs/cmn_A8834.d @@ -0,0 +1,61 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title CMN (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 1 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) + + @syntax <Rn> <const> + + @conv { + + Rn = Register(Rn) + const = ThumbExpandImm(i:imm3:imm8) + + } + + @rules { + + if (Rn == '1111') ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 0 1 1 1 Rn(4) 0 0 0 0 imm12(12) + + @syntax {c} <Rn> <const> + + @conv { + + c = Condition(cond) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + +} diff --git a/src/arch/arm/v7/opdefs/cmp_A8837.d b/src/arch/arm/v7/opdefs/cmp_A8837.d new file mode 100644 index 0000000..24587df --- /dev/null +++ b/src/arch/arm/v7/opdefs/cmp_A8837.d @@ -0,0 +1,76 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title CMP (immediate) + +@encoding(T1) { + + @half 0 0 1 0 1 Rn(3) imm8(8) + + @syntax <Rn> <const> + + @conv { + + Rn = Register(Rn) + const = ZeroExtend(imm8, 8, 32) + + } + +} + +@encoding(T2) { + + @word 1 1 1 1 0 i(1) 0 1 1 0 1 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) + + @syntax <Rn> <const> + + @conv { + + Rn = Register(Rn) + const = ThumbExpandImm(i:imm3:imm8) + + } + + @rules { + + if (Rn == '1111') ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 0 1 0 1 Rn(4) 0 0 0 0 imm12(12) + + @syntax {c} <Rn> <const> + + @conv { + + c = Condition(cond) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + +} diff --git a/src/arch/arm/v7/opdefs/eor_A8846.d b/src/arch/arm/v7/opdefs/eor_A8846.d new file mode 100644 index 0000000..2c71098 --- /dev/null +++ b/src/arch/arm/v7/opdefs/eor_A8846.d @@ -0,0 +1,72 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title EOR (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 1 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see TST (immediate) + //if ((d == 13) || ((d == 15) && (S == '0')) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 0 0 0 1 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/mla_A88100.d b/src/arch/arm/v7/opdefs/mla_A88100.d new file mode 100644 index 0000000..2683e3a --- /dev/null +++ b/src/arch/arm/v7/opdefs/mla_A88100.d @@ -0,0 +1,73 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title MLA + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) Ra(4) Rd(4) 0 0 0 0 Rm(4) + + @syntax <Rd> <Rn> <Rm> <Ra> + + @conv { + + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + Ra = Register(Ra) + + } + + @rules { + + //if (Ra == '1111') ; see MUL + //if d IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 0 0 1 S(1) Rd(4) Ra(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <Rd> <Rn> <Rm> <Ra> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + Ra = Register(Ra) + + } + + @rules { + + //if d == 15 || n == 15 || m == 15 || a == 15 then UNPREDICTABLE + + } + +} diff --git a/src/arch/arm/v7/opdefs/mls_A88101.d b/src/arch/arm/v7/opdefs/mls_A88101.d new file mode 100644 index 0000000..3d55f00 --- /dev/null +++ b/src/arch/arm/v7/opdefs/mls_A88101.d @@ -0,0 +1,71 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title MLS + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) Ra(4) Rd(4) 0 0 0 1 Rm(4) + + @syntax <Rd> <Rn> <Rm> <Ra> + + @conv { + + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + Ra = Register(Ra) + + } + + @rules { + + //if d IN {13,15} || n IN {13,15} || m IN {13,15} || a IN {13,15} then UNPREDICTABLE + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 0 1 1 0 Rd(4) Ra(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {c} <Rd> <Rn> <Rm> <Ra> + + @conv { + + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + Ra = Register(Ra) + + } + + @rules { + + //if d == 15 || n == 15 || m == 15 || a == 15 then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/mul_A88114.d b/src/arch/arm/v7/opdefs/mul_A88114.d new file mode 100644 index 0000000..ca75e25 --- /dev/null +++ b/src/arch/arm/v7/opdefs/mul_A88114.d @@ -0,0 +1,85 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title MUL + +@encoding(T1) { + + @half 0 1 0 0 0 0 1 1 0 1 Rn(3) Rdm(3) + + @syntax <Rdm> <Rn> <Rdm> + + @conv { + + Rdm = Register(Rdm) + Rn = Register(Rn) + + } + +} + +@encoding(T2) { + + @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) + + @syntax <Rd> <Rn> <Rm> + + @conv { + + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if d IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 0 0 0 S(1) Rd(4) 0 0 0 0 Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <Rd> <Rn> <Rm> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if d == 15 || n == 15 || m == 15 then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/mvn_A88115.d b/src/arch/arm/v7/opdefs/mvn_A88115.d new file mode 100644 index 0000000..32e96b3 --- /dev/null +++ b/src/arch/arm/v7/opdefs/mvn_A88115.d @@ -0,0 +1,69 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title MVN (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 0 1 1 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if (d IN {13,15}) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 1 1 1 S(1) 0 0 0 0 Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + const = ARMExpandImm_C(imm12, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/orr_A88122.d b/src/arch/arm/v7/opdefs/orr_A88122.d new file mode 100644 index 0000000..937c902 --- /dev/null +++ b/src/arch/arm/v7/opdefs/orr_A88122.d @@ -0,0 +1,72 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title ORR (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + if (Rn == '1111') ; see MOV (immediate) + //if ((d IN {13,15}) || (n == 13)) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 1 0 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/rsb_A88152.d b/src/arch/arm/v7/opdefs/rsb_A88152.d new file mode 100644 index 0000000..320d62e --- /dev/null +++ b/src/arch/arm/v7/opdefs/rsb_A88152.d @@ -0,0 +1,87 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title RSB (immediate) + +@encoding(T1) { + + @half 0 1 0 0 0 0 1 0 0 1 Rn(3) Rd(3) + + @syntax <Rd> <Rn> <zero> + + @conv { + + Rd = Register(Rd) + Rn = Register(Rn) + zero = Zeros(32) + + } + +} + +@encoding(T2) { + + @word 1 1 1 1 0 i(1) 0 1 1 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm(i:imm3:imm8) + + } + + @rules { + + //if ((d IN {13,15}) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 0 0 1 1 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/rsc_A88155.d b/src/arch/arm/v7/opdefs/rsc_A88155.d new file mode 100644 index 0000000..440f224 --- /dev/null +++ b/src/arch/arm/v7/opdefs/rsc_A88155.d @@ -0,0 +1,48 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title RSC (immediate) + +@encoding(A1) { + + @word cond(4) 0 0 1 0 1 1 1 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/sbc_A88161.d b/src/arch/arm/v7/opdefs/sbc_A88161.d new file mode 100644 index 0000000..517ea01 --- /dev/null +++ b/src/arch/arm/v7/opdefs/sbc_A88161.d @@ -0,0 +1,71 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title SBC (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 1 0 1 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) + + @syntax {S} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + Rd = Register(Rd) + Rn = Register(Rn) + const = ThumbExpandImm(i:imm3:imm8) + + } + + @rules { + + //if ((d IN {13,15}) || (n IN {13,15})) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 0 1 1 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + } + +} diff --git a/src/arch/arm/v7/opdefs/smlal_A88178.d b/src/arch/arm/v7/opdefs/smlal_A88178.d new file mode 100644 index 0000000..a3a36aa --- /dev/null +++ b/src/arch/arm/v7/opdefs/smlal_A88178.d @@ -0,0 +1,74 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title SMLAL + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 1 1 0 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) + + @syntax <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo IN {13,15} || dHi IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 1 1 1 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/smull_A88189.d b/src/arch/arm/v7/opdefs/smull_A88189.d new file mode 100644 index 0000000..15fc195 --- /dev/null +++ b/src/arch/arm/v7/opdefs/smull_A88189.d @@ -0,0 +1,74 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title SMULL + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 1 0 0 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) + + @syntax <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo IN {13,15} || dHi IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 1 1 0 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/sub_A88222.d b/src/arch/arm/v7/opdefs/sub_A88222.d new file mode 100644 index 0000000..5564a07 --- /dev/null +++ b/src/arch/arm/v7/opdefs/sub_A88222.d @@ -0,0 +1,51 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title SUB (immediate, ARM) + +@encoding(A1) { + + @word cond(4) 0 0 1 0 0 1 0 S(1) Rn(4) Rd(4) imm12(12) + + @syntax {S} {c} <Rd> <Rn> <const> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + Rd = Register(Rd) + Rn = Register(Rn) + const = ARMExpandImm(imm12) + + } + + @rules { + + //if ((Rn == '1111') && (S == '0')) ; see ADR + //if (Rn == '1101') ; see SUB (SP minus immediate) + //if ((Rd == '1111') && (S == '1')) ; see SUBS PC, LR and related instructions + + + } + +} diff --git a/src/arch/arm/v7/opdefs/teq_A88237.d b/src/arch/arm/v7/opdefs/teq_A88237.d new file mode 100644 index 0000000..96ac2cb --- /dev/null +++ b/src/arch/arm/v7/opdefs/teq_A88237.d @@ -0,0 +1,61 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title TEQ (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 1 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) + + @syntax <Rn> <const> + + @conv { + + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if (n IN {13,15}) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 0 0 1 1 Rn(4) 0 0 0 0 imm12(12) + + @syntax {c} <Rn> <const> + + @conv { + + c = Condition(cond) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + +} diff --git a/src/arch/arm/v7/opdefs/tst_A88240.d b/src/arch/arm/v7/opdefs/tst_A88240.d new file mode 100644 index 0000000..9d4a8f9 --- /dev/null +++ b/src/arch/arm/v7/opdefs/tst_A88240.d @@ -0,0 +1,61 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title TST (immediate) + +@encoding(T1) { + + @word 1 1 1 1 0 i(1) 0 0 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) + + @syntax <Rn> <const> + + @conv { + + Rn = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, 0) + + } + + @rules { + + //if (n IN {13,15}) ; unpredictable + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 0 0 0 1 Rn(4) 0 0 0 0 imm12(12) + + @syntax {c} <Rn> <const> + + @conv { + + c = Condition(cond) + Rn = Register(Rn) + const = ARMExpandImm_C(imm12, 0) + + } + +} diff --git a/src/arch/arm/v7/opdefs/umaal_A88255.d b/src/arch/arm/v7/opdefs/umaal_A88255.d new file mode 100644 index 0000000..404f56f --- /dev/null +++ b/src/arch/arm/v7/opdefs/umaal_A88255.d @@ -0,0 +1,73 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title UMAAL + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 1 1 1 0 Rn(4) RdLo(4) RdHi(4) 0 1 1 0 Rm(4) + + @syntax <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo IN {13,15} || dHi IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 0 1 0 0 RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {c} <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + c = Condition(cond) + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/umlal_A88256.d b/src/arch/arm/v7/opdefs/umlal_A88256.d new file mode 100644 index 0000000..fc17078 --- /dev/null +++ b/src/arch/arm/v7/opdefs/umlal_A88256.d @@ -0,0 +1,74 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title UMLAL + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 1 1 1 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) + + @syntax <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo IN {13,15} || dHi IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 1 0 1 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/umull_A88257.d b/src/arch/arm/v7/opdefs/umull_A88257.d new file mode 100644 index 0000000..ffed80b --- /dev/null +++ b/src/arch/arm/v7/opdefs/umull_A88257.d @@ -0,0 +1,74 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title UMULL + +@encoding(T1) { + + @word 1 1 1 1 1 0 1 1 1 0 1 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) + + @syntax <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo IN {13,15} || dHi IN {13,15} || n IN {13,15} || m IN {13,15} then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} + +@encoding(A1) { + + @word cond(4) 0 0 0 0 1 0 0 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) + + @syntax {S} {c} <RdLo> <RdHi> <Rn> <Rm> + + @conv { + + S = SetFlags(S) + c = Condition(cond) + RdLo = Register(RdLo) + RdHi = Register(RdHi) + Rn = Register(Rn) + Rm = Register(Rm) + + } + + @rules { + + //if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE; + //if dHi == dLo then UNPREDICTABLE; + + } + +} diff --git a/src/arch/arm/v7/opdefs/yield_A88426.d b/src/arch/arm/v7/opdefs/yield_A88426.d new file mode 100644 index 0000000..6de27d1 --- /dev/null +++ b/src/arch/arm/v7/opdefs/yield_A88426.d @@ -0,0 +1,50 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions ARMv7 + * + * Copyright (C) 2014 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title YIELD + +@encoding(T1) { + + @half 1 0 1 1 1 1 1 1 0 0 0 1 0 0 0 0 + +} + +@encoding(T2) { + + @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 + +} + +@encoding(A1) { + + @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 + + @syntax {c} + + @conv { + + c = Condition(cond) + + } + +} |