source: Daodan/src/beaengine/Includes/instr_set/opcodes_Grp15.c@ 1108

Last change on this file since 1108 was 984, checked in by alloc, 11 years ago

Daodan: TV code

File size: 6.4 KB
Line 
1/* Copyright 2006-2009, BeatriX
2 * File coded by BeatriX
3 *
4 * This file is part of BeaEngine.
5 *
6 * BeaEngine is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * BeaEngine is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */
18
19/* ====================================================================
20 *
21 * ==================================================================== */
22void __bea_callspec__ G15_(PDISASM pMyDisasm)
23{
24 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
25 if (GV.REGOPCODE == 0) {
26 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
27 if (GV.MOD_!= 0x3) {
28 GV.MemDecoration = Arg1multibytes;
29 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
30 #ifndef BEA_LIGHT_DISASSEMBLY
31 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxsave ");
32 #endif
33 (*pMyDisasm).Argument1.ArgSize = 512;
34 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
35 (*pMyDisasm).Argument2.ArgSize = 512;
36 }
37 else {
38 FailDecode(pMyDisasm);
39 }
40 }
41 else if (GV.REGOPCODE == 1) {
42 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
43 if (GV.MOD_!= 0x3) {
44 GV.MemDecoration = Arg2multibytes;
45 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
46 #ifndef BEA_LIGHT_DISASSEMBLY
47 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxrstor ");
48 #endif
49 (*pMyDisasm).Argument2.ArgSize = 512;
50 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
51 (*pMyDisasm).Argument1.ArgSize = 512;
52 }
53 else {
54 FailDecode(pMyDisasm);
55 }
56
57 }
58 else if (GV.REGOPCODE == 2) {
59 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
60 if (GV.MOD_!= 0x3) {
61 GV.MemDecoration = Arg2dword;
62 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT;
63 #ifndef BEA_LIGHT_DISASSEMBLY
64 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ldmxcsr ");
65 #endif
66 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1;
67 (*pMyDisasm).Argument1.ArgSize = 32;
68 }
69 else {
70 FailDecode(pMyDisasm);
71 }
72
73 }
74 else if (GV.REGOPCODE == 3) {
75 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
76 if (GV.MOD_!= 0x3) {
77 GV.MemDecoration = Arg1dword;
78 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT;
79 #ifndef BEA_LIGHT_DISASSEMBLY
80 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stmxcsr ");
81 #endif
82 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1;
83 (*pMyDisasm).Argument2.ArgSize = 32;
84 }
85 else {
86 FailDecode(pMyDisasm);
87 }
88
89 }
90
91 else if (GV.REGOPCODE == 4) {
92 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
93 if (GV.MOD_!= 0x3) {
94 GV.MemDecoration = Arg1multibytes;
95 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
96 #ifndef BEA_LIGHT_DISASSEMBLY
97 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsave ");
98 #endif
99 (*pMyDisasm).Argument1.ArgSize = 512;
100 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
101 (*pMyDisasm).Argument2.ArgSize = 512;
102 }
103 else {
104 FailDecode(pMyDisasm);
105 }
106 }
107
108 else if (GV.REGOPCODE == 5) {
109 GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
110 if (GV.MOD_== 0x3) {
111 (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
112 #ifndef BEA_LIGHT_DISASSEMBLY
113 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lfence ");
114 #endif
115 }
116 else {
117 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
118 GV.MemDecoration = Arg2multibytes;
119 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT;
120 #ifndef BEA_LIGHT_DISASSEMBLY
121 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xrstor ");
122 #endif
123 (*pMyDisasm).Argument2.ArgSize = 512;
124 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG;
125 (*pMyDisasm).Argument1.ArgSize = 512;
126 }
127
128 }
129 else if (GV.REGOPCODE == 6) {
130 GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
131 if (GV.MOD_== 0x3) {
132 (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
133 #ifndef BEA_LIGHT_DISASSEMBLY
134 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mfence ");
135 #endif
136 }
137 else {
138 FailDecode(pMyDisasm);
139 }
140 }
141 else if (GV.REGOPCODE == 7) {
142 GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3;
143 if (GV.MOD_== 0x3) {
144 (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
145 #ifndef BEA_LIGHT_DISASSEMBLY
146 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sfence ");
147 #endif
148 }
149 else {
150 GV.OperandSize = 8;
151 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
152 GV.OperandSize = 32;
153 GV.MemDecoration = Arg2byte;
154 (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL;
155 #ifndef BEA_LIGHT_DISASSEMBLY
156 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clflush ");
157 #endif
158 }
159
160 }
161
162 else {
163 FailDecode(pMyDisasm);
164 }
165 GV.EIP_+= GV.DECALAGE_EIP+2;
166}
Note: See TracBrowser for help on using the repository browser.