ROSE  0.11.101.0
InstructionEnumsX86.h
1 /* Enum constants for Intel x86 architectures */
2 #ifndef ROSE_BinaryAnalysis_InstructionEnumsX86_H
3 #define ROSE_BinaryAnalysis_InstructionEnumsX86_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 
7 #include "AssemblerX86Init.h" /* A big enum whose members are all possible x86 instructions. */
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 
13 enum X86InstructionSize {
14  x86_insnsize_none,
15  x86_insnsize_16,
16  x86_insnsize_32,
17  x86_insnsize_64
18 };
19 
21 enum X86RegisterClass {
22  x86_regclass_gpr,
24  x86_regclass_segment,
25  x86_regclass_cr,
26  x86_regclass_dr,
27  x86_regclass_st,
28  x86_regclass_xmm,
29  x86_regclass_ip,
30  x86_regclass_flags
31 };
32 
34 enum X86SegmentRegister {
35  x86_segreg_es = 0, // Numbering is based on Intel documentation
36  x86_segreg_cs = 1,
37  x86_segreg_ss = 2,
38  x86_segreg_ds = 3,
39  x86_segreg_fs = 4,
40  x86_segreg_gs = 5,
41  x86_segreg_none = 16 /* For unspecified segment overrides */
42 };
43 
45 enum X86GeneralPurposeRegister {
46  x86_gpr_ax = 0, // Numbering is based on Intel documentation
47  x86_gpr_cx = 1,
48  x86_gpr_dx = 2,
49  x86_gpr_bx = 3,
50  x86_gpr_sp = 4,
51  x86_gpr_bp = 5,
52  x86_gpr_si = 6,
53  x86_gpr_di = 7,
54  x86_gpr_r8 = 8,
55  x86_gpr_r9 = 9,
56  x86_gpr_r10 = 10,
57  x86_gpr_r11 = 11,
58  x86_gpr_r12 = 12,
59  x86_gpr_r13 = 13,
60  x86_gpr_r14 = 14,
61  x86_gpr_r15 = 15
62 };
63 
65 enum X86StRegister {
66  x86_st_0 = 0,
67  x86_st_1 = 1,
68  x86_st_2 = 2,
69  x86_st_3 = 3,
70  x86_st_4 = 4,
71  x86_st_5 = 5,
72  x86_st_6 = 6,
73  x86_st_7 = 7,
74  x86_st_nregs = 8 // number of ST registers
75 };
76 
78 enum X86Flags {
79  x86_flags_status = 0, // general-purpose status flags
80  x86_flags_fpstatus = 1, // floating-point status flags
81  x86_flags_fptag = 2, // floating-point tag register
82  x86_flags_fpctl = 3, // floating-point control register
83  x86_flags_mxcsr = 4 // SSE control and status register
84 };
85 
87 enum X86Flag {
88  x86_flag_cf = 0,
89  x86_flag_pf = 2,
90  x86_flag_af = 4,
91  x86_flag_zf = 6,
92  x86_flag_sf = 7,
93  x86_flag_tf = 8,
94  x86_flag_if = 9,
95  x86_flag_df = 10,
96  x86_flag_of = 11,
97  x86_flag_iopl = 12, /* 2 bits, 12 and 13 */
98  x86_flag_nt = 14,
99  x86_flag_rf = 16,
100  x86_flag_vm = 17,
101  x86_flag_ac = 18,
102  x86_flag_vif = 19,
103  x86_flag_vip = 20,
104  x86_flag_id = 21
105 };
106 
108 enum X86BranchPrediction
109 {
110  x86_branch_prediction_none,
111  x86_branch_prediction_taken,
112  x86_branch_prediction_not_taken
113 };
114 
116 enum X86RepeatPrefix
117 {
118  x86_repeat_none,
119  x86_repeat_repne,
120  x86_repeat_repe
121 };
122 
125 enum X86Exception {
126  x86_exception_int,
127  x86_exception_sysenter,
128  x86_exception_syscall,
129  x86_exception_de,
130  x86_exception_db,
131  x86_exception_bp,
132  x86_exception_of,
133  x86_exception_br,
134  x86_exception_ud,
135  x86_exception_nm,
137  x86_exception_df,
139  x86_exception_ts,
140  x86_exception_np,
142  x86_exception_ss,
143  x86_exception_gp,
145  x86_exception_pf,
146  x86_exception_mf,
148  x86_exception_ac,
149  x86_exception_mc,
150  x86_exception_xm
152 };
153 
154 } // namespace
155 } // namespace
156 
157 #endif
158 #endif
Main namespace for the ROSE library.
Binary analysis.