source: Daodan/src/beaengine/Includes/instr_set/opcodes_Grp12.c@ 1113

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

Daodan: TV code

File size: 7.7 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__ G12_(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, "psrlw ");
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, "psrlw ");
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 == 4) {
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, "psraw ");
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 (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
110 GV.MemDecoration = Arg1qword;
111 GV.ImmediatSize = 8;
112 GV.MMX_ = 1;
113 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
114 GV.MMX_ = 0;
115 if (GV.MOD_== 0x3) {
116 #ifndef BEA_LIGHT_DISASSEMBLY
117 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw ");
118 #endif
119 }
120 else {
121 FailDecode(pMyDisasm);
122 }
123 GV.EIP_ += GV.DECALAGE_EIP+3;
124 if (!Security(0, pMyDisasm)) return;
125
126 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
127 #ifndef BEA_LIGHT_DISASSEMBLY
128 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
129 #endif
130 (*pMyDisasm).Instruction.Immediat = MyNumber;
131 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
132 (*pMyDisasm).Argument2.ArgSize = 8;
133 }
134
135 }
136 else if (GV.REGOPCODE == 6) {
137 if (GV.OperandSize == 16) {
138 (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
139 GV.MemDecoration = Arg1dqword;
140 GV.ImmediatSize = 8;
141 GV.SSE_ = 1;
142 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
143 GV.SSE_ = 0;
144 if (GV.MOD_== 0x3) {
145 #ifndef BEA_LIGHT_DISASSEMBLY
146 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw ");
147 #endif
148 }
149 else {
150 FailDecode(pMyDisasm);
151 }
152 GV.EIP_ += GV.DECALAGE_EIP+3;
153 if (!Security(0, pMyDisasm)) return;
154
155 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
156 #ifndef BEA_LIGHT_DISASSEMBLY
157 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
158 #endif
159 (*pMyDisasm).Instruction.Immediat = MyNumber;
160 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
161 (*pMyDisasm).Argument2.ArgSize = 8;
162 }
163 else {
164 (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
165 GV.MemDecoration = Arg1qword;
166 GV.ImmediatSize = 8;
167 GV.MMX_ = 1;
168 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
169 GV.MMX_ = 0;
170 if (GV.MOD_== 0x3) {
171 #ifndef BEA_LIGHT_DISASSEMBLY
172 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw ");
173 #endif
174 }
175 else {
176 FailDecode(pMyDisasm);
177 }
178 GV.EIP_ += GV.DECALAGE_EIP+3;
179 if (!Security(0, pMyDisasm)) return;
180
181 MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
182 #ifndef BEA_LIGHT_DISASSEMBLY
183 (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
184 #endif
185 (*pMyDisasm).Instruction.Immediat = MyNumber;
186 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
187 (*pMyDisasm).Argument2.ArgSize = 8;
188 }
189 }
190
191 else {
192 FailDecode(pMyDisasm);
193 }
194
195}
Note: See TracBrowser for help on using the repository browser.