source: Daodan/src/beaengine/Includes/instr_set/opcodes_Grp1.c@ 1056

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

Daodan: TV code

File size: 11.9 KB
RevLine 
[984]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 * 80h
21 * ==================================================================== */
22void __bea_callspec__ G1_EbIb(PDISASM pMyDisasm)
23{
24 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
25 EbIb(pMyDisasm);
26 if (GV.REGOPCODE == 0) {
27 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
28 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
29 }
30 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
31 #ifndef BEA_LIGHT_DISASSEMBLY
32 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
33 #endif
34 FillFlags(pMyDisasm, 5);
35 }
36 else if (GV.REGOPCODE == 1) {
37 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
38 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
39 }
40 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
41 #ifndef BEA_LIGHT_DISASSEMBLY
42 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
43 #endif
44 FillFlags(pMyDisasm, 74);
45 }
46 else if (GV.REGOPCODE == 2) {
47 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
48 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
49 }
50 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
51 #ifndef BEA_LIGHT_DISASSEMBLY
52 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
53 #endif
54 FillFlags(pMyDisasm, 4);
55 }
56 else if (GV.REGOPCODE == 3) {
57 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
58 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
59 }
60 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
61 #ifndef BEA_LIGHT_DISASSEMBLY
62 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
63 #endif
64 FillFlags(pMyDisasm, 93);
65 }
66 else if (GV.REGOPCODE == 4) {
67 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
68 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
69 }
70 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
71 #ifndef BEA_LIGHT_DISASSEMBLY
72 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
73 #endif
74 FillFlags(pMyDisasm, 6);
75 }
76 else if (GV.REGOPCODE == 5) {
77 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
78 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
79 }
80 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
81 #ifndef BEA_LIGHT_DISASSEMBLY
82 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
83 #endif
84 FillFlags(pMyDisasm, 103);
85 }
86
87 else if (GV.REGOPCODE == 6) {
88 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
89 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
90 }
91 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
92 #ifndef BEA_LIGHT_DISASSEMBLY
93 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
94 #endif
95 FillFlags(pMyDisasm, 113);
96 }
97
98 else if (GV.REGOPCODE == 7) {
99 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
100 #ifndef BEA_LIGHT_DISASSEMBLY
101 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
102 #endif
103 FillFlags(pMyDisasm, 20);
104 (*pMyDisasm).Argument1.AccessMode = READ;
105 }
106}
107
108/* ====================================================================
109 * 82h
110 * ==================================================================== */
111void __bea_callspec__ G1_EbIb2(PDISASM pMyDisasm)
112{
113 if (GV.Architecture == 64) {
114 FailDecode(pMyDisasm);
115 }
116 else {
117 G1_EbIb(pMyDisasm);
118 }
119}
120
121/* ====================================================================
122 * 81h
123 * ==================================================================== */
124void __bea_callspec__ G1_EvIv(PDISASM pMyDisasm)
125{
126 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
127 EvIv(pMyDisasm);
128 if (GV.REGOPCODE == 0) {
129 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
130 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
131 }
132 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
133 #ifndef BEA_LIGHT_DISASSEMBLY
134 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
135 #endif
136 FillFlags(pMyDisasm, 5);
137 }
138 else if (GV.REGOPCODE == 1) {
139 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
140 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
141 }
142 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
143 #ifndef BEA_LIGHT_DISASSEMBLY
144 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
145 #endif
146 FillFlags(pMyDisasm, 74);
147 }
148 else if (GV.REGOPCODE == 2) {
149 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
150 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
151 }
152 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
153 #ifndef BEA_LIGHT_DISASSEMBLY
154 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
155 #endif
156 FillFlags(pMyDisasm, 4);
157 }
158 else if (GV.REGOPCODE == 3) {
159 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
160 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
161 }
162 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
163 #ifndef BEA_LIGHT_DISASSEMBLY
164 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
165 #endif
166 FillFlags(pMyDisasm, 93);
167 }
168 else if (GV.REGOPCODE == 4) {
169 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
170 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
171 }
172 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
173 #ifndef BEA_LIGHT_DISASSEMBLY
174 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
175 #endif
176 FillFlags(pMyDisasm, 6);
177 }
178 else if (GV.REGOPCODE == 5) {
179 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
180 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
181 }
182 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
183 #ifndef BEA_LIGHT_DISASSEMBLY
184 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
185 #endif
186 FillFlags(pMyDisasm, 103);
187 }
188
189 else if (GV.REGOPCODE == 6) {
190 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
191 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
192 }
193 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
194 #ifndef BEA_LIGHT_DISASSEMBLY
195 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
196 #endif
197 FillFlags(pMyDisasm, 113);
198 }
199
200 else if (GV.REGOPCODE == 7) {
201 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
202 #ifndef BEA_LIGHT_DISASSEMBLY
203 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
204 #endif
205 FillFlags(pMyDisasm, 20);
206 (*pMyDisasm).Argument1.AccessMode = READ;
207 }
208}
209
210/* ====================================================================
211 * 83h
212 * ==================================================================== */
213void __bea_callspec__ G1_EvIb(PDISASM pMyDisasm)
214{
215 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
216 EvIb(pMyDisasm);
217 if (GV.REGOPCODE == 0) {
218 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
219 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
220 }
221 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
222 #ifndef BEA_LIGHT_DISASSEMBLY
223 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add ");
224 #endif
225 FillFlags(pMyDisasm, 5);
226 }
227 else if (GV.REGOPCODE == 1) {
228 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
229 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
230 }
231 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
232 #ifndef BEA_LIGHT_DISASSEMBLY
233 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or ");
234 #endif
235 FillFlags(pMyDisasm, 74);
236 }
237 else if (GV.REGOPCODE == 2) {
238 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
239 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
240 }
241 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
242 #ifndef BEA_LIGHT_DISASSEMBLY
243 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc ");
244 #endif
245 FillFlags(pMyDisasm, 4);
246 }
247 else if (GV.REGOPCODE == 3) {
248 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
249 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
250 }
251 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
252 #ifndef BEA_LIGHT_DISASSEMBLY
253 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb ");
254 #endif
255 FillFlags(pMyDisasm, 93);
256 }
257 else if (GV.REGOPCODE == 4) {
258 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
259 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
260 }
261 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
262 #ifndef BEA_LIGHT_DISASSEMBLY
263 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and ");
264 #endif
265 FillFlags(pMyDisasm, 6);
266 }
267 else if (GV.REGOPCODE == 5) {
268 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
269 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
270 }
271 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
272 #ifndef BEA_LIGHT_DISASSEMBLY
273 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub ");
274 #endif
275 FillFlags(pMyDisasm, 103);
276 }
277
278 else if (GV.REGOPCODE == 6) {
279 if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
280 (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
281 }
282 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION;
283 #ifndef BEA_LIGHT_DISASSEMBLY
284 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor ");
285 #endif
286 FillFlags(pMyDisasm, 113);
287 }
288
289 else if (GV.REGOPCODE == 7) {
290 (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION;
291 #ifndef BEA_LIGHT_DISASSEMBLY
292 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp ");
293 #endif
294 FillFlags(pMyDisasm, 20);
295 (*pMyDisasm).Argument1.AccessMode = READ;
296 }
297}
Note: See TracBrowser for help on using the repository browser.