source: Daodan/src/beaengine/Includes/instr_set/opcodes_Grp14.c@ 996

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

Daodan: TV code

File size: 7.9 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__ G14_(PDISASM pMyDisasm)
23{
24 long MyNumber;
25
26 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
27 if (GV.REGOPCODE == 2) {
28 if (GV.OperandSize == 16) {
29 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
30 GV.MemDecoration = Arg1dqword;
31 GV.ImmediatSize = 8;
32 GV.SSE_ = 1;
33 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
34 GV.SSE_ = 0;
35 if (GV.MOD_== 0x3) {
36 #ifndef BEA_LIGHT_DISASSEMBLY
37 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq ");
38 #endif
39 }
40 else {
41 FailDecode(pMyDisasm);
42 }
43 GV.EIP_ += GV.DECALAGE_EIP+3;
44 if (!Security(0, pMyDisasm)) return;
45
46 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
47 #ifndef BEA_LIGHT_DISASSEMBLY
48 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
49 #endif
50 (*pMyDisasm).Instruction.Immediat = MyNumber;
51 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
52 (*pMyDisasm).Argument2.ArgSize = 8;
53 }
54 else {
55 (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
56 GV.MemDecoration = Arg1qword;
57 GV.ImmediatSize = 8;
58 GV.MMX_ = 1;
59 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
60 GV.MMX_ = 0;
61 if (GV.MOD_== 0x3) {
62 #ifndef BEA_LIGHT_DISASSEMBLY
63 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq ");
64 #endif
65 }
66 else {
67 FailDecode(pMyDisasm);
68 }
69 GV.EIP_ += GV.DECALAGE_EIP+3;
70 if (!Security(0, pMyDisasm)) return;
71
72 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
73 #ifndef BEA_LIGHT_DISASSEMBLY
74 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
75 #endif
76 (*pMyDisasm).Instruction.Immediat = MyNumber;
77 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
78 (*pMyDisasm).Argument2.ArgSize = 8;
79 }
80 }
81 else if (GV.REGOPCODE == 3) {
82 if (GV.OperandSize == 16) {
83 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
84 GV.MemDecoration = Arg1dqword;
85 GV.ImmediatSize = 8;
86 GV.SSE_ = 1;
87 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
88 GV.SSE_ = 0;
89 if (GV.MOD_== 0x3) {
90 #ifndef BEA_LIGHT_DISASSEMBLY
91 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrldq ");
92 #endif
93 }
94 else {
95 FailDecode(pMyDisasm);
96 }
97 GV.EIP_ += GV.DECALAGE_EIP+3;
98 if (!Security(0, pMyDisasm)) return;
99
100 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
101 #ifndef BEA_LIGHT_DISASSEMBLY
102 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
103 #endif
104 (*pMyDisasm).Instruction.Immediat = MyNumber;
105 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
106 (*pMyDisasm).Argument2.ArgSize = 8;
107 }
108 else {
109 FailDecode(pMyDisasm);
110 }
111
112 }
113 else if (GV.REGOPCODE == 6) {
114 if (GV.OperandSize == 16) {
115 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
116 GV.MemDecoration = Arg1dqword;
117 GV.ImmediatSize = 8;
118 GV.SSE_ = 1;
119 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
120 GV.SSE_ = 0;
121 if (GV.MOD_== 0x3) {
122 #ifndef BEA_LIGHT_DISASSEMBLY
123 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq ");
124 #endif
125 }
126 else {
127 FailDecode(pMyDisasm);
128 }
129 GV.EIP_ += GV.DECALAGE_EIP+3;
130 if (!Security(0, pMyDisasm)) return;
131
132 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
133 #ifndef BEA_LIGHT_DISASSEMBLY
134 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
135 #endif
136 (*pMyDisasm).Instruction.Immediat = MyNumber;
137 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
138 (*pMyDisasm).Argument2.ArgSize = 8;
139 }
140 else {
141 (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
142 GV.MemDecoration = Arg1qword;
143 GV.ImmediatSize = 8;
144 GV.MMX_ = 1;
145 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
146 GV.MMX_ = 0;
147 if (GV.MOD_== 0x3) {
148 #ifndef BEA_LIGHT_DISASSEMBLY
149 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq ");
150 #endif
151 }
152 else {
153 FailDecode(pMyDisasm);
154 }
155 GV.EIP_ += GV.DECALAGE_EIP+3;
156 if (!Security(0, pMyDisasm)) return;
157
158 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
159 #ifndef BEA_LIGHT_DISASSEMBLY
160 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
161 #endif
162 (*pMyDisasm).Instruction.Immediat = MyNumber;
163 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
164 (*pMyDisasm).Argument2.ArgSize = 8;
165 }
166 }
167 else if (GV.REGOPCODE == 7) {
168 if (GV.OperandSize == 16) {
169 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
170 GV.MemDecoration = Arg1dqword;
171 GV.ImmediatSize = 8;
172 GV.SSE_ = 1;
173 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
174 GV.SSE_ = 0;
175 if (GV.MOD_== 0x3) {
176 #ifndef BEA_LIGHT_DISASSEMBLY
177 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslldq ");
178 #endif
179 }
180 else {
181 FailDecode(pMyDisasm);
182 }
183 GV.EIP_ += GV.DECALAGE_EIP+3;
184 if (!Security(0, pMyDisasm)) return;
185
186 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
187 #ifndef BEA_LIGHT_DISASSEMBLY
188 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
189 #endif
190 (*pMyDisasm).Instruction.Immediat = MyNumber;
191 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
192 (*pMyDisasm).Argument2.ArgSize = 8;
193 }
194 else {
195 FailDecode(pMyDisasm);
196 }
197
198 }
199 else {
200 FailDecode(pMyDisasm);
201 }
202
203}
Note: See TracBrowser for help on using the repository browser.