summaryrefslogtreecommitdiff
path: root/src/arch/arm/v456/instruction-def.h
blob: 7558a867187047318352071f9a37553bdbf0108a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

/* Chrysalide - Outil d'analyse de fichiers binaires
 * instruction-def.h - définition interne des identifiants d'instructions ARM v4/5/6
 *
 * Copyright (C) 2013 Cyrille Bagard
 *
 *  This file is part of Chrysalide.
 *
 *  OpenIDA 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.
 *
 *  OpenIDA 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/>.
 */


#ifndef _ARCH_ARM_V456_INSTRUCTION_DEF_H
#define _ARCH_ARM_V456_INSTRUCTION_DEF_H





/**
 * ARM Architecture Reference Manual.
 * A4.2 ARM instructions and architecture versions.
 */

#define ARM_VERSION_4       (1 << 1)
#define ARM_VERSION_V4T     (1 << 2)
#define ARM_VERSION_V5T     (1 << 3)
#define ARM_VERSION_V5TE    (1 << 4)
#define ARM_VERSION_V5TEJ   (1 << 5)
#define ARM_VERSION_V6      (1 << 6)
#define ARM_VERSION_V5TEXP  (1 << 7)

#define ARM_VERSION_ALL_456 (ARM_VERSION_4          \
                             | ARM_VERSION_V4T      \
                             | ARM_VERSION_V5T      \
                             | ARM_VERSION_V5TE     \
                             | ARM_VERSION_V5TEJ    \
                             | ARM_VERSION_V6       \
                             | ARM_VERSION_V5TEXP)




/* Enumération de tous les opcodes */
typedef enum _ArmV456Opcodes
{
    /**
     * ARM Architecture Reference Manual.
     * § A3.4 Data-processing instructions.
     */

    AOP_AND,                                /* and (0x00)                  */
    AOP_EOR,                                /* eor (0x01)                  */
    AOP_SUB,                                /* sub (0x02)                  */
    AOP_RSB,                                /* rsb (0x03)                  */
    AOP_ADD,                                /* add (0x04)                  */
    AOP_ADC,                                /* adc (0x05)                  */
    AOP_SBC,                                /* sbc (0x06)                  */
    AOP_RSC,                                /* rsc (0x07)                  */
    AOP_TST,                                /* tst (0x08)                  */
    AOP_TEQ,                                /* teq (0x09)                  */
    AOP_CMP,                                /* cmp (0x0a)                  */
    AOP_CMN,                                /* cmn (0x0b)                  */
    AOP_ORR,                                /* orr (0x0c)                  */
    AOP_MOV,                                /* mov (0x0d)                  */
    AOP_BIC,                                /* bic (0x0e)                  */
    AOP_MVN,                                /* mvn (0x0f)                  */


    AOP_LDR,
    AOP_STR,


    AOP_COUNT

} ArmV456Opcodes;



#endif  /* _ARCH_ARM_V456_INSTRUCTION_DEF_H */