1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Table of relevant information about how to decode the ModR/M byte.
6 // Based on information in the IA-32 Intel Architecture
7 // Software Developer's Manual Volume 2: Instruction Set Reference.
9 #include "sandbox/win/src/sidestep/mini_disassembler.h"
10 #include "sandbox/win/src/sidestep/mini_disassembler_types.h"
14 const ModrmEntry
MiniDisassembler::s_ia16_modrm_map_
[] = {
16 /* r/m == 000 */ { false, false, OS_ZERO
},
17 /* r/m == 001 */ { false, false, OS_ZERO
},
18 /* r/m == 010 */ { false, false, OS_ZERO
},
19 /* r/m == 011 */ { false, false, OS_ZERO
},
20 /* r/m == 100 */ { false, false, OS_ZERO
},
21 /* r/m == 101 */ { false, false, OS_ZERO
},
22 /* r/m == 110 */ { true, false, OS_WORD
},
23 /* r/m == 111 */ { false, false, OS_ZERO
},
25 /* r/m == 000 */ { true, false, OS_BYTE
},
26 /* r/m == 001 */ { true, false, OS_BYTE
},
27 /* r/m == 010 */ { true, false, OS_BYTE
},
28 /* r/m == 011 */ { true, false, OS_BYTE
},
29 /* r/m == 100 */ { true, false, OS_BYTE
},
30 /* r/m == 101 */ { true, false, OS_BYTE
},
31 /* r/m == 110 */ { true, false, OS_BYTE
},
32 /* r/m == 111 */ { true, false, OS_BYTE
},
34 /* r/m == 000 */ { true, false, OS_WORD
},
35 /* r/m == 001 */ { true, false, OS_WORD
},
36 /* r/m == 010 */ { true, false, OS_WORD
},
37 /* r/m == 011 */ { true, false, OS_WORD
},
38 /* r/m == 100 */ { true, false, OS_WORD
},
39 /* r/m == 101 */ { true, false, OS_WORD
},
40 /* r/m == 110 */ { true, false, OS_WORD
},
41 /* r/m == 111 */ { true, false, OS_WORD
},
43 /* r/m == 000 */ { false, false, OS_ZERO
},
44 /* r/m == 001 */ { false, false, OS_ZERO
},
45 /* r/m == 010 */ { false, false, OS_ZERO
},
46 /* r/m == 011 */ { false, false, OS_ZERO
},
47 /* r/m == 100 */ { false, false, OS_ZERO
},
48 /* r/m == 101 */ { false, false, OS_ZERO
},
49 /* r/m == 110 */ { false, false, OS_ZERO
},
50 /* r/m == 111 */ { false, false, OS_ZERO
}
53 const ModrmEntry
MiniDisassembler::s_ia32_modrm_map_
[] = {
55 /* r/m == 000 */ { false, false, OS_ZERO
},
56 /* r/m == 001 */ { false, false, OS_ZERO
},
57 /* r/m == 010 */ { false, false, OS_ZERO
},
58 /* r/m == 011 */ { false, false, OS_ZERO
},
59 /* r/m == 100 */ { false, true, OS_ZERO
},
60 /* r/m == 101 */ { true, false, OS_DOUBLE_WORD
},
61 /* r/m == 110 */ { false, false, OS_ZERO
},
62 /* r/m == 111 */ { false, false, OS_ZERO
},
64 /* r/m == 000 */ { true, false, OS_BYTE
},
65 /* r/m == 001 */ { true, false, OS_BYTE
},
66 /* r/m == 010 */ { true, false, OS_BYTE
},
67 /* r/m == 011 */ { true, false, OS_BYTE
},
68 /* r/m == 100 */ { true, true, OS_BYTE
},
69 /* r/m == 101 */ { true, false, OS_BYTE
},
70 /* r/m == 110 */ { true, false, OS_BYTE
},
71 /* r/m == 111 */ { true, false, OS_BYTE
},
73 /* r/m == 000 */ { true, false, OS_DOUBLE_WORD
},
74 /* r/m == 001 */ { true, false, OS_DOUBLE_WORD
},
75 /* r/m == 010 */ { true, false, OS_DOUBLE_WORD
},
76 /* r/m == 011 */ { true, false, OS_DOUBLE_WORD
},
77 /* r/m == 100 */ { true, true, OS_DOUBLE_WORD
},
78 /* r/m == 101 */ { true, false, OS_DOUBLE_WORD
},
79 /* r/m == 110 */ { true, false, OS_DOUBLE_WORD
},
80 /* r/m == 111 */ { true, false, OS_DOUBLE_WORD
},
82 /* r/m == 000 */ { false, false, OS_ZERO
},
83 /* r/m == 001 */ { false, false, OS_ZERO
},
84 /* r/m == 010 */ { false, false, OS_ZERO
},
85 /* r/m == 011 */ { false, false, OS_ZERO
},
86 /* r/m == 100 */ { false, false, OS_ZERO
},
87 /* r/m == 101 */ { false, false, OS_ZERO
},
88 /* r/m == 110 */ { false, false, OS_ZERO
},
89 /* r/m == 111 */ { false, false, OS_ZERO
},
92 }; // namespace sidestep