VirtualBox

source: vbox/trunk/src/VBox/Disassembler/DisasmInternal.h@ 41690

Last change on this file since 41690 was 41690, checked in by vboxsync, 12 years ago

DIS: More cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.1 KB
Line 
1/* $Id: DisasmInternal.h 41690 2012-06-13 18:12:25Z vboxsync $ */
2/** @file
3 * VBox disassembler - Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___DisasmInternal_h___
19#define ___DisasmInternal_h___
20
21#include <VBox/types.h>
22#include <VBox/dis.h>
23
24
25/** @defgroup grp_dis_int Internals.
26 * @ingroup grp_dis
27 * @{
28 */
29
30/** @name Index into g_apfnCalcSize and g_apfnFullDisasm.
31 * @{ */
32#define IDX_ParseNop 0
33#define IDX_ParseModRM 1
34#define IDX_UseModRM 2
35#define IDX_ParseImmByte 3
36#define IDX_ParseImmBRel 4
37#define IDX_ParseImmUshort 5
38#define IDX_ParseImmV 6
39#define IDX_ParseImmVRel 7
40#define IDX_ParseImmAddr 8
41#define IDX_ParseFixedReg 9
42#define IDX_ParseImmUlong 10
43#define IDX_ParseImmQword 11
44#define IDX_ParseTwoByteEsc 12
45#define IDX_ParseImmGrpl 13
46#define IDX_ParseShiftGrp2 14
47#define IDX_ParseGrp3 15
48#define IDX_ParseGrp4 16
49#define IDX_ParseGrp5 17
50#define IDX_Parse3DNow 18
51#define IDX_ParseGrp6 19
52#define IDX_ParseGrp7 20
53#define IDX_ParseGrp8 21
54#define IDX_ParseGrp9 22
55#define IDX_ParseGrp10 23
56#define IDX_ParseGrp12 24
57#define IDX_ParseGrp13 25
58#define IDX_ParseGrp14 26
59#define IDX_ParseGrp15 27
60#define IDX_ParseGrp16 28
61#define IDX_ParseModFence 29
62#define IDX_ParseYv 30
63#define IDX_ParseYb 31
64#define IDX_ParseXv 32
65#define IDX_ParseXb 33
66#define IDX_ParseEscFP 34
67#define IDX_ParseNopPause 35
68#define IDX_ParseImmByteSX 36
69#define IDX_ParseImmZ 37
70#define IDX_ParseThreeByteEsc4 38
71#define IDX_ParseThreeByteEsc5 39
72#define IDX_ParseImmAddrF 40
73#define IDX_ParseMax (IDX_ParseImmAddrF+1)
74/** @} */
75
76
77/** @name Opcode maps.
78 * @{ */
79extern const DISOPCODE g_InvalidOpcode[1];
80
81extern const DISOPCODE g_aOneByteMapX86[256];
82extern const DISOPCODE g_aOneByteMapX64[256];
83extern const DISOPCODE g_aTwoByteMapX86[256];
84
85/** Two byte opcode map with prefix 0x66 */
86extern const DISOPCODE g_aTwoByteMapX86_PF66[256];
87
88/** Two byte opcode map with prefix 0xF2 */
89extern const DISOPCODE g_aTwoByteMapX86_PFF2[256];
90
91/** Two byte opcode map with prefix 0xF3 */
92extern const DISOPCODE g_aTwoByteMapX86_PFF3[256];
93
94/** Three byte opcode map (0xF 0x38) */
95extern PCDISOPCODE const g_apThreeByteMapX86_0F38[16];
96
97/** Three byte opcode map with prefix 0x66 (0xF 0x38) */
98extern PCDISOPCODE const g_apThreeByteMapX86_660F38[16];
99
100/** Three byte opcode map with prefix 0xF2 (0xF 0x38) */
101extern PCDISOPCODE const g_apThreeByteMapX86_F20F38[16];
102
103/** Three byte opcode map with prefix 0x66 (0xF 0x3A) */
104extern PCDISOPCODE const g_apThreeByteMapX86_660F3A[16];
105/** @} */
106
107/** @name Opcode extensions (Group tables)
108 * @{ */
109extern const DISOPCODE g_aMapX86_Group1[8*4];
110extern const DISOPCODE g_aMapX86_Group2[8*6];
111extern const DISOPCODE g_aMapX86_Group3[8*2];
112extern const DISOPCODE g_aMapX86_Group4[8];
113extern const DISOPCODE g_aMapX86_Group5[8];
114extern const DISOPCODE g_aMapX86_Group6[8];
115extern const DISOPCODE g_aMapX86_Group7_mem[8];
116extern const DISOPCODE g_aMapX86_Group7_mod11_rm000[8];
117extern const DISOPCODE g_aMapX86_Group7_mod11_rm001[8];
118extern const DISOPCODE g_aMapX86_Group8[8];
119extern const DISOPCODE g_aMapX86_Group9[8];
120extern const DISOPCODE g_aMapX86_Group10[8];
121extern const DISOPCODE g_aMapX86_Group11[8*2];
122extern const DISOPCODE g_aMapX86_Group12[8*2];
123extern const DISOPCODE g_aMapX86_Group13[8*2];
124extern const DISOPCODE g_aMapX86_Group14[8*2];
125extern const DISOPCODE g_aMapX86_Group15_mem[8];
126extern const DISOPCODE g_aMapX86_Group15_mod11_rm000[8];
127extern const DISOPCODE g_aMapX86_Group16[8];
128extern const DISOPCODE g_aMapX86_NopPause[2];
129/** @} */
130
131/** 3DNow! map (0x0F 0x0F prefix) */
132extern const DISOPCODE g_aTwoByteMapX86_3DNow[256];
133
134/** Floating point opcodes starting with escape byte 0xDF
135 * @{ */
136extern const DISOPCODE g_aMapX86_EscF0_Low[8];
137extern const DISOPCODE g_aMapX86_EscF0_High[16*4];
138extern const DISOPCODE g_aMapX86_EscF1_Low[8];
139extern const DISOPCODE g_aMapX86_EscF1_High[16*4];
140extern const DISOPCODE g_aMapX86_EscF2_Low[8];
141extern const DISOPCODE g_aMapX86_EscF2_High[16*4];
142extern const DISOPCODE g_aMapX86_EscF3_Low[8];
143extern const DISOPCODE g_aMapX86_EscF3_High[16*4];
144extern const DISOPCODE g_aMapX86_EscF4_Low[8];
145extern const DISOPCODE g_aMapX86_EscF4_High[16*4];
146extern const DISOPCODE g_aMapX86_EscF5_Low[8];
147extern const DISOPCODE g_aMapX86_EscF5_High[16*4];
148extern const DISOPCODE g_aMapX86_EscF6_Low[8];
149extern const DISOPCODE g_aMapX86_EscF6_High[16*4];
150extern const DISOPCODE g_aMapX86_EscF7_Low[8];
151extern const DISOPCODE g_aMapX86_EscF7_High[16*4];
152
153extern PCDISOPCODE g_paMapX86_FP_Low[8];
154extern PCDISOPCODE g_paMapX86_FP_High[8];
155/** @} */
156
157/** @def OP
158 * Wrapper which initializes an OPCODE.
159 * We must use this so that we can exclude unused fields in order
160 * to save precious bytes in the GC version.
161 *
162 * @internal
163 */
164#ifndef DIS_CORE_ONLY
165# define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
166 { pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
167#else
168# define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
169 { idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
170#endif
171
172
173size_t disFormatBytes(PCDISCPUSTATE pCpu, char *pszDst, size_t cchDst, uint32_t fFlags);
174
175/** @} */
176#endif
177
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette