source: Daodan/src/beaengine/Includes/instr_set/opcodes_FPU.c@ 1193

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

Daodan: TV code

File size: 82.6 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__ D8_(PDISASM pMyDisasm)
23{
24 long MyMODRM;
25 char (*pRegistersFPU)[8][8] ;
26
27 GV.DECALAGE_EIP = 0;
28 if (!Security(1, pMyDisasm)) {return;}
29 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
30 pRegistersFPU = &RegistersFPU_Masm;
31 if (GV.SYNTAX_ == NasmSyntax) {
32 pRegistersFPU = &RegistersFPU_Nasm;
33 }
34 if (MyMODRM <= 0xbf) {
35 GV.MemDecoration = Arg2dword;
36 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
37 if (GV.REGOPCODE == 0) {
38 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
39 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
40 #ifndef BEA_LIGHT_DISASSEMBLY
41 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd ");
42 #endif
43 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
44 (*pMyDisasm).Argument1.ArgSize = 80;
45 }
46 else if (GV.REGOPCODE == 1) {
47 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
48 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
49 #ifndef BEA_LIGHT_DISASSEMBLY
50 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul ");
51 #endif
52 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
53 (*pMyDisasm).Argument1.ArgSize = 80;
54 }
55 else if (GV.REGOPCODE == 2) {
56 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
57 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
58 #ifndef BEA_LIGHT_DISASSEMBLY
59 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom ");
60 #endif
61 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
62 (*pMyDisasm).Argument1.ArgSize = 80;
63 (*pMyDisasm).Argument1.AccessMode = READ;
64 }
65 else if (GV.REGOPCODE == 3) {
66 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
67 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
68 #ifndef BEA_LIGHT_DISASSEMBLY
69 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp ");
70 #endif
71 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
72 (*pMyDisasm).Argument1.ArgSize = 80;
73 (*pMyDisasm).Argument1.AccessMode = READ;
74 }
75 else if (GV.REGOPCODE == 4) {
76 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
77 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
78 #ifndef BEA_LIGHT_DISASSEMBLY
79 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub ");
80 #endif
81 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
82 (*pMyDisasm).Argument1.ArgSize = 80;
83 }
84 else if (GV.REGOPCODE == 5) {
85 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
86 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
87 #ifndef BEA_LIGHT_DISASSEMBLY
88 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr ");
89 #endif
90 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
91 (*pMyDisasm).Argument1.ArgSize = 80;
92 }
93 else if (GV.REGOPCODE == 6) {
94 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
95 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
96 #ifndef BEA_LIGHT_DISASSEMBLY
97 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv ");
98 #endif
99 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
100 (*pMyDisasm).Argument1.ArgSize = 80;
101 }
102 else if (GV.REGOPCODE == 7) {
103 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
104 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
105 #ifndef BEA_LIGHT_DISASSEMBLY
106 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr ");
107 #endif
108 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
109 (*pMyDisasm).Argument1.ArgSize = 80;
110 }
111 else {
112 FailDecode(pMyDisasm);
113 }
114 }
115 else {
116 if ((MyMODRM & 0xf0) == 0xc0) {
117 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
118 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
119 #ifndef BEA_LIGHT_DISASSEMBLY
120 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd ");
121 #endif
122 }
123 else {
124 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
125 #ifndef BEA_LIGHT_DISASSEMBLY
126 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul ");
127 #endif
128 }
129 #ifndef BEA_LIGHT_DISASSEMBLY
130 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
131 #endif
132 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
133 (*pMyDisasm).Argument1.ArgSize = 80;
134 #ifndef BEA_LIGHT_DISASSEMBLY
135 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
136 #endif
137 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
138 (*pMyDisasm).Argument2.ArgSize = 80;
139 }
140 else if ((MyMODRM & 0xf0) == 0xd0) {
141 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
142 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
143 #ifndef BEA_LIGHT_DISASSEMBLY
144 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom ");
145 #endif
146 }
147 else {
148 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
149 #ifndef BEA_LIGHT_DISASSEMBLY
150 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp ");
151 #endif
152 }
153 #ifndef BEA_LIGHT_DISASSEMBLY
154 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
155 #endif
156 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
157 (*pMyDisasm).Argument1.ArgSize = 80;
158 #ifndef BEA_LIGHT_DISASSEMBLY
159 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
160 #endif
161 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
162 (*pMyDisasm).Argument2.ArgSize = 80;
163 }
164 else if ((MyMODRM & 0xf0) == 0xe0) {
165 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
166 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
167 #ifndef BEA_LIGHT_DISASSEMBLY
168 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub ");
169 #endif
170 }
171 else {
172 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
173 #ifndef BEA_LIGHT_DISASSEMBLY
174 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr ");
175 #endif
176 }
177 #ifndef BEA_LIGHT_DISASSEMBLY
178 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
179 #endif
180 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
181 (*pMyDisasm).Argument1.ArgSize = 80;
182 #ifndef BEA_LIGHT_DISASSEMBLY
183 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
184 #endif
185 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
186 (*pMyDisasm).Argument2.ArgSize = 80;
187 }
188 else if ((MyMODRM & 0xf0) == 0xf0) {
189 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
190 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
191 #ifndef BEA_LIGHT_DISASSEMBLY
192 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv ");
193 #endif
194 }
195 else {
196 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
197 #ifndef BEA_LIGHT_DISASSEMBLY
198 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr ");
199 #endif
200 }
201 #ifndef BEA_LIGHT_DISASSEMBLY
202 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
203 #endif
204 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
205 (*pMyDisasm).Argument1.ArgSize = 80;
206 #ifndef BEA_LIGHT_DISASSEMBLY
207 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
208 #endif
209 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
210 (*pMyDisasm).Argument2.ArgSize = 80;
211 }
212 }
213 GV.EIP_ += GV.DECALAGE_EIP+2;
214}
215
216/* ====================================================================
217 *
218 * ==================================================================== */
219void __bea_callspec__ D9_(PDISASM pMyDisasm)
220{
221 long MyMODRM;
222 char (*pRegistersFPU)[8][8] ;
223
224 GV.DECALAGE_EIP = 0;
225 if (!Security(1, pMyDisasm)) {return;}
226 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
227 pRegistersFPU = &RegistersFPU_Masm;
228 if (GV.SYNTAX_ == NasmSyntax) {
229 pRegistersFPU = &RegistersFPU_Nasm;
230 }
231 if (MyMODRM <= 0xbf) {
232
233 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
234 if (GV.REGOPCODE == 0) {
235 GV.MemDecoration = Arg2dword;
236 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
237 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
238 #ifndef BEA_LIGHT_DISASSEMBLY
239 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld ");
240 #endif
241 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
242 (*pMyDisasm).Argument1.ArgSize = 80;
243 }
244 else if (GV.REGOPCODE == 2) {
245 GV.MemDecoration = Arg1dword;
246 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
247 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
248 #ifndef BEA_LIGHT_DISASSEMBLY
249 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst ");
250 #endif
251 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
252 (*pMyDisasm).Argument2.ArgSize = 80;
253 }
254 else if (GV.REGOPCODE == 3) {
255 GV.MemDecoration = Arg1dword;
256 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
257 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
258 #ifndef BEA_LIGHT_DISASSEMBLY
259 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp ");
260 #endif
261 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
262 (*pMyDisasm).Argument2.ArgSize = 80;
263 }
264 else if (GV.REGOPCODE == 4) {
265 GV.MemDecoration = Arg2multibytes;
266 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
267 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
268 #ifndef BEA_LIGHT_DISASSEMBLY
269 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldenv ");
270 #endif
271 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
272 (*pMyDisasm).Argument1.ArgSize = 80;
273 }
274 else if (GV.REGOPCODE == 5) {
275 GV.MemDecoration = Arg2word;
276 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
277 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
278 #ifndef BEA_LIGHT_DISASSEMBLY
279 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldcw ");
280 #endif
281 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
282 (*pMyDisasm).Argument1.ArgSize = 80;
283 }
284 else if (GV.REGOPCODE == 6) {
285 GV.MemDecoration = Arg1multibytes;
286 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
287 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
288 #ifndef BEA_LIGHT_DISASSEMBLY
289 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstenv ");
290 #endif
291 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
292 (*pMyDisasm).Argument2.ArgSize = 80;
293 }
294 else if (GV.REGOPCODE == 7) {
295 GV.MemDecoration = Arg1word;
296 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
297 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
298 #ifndef BEA_LIGHT_DISASSEMBLY
299 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstcw ");
300 #endif
301 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
302 (*pMyDisasm).Argument2.ArgSize = 80;
303 }
304 else {
305 FailDecode(pMyDisasm);
306 }
307 }
308 else {
309 if ((MyMODRM & 0xf0) == 0xc0) {
310 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
311 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
312 #ifndef BEA_LIGHT_DISASSEMBLY
313 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld ");
314 #endif
315 }
316 else {
317 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
318 #ifndef BEA_LIGHT_DISASSEMBLY
319 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch ");
320 #endif
321 (*pMyDisasm).Argument2.AccessMode = WRITE;
322 }
323 #ifndef BEA_LIGHT_DISASSEMBLY
324 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
325 #endif
326 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
327 (*pMyDisasm).Argument1.ArgSize = 80;
328 #ifndef BEA_LIGHT_DISASSEMBLY
329 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
330 #endif
331 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
332 (*pMyDisasm).Argument2.ArgSize = 80;
333 }
334 else if ((MyMODRM & 0xf0) == 0xd0) {
335 if ((MyMODRM & 0xf) ==0) {
336 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
337 #ifndef BEA_LIGHT_DISASSEMBLY
338 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnop ");
339 #endif
340 }
341 else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) {
342 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
343 #ifndef BEA_LIGHT_DISASSEMBLY
344 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp1 ");
345 #endif
346 #ifndef BEA_LIGHT_DISASSEMBLY
347 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
348 #endif
349 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
350 (*pMyDisasm).Argument1.ArgSize = 80;
351 }
352 else {
353 FailDecode(pMyDisasm);
354 }
355
356 }
357 else if ((MyMODRM & 0xf0) == 0xe0) {
358 if ((MyMODRM & 0xf) ==0) {
359 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
360 #ifndef BEA_LIGHT_DISASSEMBLY
361 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fchs ");
362 #endif
363 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
364 (*pMyDisasm).Argument1.ArgSize = 80;
365 }
366 else if ((MyMODRM & 0xf) ==1) {
367 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
368 #ifndef BEA_LIGHT_DISASSEMBLY
369 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fabs ");
370 #endif
371 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
372 (*pMyDisasm).Argument1.ArgSize = 80;
373 }
374 else if ((MyMODRM & 0xf) ==4) {
375 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
376 #ifndef BEA_LIGHT_DISASSEMBLY
377 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ftst ");
378 #endif
379 }
380 else if ((MyMODRM & 0xf) ==5) {
381 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
382 #ifndef BEA_LIGHT_DISASSEMBLY
383 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxam ");
384 #endif
385 }
386 else if ((MyMODRM & 0xf) ==8) {
387 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
388 #ifndef BEA_LIGHT_DISASSEMBLY
389 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld1 ");
390 #endif
391 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
392 (*pMyDisasm).Argument1.ArgSize = 80;
393 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
394 (*pMyDisasm).Argument2.ArgSize = 80;
395
396 }
397 else if ((MyMODRM & 0xf) ==9) {
398 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
399 #ifndef BEA_LIGHT_DISASSEMBLY
400 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2t ");
401 #endif
402 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
403 (*pMyDisasm).Argument1.ArgSize = 80;
404 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
405 (*pMyDisasm).Argument2.ArgSize = 80;
406 }
407 else if ((MyMODRM & 0xf) ==0xa) {
408 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
409 #ifndef BEA_LIGHT_DISASSEMBLY
410 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2e ");
411 #endif
412 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
413 (*pMyDisasm).Argument1.ArgSize = 80;
414 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
415 (*pMyDisasm).Argument2.ArgSize = 80;
416 }
417 else if ((MyMODRM & 0xf) ==0xb) {
418 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
419 #ifndef BEA_LIGHT_DISASSEMBLY
420 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldpi ");
421 #endif
422 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
423 (*pMyDisasm).Argument1.ArgSize = 80;
424 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
425 (*pMyDisasm).Argument2.ArgSize = 80;
426 }
427 else if ((MyMODRM & 0xf) ==0xc) {
428 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
429 #ifndef BEA_LIGHT_DISASSEMBLY
430 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldlg2 ");
431 #endif
432 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
433 (*pMyDisasm).Argument1.ArgSize = 80;
434 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
435 (*pMyDisasm).Argument2.ArgSize = 80;
436 }
437
438 else if ((MyMODRM & 0xf) ==0xd) {
439 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
440 #ifndef BEA_LIGHT_DISASSEMBLY
441 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldln2 ");
442 #endif
443 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
444 (*pMyDisasm).Argument1.ArgSize = 80;
445 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
446 (*pMyDisasm).Argument2.ArgSize = 80;
447 }
448 else if ((MyMODRM & 0xf) ==0xe) {
449 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS;
450 #ifndef BEA_LIGHT_DISASSEMBLY
451 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldz ");
452 #endif
453 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
454 (*pMyDisasm).Argument1.ArgSize = 80;
455 (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
456 (*pMyDisasm).Argument2.ArgSize = 80;
457 }
458
459 else {
460 FailDecode(pMyDisasm);
461 }
462 }
463 else if ((MyMODRM & 0xf0) == 0xf0) {
464 if ((MyMODRM & 0xf) ==0) {
465 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION;
466 #ifndef BEA_LIGHT_DISASSEMBLY
467 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "f2xm1 ");
468 #endif
469 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
470 (*pMyDisasm).Argument1.ArgSize = 80;
471 }
472 else if ((MyMODRM & 0xf) ==1) {
473 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION;
474 #ifndef BEA_LIGHT_DISASSEMBLY
475 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2x ");
476 #endif
477 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
478 (*pMyDisasm).Argument1.ArgSize = 80;
479 }
480 else if ((MyMODRM & 0xf) ==2) {
481 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION;
482 #ifndef BEA_LIGHT_DISASSEMBLY
483 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fptan ");
484 #endif
485 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
486 (*pMyDisasm).Argument1.ArgSize = 80;
487 }
488 else if ((MyMODRM & 0xf) ==3) {
489 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION;
490 #ifndef BEA_LIGHT_DISASSEMBLY
491 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fpatan ");
492 #endif
493 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
494 (*pMyDisasm).Argument1.ArgSize = 80;
495 }
496 else if ((MyMODRM & 0xf) ==4) {
497 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
498 #ifndef BEA_LIGHT_DISASSEMBLY
499 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxtract ");
500 #endif
501 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
502 (*pMyDisasm).Argument1.ArgSize = 80;
503 }
504 else if ((MyMODRM & 0xf) ==5) {
505 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
506 #ifndef BEA_LIGHT_DISASSEMBLY
507 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem1 ");
508 #endif
509 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
510 (*pMyDisasm).Argument1.ArgSize = 80;
511 }
512 else if ((MyMODRM & 0xf) ==6) {
513 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
514 #ifndef BEA_LIGHT_DISASSEMBLY
515 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdecstp ");
516 #endif
517 }
518 else if ((MyMODRM & 0xf) ==7) {
519 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
520 #ifndef BEA_LIGHT_DISASSEMBLY
521 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fincstp ");
522 #endif
523 }
524 else if ((MyMODRM & 0xf) ==8) {
525 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
526 #ifndef BEA_LIGHT_DISASSEMBLY
527 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem ");
528 #endif
529 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
530 (*pMyDisasm).Argument1.ArgSize = 80;
531 }
532 else if ((MyMODRM & 0xf) ==9) {
533 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION;
534 #ifndef BEA_LIGHT_DISASSEMBLY
535 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2xp1 ");
536 #endif
537 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
538 (*pMyDisasm).Argument1.ArgSize = 80;
539 }
540 else if ((MyMODRM & 0xf) ==0xa) {
541 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
542 #ifndef BEA_LIGHT_DISASSEMBLY
543 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsqrt ");
544 #endif
545 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
546 (*pMyDisasm).Argument1.ArgSize = 80;
547 }
548 else if ((MyMODRM & 0xf) ==0xb) {
549 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION;
550 #ifndef BEA_LIGHT_DISASSEMBLY
551 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsincos ");
552 #endif
553 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
554 (*pMyDisasm).Argument1.ArgSize = 80;
555 }
556 else if ((MyMODRM & 0xf) ==0xc) {
557 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
558 #ifndef BEA_LIGHT_DISASSEMBLY
559 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frndint ");
560 #endif
561 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
562 (*pMyDisasm).Argument1.ArgSize = 80;
563 }
564 else if ((MyMODRM & 0xf) ==0xd) {
565 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION;
566 #ifndef BEA_LIGHT_DISASSEMBLY
567 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fscale ");
568 #endif
569 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
570 (*pMyDisasm).Argument1.ArgSize = 80;
571 }
572 else if ((MyMODRM & 0xf) ==0xe) {
573 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION;
574 #ifndef BEA_LIGHT_DISASSEMBLY
575 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsin ");
576 #endif
577 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
578 (*pMyDisasm).Argument1.ArgSize = 80;
579 }
580 else if ((MyMODRM & 0xf) ==0xf) {
581 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION;
582 #ifndef BEA_LIGHT_DISASSEMBLY
583 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcos ");
584 #endif
585 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
586 (*pMyDisasm).Argument1.ArgSize = 80;
587 }
588 else {
589 FailDecode(pMyDisasm);
590 }
591 }
592 }
593 GV.EIP_ += GV.DECALAGE_EIP+2;
594}
595
596
597/* ====================================================================
598 *
599 * ==================================================================== */
600void __bea_callspec__ DA_(PDISASM pMyDisasm)
601{
602 long MyMODRM;
603 char (*pRegistersFPU)[8][8] ;
604
605 GV.DECALAGE_EIP = 0;
606 if (!Security(1, pMyDisasm)) {return;}
607 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
608 pRegistersFPU = &RegistersFPU_Masm;
609 if (GV.SYNTAX_ == NasmSyntax) {
610 pRegistersFPU = &RegistersFPU_Nasm;
611 }
612 if (MyMODRM <= 0xbf) {
613
614 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
615 if (GV.REGOPCODE == 0) {
616 GV.MemDecoration = Arg2dword;
617 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
618 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
619 #ifndef BEA_LIGHT_DISASSEMBLY
620 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd ");
621 #endif
622 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
623 (*pMyDisasm).Argument1.ArgSize = 80;
624 }
625 else if (GV.REGOPCODE == 1) {
626 GV.MemDecoration = Arg2dword;
627 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
628 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
629 #ifndef BEA_LIGHT_DISASSEMBLY
630 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul ");
631 #endif
632 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
633 (*pMyDisasm).Argument1.ArgSize = 80;
634 }
635 else if (GV.REGOPCODE == 2) {
636 GV.MemDecoration = Arg2dword;
637 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
638 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
639 #ifndef BEA_LIGHT_DISASSEMBLY
640 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom ");
641 #endif
642 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
643 (*pMyDisasm).Argument1.ArgSize = 80;
644 (*pMyDisasm).Argument1.AccessMode = READ;
645 }
646 else if (GV.REGOPCODE == 3) {
647 GV.MemDecoration = Arg2dword;
648 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
649 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
650 #ifndef BEA_LIGHT_DISASSEMBLY
651 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp ");
652 #endif
653 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
654 (*pMyDisasm).Argument1.ArgSize = 80;
655 (*pMyDisasm).Argument1.AccessMode = READ;
656 }
657 else if (GV.REGOPCODE == 4) {
658 GV.MemDecoration = Arg2dword;
659 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
660 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
661 #ifndef BEA_LIGHT_DISASSEMBLY
662 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub ");
663 #endif
664 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
665 (*pMyDisasm).Argument1.ArgSize = 80;
666 }
667 else if (GV.REGOPCODE == 5) {
668 GV.MemDecoration = Arg2dword;
669 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
670 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
671 #ifndef BEA_LIGHT_DISASSEMBLY
672 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr ");
673 #endif
674 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
675 (*pMyDisasm).Argument1.ArgSize = 80;
676 }
677 else if (GV.REGOPCODE == 6) {
678 GV.MemDecoration = Arg2dword;
679 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
680 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
681 #ifndef BEA_LIGHT_DISASSEMBLY
682 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv ");
683 #endif
684 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
685 (*pMyDisasm).Argument1.ArgSize = 80;
686 }
687 else if (GV.REGOPCODE == 7) {
688 GV.MemDecoration = Arg2dword;
689 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
690 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
691 #ifndef BEA_LIGHT_DISASSEMBLY
692 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr ");
693 #endif
694 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
695 (*pMyDisasm).Argument1.ArgSize = 80;
696 }
697 else {
698 FailDecode(pMyDisasm);
699 }
700 }
701 else {
702 if ((MyMODRM & 0xf0) == 0xc0) {
703 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
704 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
705 #ifndef BEA_LIGHT_DISASSEMBLY
706 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovb ");
707 #endif
708 }
709 else {
710 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
711 #ifndef BEA_LIGHT_DISASSEMBLY
712 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmove ");
713 #endif
714 (*pMyDisasm).Argument2.AccessMode = WRITE;
715 }
716 #ifndef BEA_LIGHT_DISASSEMBLY
717 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
718 #endif
719 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
720 (*pMyDisasm).Argument1.ArgSize = 80;
721 #ifndef BEA_LIGHT_DISASSEMBLY
722 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
723 #endif
724 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
725 (*pMyDisasm).Argument2.ArgSize = 80;
726 }
727 else if ((MyMODRM & 0xf0) == 0xd0) {
728 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
729 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
730 #ifndef BEA_LIGHT_DISASSEMBLY
731 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovbe ");
732 #endif
733 }
734 else {
735 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
736 #ifndef BEA_LIGHT_DISASSEMBLY
737 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovu ");
738 #endif
739 (*pMyDisasm).Argument2.AccessMode = WRITE;
740 }
741 #ifndef BEA_LIGHT_DISASSEMBLY
742 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
743 #endif
744 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
745 (*pMyDisasm).Argument1.ArgSize = 80;
746 #ifndef BEA_LIGHT_DISASSEMBLY
747 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
748 #endif
749 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
750 (*pMyDisasm).Argument2.ArgSize = 80;
751
752 }
753 else if (MyMODRM == 0xe9) {
754 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
755 #ifndef BEA_LIGHT_DISASSEMBLY
756 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucompp ");
757 #endif
758 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
759 (*pMyDisasm).Argument1.ArgSize = 80;
760 (*pMyDisasm).Argument1.AccessMode = READ;
761 }
762 else {
763 FailDecode(pMyDisasm);
764 }
765 }
766 GV.EIP_ += GV.DECALAGE_EIP+2;
767}
768
769
770/* ====================================================================
771 *
772 * ==================================================================== */
773void __bea_callspec__ DB_(PDISASM pMyDisasm)
774{
775 long MyMODRM;
776 char (*pRegistersFPU)[8][8] ;
777
778 GV.DECALAGE_EIP = 0;
779 if (!Security(1, pMyDisasm)) {return;}
780 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
781 pRegistersFPU = &RegistersFPU_Masm;
782 if (GV.SYNTAX_ == NasmSyntax) {
783 pRegistersFPU = &RegistersFPU_Nasm;
784 }
785 if (MyMODRM <= 0xbf) {
786
787 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
788 if (GV.REGOPCODE == 0) {
789 GV.MemDecoration = Arg2dword;
790 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
791 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
792 #ifndef BEA_LIGHT_DISASSEMBLY
793 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild ");
794 #endif
795 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
796 (*pMyDisasm).Argument1.ArgSize = 80;
797 }
798 else if (GV.REGOPCODE == 1) {
799 GV.MemDecoration = Arg1dword;
800 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
801 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
802 #ifndef BEA_LIGHT_DISASSEMBLY
803 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp ");
804 #endif
805 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
806 (*pMyDisasm).Argument2.ArgSize = 80;
807 }
808 else if (GV.REGOPCODE == 2) {
809 GV.MemDecoration = Arg1dword;
810 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
811 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
812 #ifndef BEA_LIGHT_DISASSEMBLY
813 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist ");
814 #endif
815 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
816 (*pMyDisasm).Argument2.ArgSize = 80;
817 }
818 else if (GV.REGOPCODE == 3) {
819 GV.MemDecoration = Arg1dword;
820 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
821 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
822 #ifndef BEA_LIGHT_DISASSEMBLY
823 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp ");
824 #endif
825 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
826 (*pMyDisasm).Argument2.ArgSize = 80;
827 }
828 else if (GV.REGOPCODE == 5) {
829 GV.MemDecoration = Arg2tbyte;
830 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
831 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
832 #ifndef BEA_LIGHT_DISASSEMBLY
833 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld ");
834 #endif
835 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
836 (*pMyDisasm).Argument1.ArgSize = 80;
837 }
838 else if (GV.REGOPCODE == 7) {
839 GV.MemDecoration = Arg1tbyte;
840 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
841 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
842 #ifndef BEA_LIGHT_DISASSEMBLY
843 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp ");
844 #endif
845 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
846 (*pMyDisasm).Argument2.ArgSize = 80;
847 }
848 else {
849 FailDecode(pMyDisasm);
850 }
851 }
852 else {
853 if ((MyMODRM & 0xf0) == 0xc0) {
854 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
855 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
856 #ifndef BEA_LIGHT_DISASSEMBLY
857 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnb ");
858 #endif
859 }
860 else {
861 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
862 #ifndef BEA_LIGHT_DISASSEMBLY
863 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovne ");
864 #endif
865 (*pMyDisasm).Argument2.AccessMode = WRITE;
866 }
867 #ifndef BEA_LIGHT_DISASSEMBLY
868 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
869 #endif
870 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
871 (*pMyDisasm).Argument1.ArgSize = 80;
872 #ifndef BEA_LIGHT_DISASSEMBLY
873 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
874 #endif
875 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
876 (*pMyDisasm).Argument2.ArgSize = 80;
877 }
878 else if ((MyMODRM & 0xf0) == 0xd0) {
879 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
880 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
881 #ifndef BEA_LIGHT_DISASSEMBLY
882 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnbe ");
883 #endif
884 }
885 else {
886 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
887 #ifndef BEA_LIGHT_DISASSEMBLY
888 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnu ");
889 #endif
890 (*pMyDisasm).Argument2.AccessMode = WRITE;
891 }
892 #ifndef BEA_LIGHT_DISASSEMBLY
893 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
894 #endif
895 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
896 (*pMyDisasm).Argument1.ArgSize = 80;
897 #ifndef BEA_LIGHT_DISASSEMBLY
898 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
899 #endif
900 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
901 (*pMyDisasm).Argument2.ArgSize = 80;
902 }
903 else if ((MyMODRM & 0xf0) == 0xe0) {
904
905 if ((MyMODRM & 0xf) ==0) {
906 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION;
907 #ifndef BEA_LIGHT_DISASSEMBLY
908 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fneni ");
909 #endif
910 }
911 else if ((MyMODRM & 0xf) ==1) {
912 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION;
913 #ifndef BEA_LIGHT_DISASSEMBLY
914 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fndisi ");
915 #endif
916 }
917 else if ((MyMODRM & 0xf) ==2) {
918 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
919 #ifndef BEA_LIGHT_DISASSEMBLY
920 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnclex ");
921 #endif
922 }
923 else if ((MyMODRM & 0xf) ==3) {
924 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
925 #ifndef BEA_LIGHT_DISASSEMBLY
926 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fninit ");
927 #endif
928 }
929 else if ((MyMODRM & 0xf) ==4) {
930 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION;
931 #ifndef BEA_LIGHT_DISASSEMBLY
932 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnsetpm ");
933 #endif
934 }
935 else if ((MyMODRM & 0xf) ==5) {
936 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
937 #ifndef BEA_LIGHT_DISASSEMBLY
938 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstpm ");
939 #endif
940 }
941 else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) {
942 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
943 #ifndef BEA_LIGHT_DISASSEMBLY
944 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomi ");
945 #endif
946 #ifndef BEA_LIGHT_DISASSEMBLY
947 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
948 #endif
949 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
950 (*pMyDisasm).Argument1.ArgSize = 80;
951 (*pMyDisasm).Argument1.AccessMode = READ;
952 #ifndef BEA_LIGHT_DISASSEMBLY
953 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
954 #endif
955 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
956 (*pMyDisasm).Argument2.ArgSize = 80;
957 }
958 else {
959 FailDecode(pMyDisasm);
960 }
961 }
962 else if ((MyMODRM & 0xf0) == 0xf0) {
963 if (((MyMODRM & 0xf) >=0x0) && ((MyMODRM & 0xf) <=0x7)) {
964 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
965 #ifndef BEA_LIGHT_DISASSEMBLY
966 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomi ");
967 #endif
968 #ifndef BEA_LIGHT_DISASSEMBLY
969 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
970 #endif
971 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
972 (*pMyDisasm).Argument1.ArgSize = 80;
973 (*pMyDisasm).Argument1.AccessMode = READ;
974 #ifndef BEA_LIGHT_DISASSEMBLY
975 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
976 #endif
977 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
978 (*pMyDisasm).Argument2.ArgSize = 80;
979 }
980 else {
981 FailDecode(pMyDisasm);
982 }
983 }
984 else {
985 FailDecode(pMyDisasm);
986 }
987 }
988 GV.EIP_ += GV.DECALAGE_EIP+2;
989}
990
991
992/* ====================================================================
993 *
994 * ==================================================================== */
995void __bea_callspec__ DC_(PDISASM pMyDisasm)
996{
997 long MyMODRM;
998 char (*pRegistersFPU)[8][8] ;
999
1000 GV.DECALAGE_EIP = 0;
1001 if (!Security(1, pMyDisasm)) {return;}
1002 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
1003 pRegistersFPU = &RegistersFPU_Masm;
1004 if (GV.SYNTAX_ == NasmSyntax) {
1005 pRegistersFPU = &RegistersFPU_Nasm;
1006 }
1007 if (MyMODRM <= 0xbf) {
1008
1009 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
1010 if (GV.REGOPCODE == 0) {
1011 GV.MemDecoration = Arg2qword;
1012 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1013 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1014 #ifndef BEA_LIGHT_DISASSEMBLY
1015 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd ");
1016 #endif
1017 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1018 (*pMyDisasm).Argument1.ArgSize = 80;
1019 }
1020 else if (GV.REGOPCODE == 1) {
1021 GV.MemDecoration = Arg2qword;
1022 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1023 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1024 #ifndef BEA_LIGHT_DISASSEMBLY
1025 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul ");
1026 #endif
1027 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1028 (*pMyDisasm).Argument1.ArgSize = 80;
1029 }
1030 else if (GV.REGOPCODE == 2) {
1031 GV.MemDecoration = Arg2qword;
1032 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1033 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1034 #ifndef BEA_LIGHT_DISASSEMBLY
1035 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom ");
1036 #endif
1037 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1038 (*pMyDisasm).Argument1.ArgSize = 80;
1039 (*pMyDisasm).Argument1.AccessMode = READ;
1040 }
1041 else if (GV.REGOPCODE == 3) {
1042 GV.MemDecoration = Arg2qword;
1043 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1044 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1045 #ifndef BEA_LIGHT_DISASSEMBLY
1046 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp ");
1047 #endif
1048 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1049 (*pMyDisasm).Argument1.ArgSize = 80;
1050 (*pMyDisasm).Argument1.AccessMode = READ;
1051 }
1052 else if (GV.REGOPCODE == 4) {
1053 GV.MemDecoration = Arg2qword;
1054 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1055 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1056 #ifndef BEA_LIGHT_DISASSEMBLY
1057 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub ");
1058 #endif
1059 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1060 (*pMyDisasm).Argument1.ArgSize = 80;
1061 }
1062 else if (GV.REGOPCODE == 5) {
1063 GV.MemDecoration = Arg2qword;
1064 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1065 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1066 #ifndef BEA_LIGHT_DISASSEMBLY
1067 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr ");
1068 #endif
1069 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1070 (*pMyDisasm).Argument1.ArgSize = 80;
1071 }
1072 else if (GV.REGOPCODE == 6) {
1073 GV.MemDecoration = Arg2qword;
1074 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1075 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1076 #ifndef BEA_LIGHT_DISASSEMBLY
1077 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv ");
1078 #endif
1079 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1080 (*pMyDisasm).Argument1.ArgSize = 80;
1081 }
1082 else if (GV.REGOPCODE == 7) {
1083 GV.MemDecoration = Arg2qword;
1084 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1085 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1086 #ifndef BEA_LIGHT_DISASSEMBLY
1087 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr ");
1088 #endif
1089 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1090 (*pMyDisasm).Argument1.ArgSize = 80;
1091 }
1092 else {
1093 FailDecode(pMyDisasm);
1094 }
1095 }
1096 else {
1097 if ((MyMODRM & 0xf0) == 0xc0) {
1098 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1099 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1100 #ifndef BEA_LIGHT_DISASSEMBLY
1101 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd ");
1102 #endif
1103 }
1104 else {
1105 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1106 #ifndef BEA_LIGHT_DISASSEMBLY
1107 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul ");
1108 #endif
1109 (*pMyDisasm).Argument1.AccessMode = WRITE;
1110 }
1111 #ifndef BEA_LIGHT_DISASSEMBLY
1112 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1113 #endif
1114 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1115 (*pMyDisasm).Argument2.ArgSize = 80;
1116 #ifndef BEA_LIGHT_DISASSEMBLY
1117 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1118 #endif
1119 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1120 (*pMyDisasm).Argument1.ArgSize = 80;
1121 }
1122 else if ((MyMODRM & 0xf0) == 0xd0) {
1123 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1124 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1125 #ifndef BEA_LIGHT_DISASSEMBLY
1126 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom2 ");
1127 #endif
1128
1129 }
1130 else {
1131 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1132 #ifndef BEA_LIGHT_DISASSEMBLY
1133 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp3 ");
1134 #endif
1135 }
1136 #ifndef BEA_LIGHT_DISASSEMBLY
1137 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1138 #endif
1139 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1140 (*pMyDisasm).Argument1.ArgSize = 80;
1141
1142 }
1143 else if ((MyMODRM & 0xf0) == 0xe0) {
1144 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1145 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1146 #ifndef BEA_LIGHT_DISASSEMBLY
1147 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr ");
1148 #endif
1149 }
1150 else {
1151 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1152 #ifndef BEA_LIGHT_DISASSEMBLY
1153 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub ");
1154 #endif
1155 }
1156 #ifndef BEA_LIGHT_DISASSEMBLY
1157 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1158 #endif
1159 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1160 (*pMyDisasm).Argument2.ArgSize = 80;
1161 #ifndef BEA_LIGHT_DISASSEMBLY
1162 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1163 #endif
1164 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1165 (*pMyDisasm).Argument1.ArgSize = 80;
1166 }
1167 else if ((MyMODRM & 0xf0) == 0xf0) {
1168 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1169 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1170 #ifndef BEA_LIGHT_DISASSEMBLY
1171 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr ");
1172 #endif
1173 }
1174 else {
1175 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1176 #ifndef BEA_LIGHT_DISASSEMBLY
1177 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv ");
1178 #endif
1179 }
1180 #ifndef BEA_LIGHT_DISASSEMBLY
1181 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1182 #endif
1183 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1184 (*pMyDisasm).Argument2.ArgSize = 80;
1185 #ifndef BEA_LIGHT_DISASSEMBLY
1186 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1187 #endif
1188 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1189 (*pMyDisasm).Argument1.ArgSize = 80;
1190
1191 }
1192 else {
1193 FailDecode(pMyDisasm);
1194 }
1195 }
1196 GV.EIP_ += GV.DECALAGE_EIP+2;
1197}
1198
1199
1200/* ====================================================================
1201 *
1202 * ==================================================================== */
1203void __bea_callspec__ DD_(PDISASM pMyDisasm)
1204{
1205 long MyMODRM;
1206 char (*pRegistersFPU)[8][8] ;
1207
1208 GV.DECALAGE_EIP = 0;
1209 if (!Security(1, pMyDisasm)) {return;}
1210 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
1211 pRegistersFPU = &RegistersFPU_Masm;
1212 if (GV.SYNTAX_ == NasmSyntax) {
1213 pRegistersFPU = &RegistersFPU_Nasm;
1214 }
1215 if (MyMODRM <= 0xbf) {
1216
1217 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
1218 if (GV.REGOPCODE == 0) {
1219 GV.MemDecoration = Arg2qword;
1220 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1221 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1222 #ifndef BEA_LIGHT_DISASSEMBLY
1223 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld ");
1224 #endif
1225 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1226 (*pMyDisasm).Argument1.ArgSize = 80;
1227 }
1228 else if (GV.REGOPCODE == 1) {
1229 GV.MemDecoration = Arg1qword;
1230 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1231 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1232 #ifndef BEA_LIGHT_DISASSEMBLY
1233 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp ");
1234 #endif
1235 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1236 (*pMyDisasm).Argument2.ArgSize = 80;
1237 }
1238 else if (GV.REGOPCODE == 2) {
1239 GV.MemDecoration = Arg1qword;
1240 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1241 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1242 #ifndef BEA_LIGHT_DISASSEMBLY
1243 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst ");
1244 #endif
1245 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1246 (*pMyDisasm).Argument2.ArgSize = 80;
1247 }
1248 else if (GV.REGOPCODE == 3) {
1249 GV.MemDecoration = Arg1qword;
1250 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1251 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1252 #ifndef BEA_LIGHT_DISASSEMBLY
1253 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp ");
1254 #endif
1255 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1256 (*pMyDisasm).Argument2.ArgSize = 80;
1257 }
1258 else if (GV.REGOPCODE == 4) {
1259 GV.MemDecoration = Arg2multibytes;
1260 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1261 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1262 #ifndef BEA_LIGHT_DISASSEMBLY
1263 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstor ");
1264 #endif
1265 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1266 (*pMyDisasm).Argument1.ArgSize = 108*8;
1267 }
1268 else if (GV.REGOPCODE == 6) {
1269 GV.MemDecoration = Arg1multibytes;
1270 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1271 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1272 #ifndef BEA_LIGHT_DISASSEMBLY
1273 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsave ");
1274 #endif
1275 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1276 (*pMyDisasm).Argument2.ArgSize = 108*8;
1277 }
1278 else if (GV.REGOPCODE == 7) {
1279 GV.MemDecoration = Arg1word;
1280 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1281 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1282 #ifndef BEA_LIGHT_DISASSEMBLY
1283 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstsw ");
1284 #endif
1285 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG;
1286 (*pMyDisasm).Argument2.ArgSize = 16;
1287 }
1288 else {
1289 FailDecode(pMyDisasm);
1290 }
1291 }
1292 else {
1293 if ((MyMODRM & 0xf0) == 0xc0) {
1294 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1295 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1296 #ifndef BEA_LIGHT_DISASSEMBLY
1297 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffree ");
1298 #endif
1299 }
1300 else {
1301 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1302 #ifndef BEA_LIGHT_DISASSEMBLY
1303 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch4 ");
1304 #endif
1305 (*pMyDisasm).Argument2.AccessMode = WRITE;
1306 }
1307 #ifndef BEA_LIGHT_DISASSEMBLY
1308 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1309 #endif
1310 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1311 (*pMyDisasm).Argument1.ArgSize = 80;
1312 }
1313 else if ((MyMODRM & 0xf0) == 0xd0) {
1314 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1315 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1316 #ifndef BEA_LIGHT_DISASSEMBLY
1317 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst ");
1318 #endif
1319 }
1320 else {
1321 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1322 #ifndef BEA_LIGHT_DISASSEMBLY
1323 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp ");
1324 #endif
1325 (*pMyDisasm).Argument2.AccessMode = WRITE;
1326 }
1327 #ifndef BEA_LIGHT_DISASSEMBLY
1328 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1329 #endif
1330 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1331 (*pMyDisasm).Argument1.ArgSize = 80;
1332
1333 }
1334 else if ((MyMODRM & 0xf0) == 0xe0) {
1335 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1336 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1337 #ifndef BEA_LIGHT_DISASSEMBLY
1338 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucom ");
1339 #endif
1340 #ifndef BEA_LIGHT_DISASSEMBLY
1341 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1342 #endif
1343 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1344 (*pMyDisasm).Argument2.ArgSize = 80;
1345 #ifndef BEA_LIGHT_DISASSEMBLY
1346 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1347 #endif
1348 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1349 (*pMyDisasm).Argument1.ArgSize = 80;
1350 }
1351 else {
1352 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1353 #ifndef BEA_LIGHT_DISASSEMBLY
1354 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomp ");
1355 #endif
1356 #ifndef BEA_LIGHT_DISASSEMBLY
1357 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1358 #endif
1359 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1360 (*pMyDisasm).Argument1.ArgSize = 80;
1361 }
1362
1363 }
1364
1365 else {
1366 FailDecode(pMyDisasm);
1367 }
1368 }
1369 GV.EIP_ += GV.DECALAGE_EIP+2;
1370}
1371
1372
1373/* ====================================================================
1374 *
1375 * ==================================================================== */
1376void __bea_callspec__ DE_(PDISASM pMyDisasm)
1377{
1378 long MyMODRM;
1379 char (*pRegistersFPU)[8][8] ;
1380
1381 GV.DECALAGE_EIP = 0;
1382 if (!Security(1, pMyDisasm)) {return;}
1383 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
1384 pRegistersFPU = &RegistersFPU_Masm;
1385 if (GV.SYNTAX_ == NasmSyntax) {
1386 pRegistersFPU = &RegistersFPU_Nasm;
1387 }
1388 if (MyMODRM <= 0xbf) {
1389
1390 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
1391 if (GV.REGOPCODE == 0) {
1392 GV.MemDecoration = Arg2word;
1393 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1394 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1395 #ifndef BEA_LIGHT_DISASSEMBLY
1396 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd ");
1397 #endif
1398 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1399 (*pMyDisasm).Argument1.ArgSize = 80;
1400 }
1401 else if (GV.REGOPCODE == 1) {
1402 GV.MemDecoration = Arg2word;
1403 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1404 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1405 #ifndef BEA_LIGHT_DISASSEMBLY
1406 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul ");
1407 #endif
1408 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1409 (*pMyDisasm).Argument1.ArgSize = 80;
1410 }
1411 else if (GV.REGOPCODE == 2) {
1412 GV.MemDecoration = Arg2word;
1413 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1414 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1415 #ifndef BEA_LIGHT_DISASSEMBLY
1416 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom ");
1417 #endif
1418 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1419 (*pMyDisasm).Argument1.ArgSize = 80;
1420 }
1421 else if (GV.REGOPCODE == 3) {
1422 GV.MemDecoration = Arg2word;
1423 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1424 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1425 #ifndef BEA_LIGHT_DISASSEMBLY
1426 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp ");
1427 #endif
1428 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1429 (*pMyDisasm).Argument1.ArgSize = 80;
1430 }
1431 else if (GV.REGOPCODE == 4) {
1432 GV.MemDecoration = Arg2word;
1433 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1434 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1435 #ifndef BEA_LIGHT_DISASSEMBLY
1436 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub ");
1437 #endif
1438 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1439 (*pMyDisasm).Argument1.ArgSize = 80;
1440 }
1441 else if (GV.REGOPCODE == 5) {
1442 GV.MemDecoration = Arg2word;
1443 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1444 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1445 #ifndef BEA_LIGHT_DISASSEMBLY
1446 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr ");
1447 #endif
1448 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1449 (*pMyDisasm).Argument1.ArgSize = 80;
1450 }
1451 else if (GV.REGOPCODE == 6) {
1452 GV.MemDecoration = Arg2word;
1453 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1454 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1455 #ifndef BEA_LIGHT_DISASSEMBLY
1456 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv ");
1457 #endif
1458 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1459 (*pMyDisasm).Argument1.ArgSize = 80;
1460 }
1461 else if (GV.REGOPCODE == 7) {
1462 GV.MemDecoration = Arg2word;
1463 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1464 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1465 #ifndef BEA_LIGHT_DISASSEMBLY
1466 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr ");
1467 #endif
1468 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1469 (*pMyDisasm).Argument1.ArgSize = 80;
1470 }
1471 else {
1472 FailDecode(pMyDisasm);
1473 }
1474 }
1475 else {
1476 if ((MyMODRM & 0xf0) == 0xc0) {
1477 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1478 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1479 #ifndef BEA_LIGHT_DISASSEMBLY
1480 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "faddp ");
1481 #endif
1482 }
1483 else {
1484 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1485 #ifndef BEA_LIGHT_DISASSEMBLY
1486 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmulp ");
1487 #endif
1488 (*pMyDisasm).Argument2.AccessMode = WRITE;
1489 }
1490 #ifndef BEA_LIGHT_DISASSEMBLY
1491 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1492 #endif
1493 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1494 (*pMyDisasm).Argument2.ArgSize = 80;
1495 #ifndef BEA_LIGHT_DISASSEMBLY
1496 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1497 #endif
1498 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1499 (*pMyDisasm).Argument1.ArgSize = 80;
1500 }
1501 else if ((MyMODRM & 0xf0) == 0xd0) {
1502 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1503 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1504 #ifndef BEA_LIGHT_DISASSEMBLY
1505 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp5 ");
1506 #endif
1507 #ifndef BEA_LIGHT_DISASSEMBLY
1508 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1509 #endif
1510 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1511 (*pMyDisasm).Argument1.ArgSize = 80;
1512 }
1513 else if (MyMODRM == 0xd9){
1514 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1515 #ifndef BEA_LIGHT_DISASSEMBLY
1516 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcompp ");
1517 #endif
1518 }
1519 else {
1520 FailDecode(pMyDisasm);
1521 }
1522
1523
1524 }
1525 else if ((MyMODRM & 0xf0) == 0xe0) {
1526 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1527 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1528 #ifndef BEA_LIGHT_DISASSEMBLY
1529 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubrp ");
1530 #endif
1531 }
1532 else {
1533 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1534 #ifndef BEA_LIGHT_DISASSEMBLY
1535 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubp ");
1536 #endif
1537 (*pMyDisasm).Argument2.AccessMode = WRITE;
1538 }
1539 #ifndef BEA_LIGHT_DISASSEMBLY
1540 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1541 #endif
1542 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1543 (*pMyDisasm).Argument2.ArgSize = 80;
1544 #ifndef BEA_LIGHT_DISASSEMBLY
1545 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1546 #endif
1547 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1548 (*pMyDisasm).Argument1.ArgSize = 80;
1549 }
1550 else if ((MyMODRM & 0xf0) == 0xf0) {
1551 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1552 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1553 #ifndef BEA_LIGHT_DISASSEMBLY
1554 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivrp ");
1555 #endif
1556 }
1557 else {
1558 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION;
1559 #ifndef BEA_LIGHT_DISASSEMBLY
1560 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivp ");
1561 #endif
1562 (*pMyDisasm).Argument2.AccessMode = WRITE;
1563 }
1564 #ifndef BEA_LIGHT_DISASSEMBLY
1565 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]);
1566 #endif
1567 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1568 (*pMyDisasm).Argument2.ArgSize = 80;
1569 #ifndef BEA_LIGHT_DISASSEMBLY
1570 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1571 #endif
1572 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1573 (*pMyDisasm).Argument1.ArgSize = 80;
1574
1575 }
1576 else {
1577 FailDecode(pMyDisasm);
1578 }
1579 }
1580 GV.EIP_ += GV.DECALAGE_EIP+2;
1581}
1582
1583
1584/* ====================================================================
1585 *
1586 * ==================================================================== */
1587void __bea_callspec__ DF_(PDISASM pMyDisasm)
1588{
1589 long MyMODRM;
1590 char (*pRegistersFPU)[8][8] ;
1591
1592 GV.DECALAGE_EIP = 0;
1593 if (!Security(1, pMyDisasm)) {return;}
1594 MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1));
1595 pRegistersFPU = &RegistersFPU_Masm;
1596 if (GV.SYNTAX_ == NasmSyntax) {
1597 pRegistersFPU = &RegistersFPU_Nasm;
1598 }
1599 if (MyMODRM <= 0xbf) {
1600
1601 GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
1602 if (GV.REGOPCODE == 0) {
1603 GV.MemDecoration = Arg2word;
1604 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1605 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1606 #ifndef BEA_LIGHT_DISASSEMBLY
1607 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild ");
1608 #endif
1609 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1610 (*pMyDisasm).Argument1.ArgSize = 80;
1611 }
1612 else if (GV.REGOPCODE == 1) {
1613 GV.MemDecoration = Arg1word;
1614 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1615 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1616 #ifndef BEA_LIGHT_DISASSEMBLY
1617 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp ");
1618 #endif
1619 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1620 (*pMyDisasm).Argument2.ArgSize = 80;
1621 }
1622 else if (GV.REGOPCODE == 2) {
1623 GV.MemDecoration = Arg1word;
1624 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1625 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1626 #ifndef BEA_LIGHT_DISASSEMBLY
1627 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist ");
1628 #endif
1629 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1630 (*pMyDisasm).Argument2.ArgSize = 80;
1631 }
1632 else if (GV.REGOPCODE == 3) {
1633 GV.MemDecoration = Arg1word;
1634 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1635 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1636 #ifndef BEA_LIGHT_DISASSEMBLY
1637 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp ");
1638 #endif
1639 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1640 (*pMyDisasm).Argument2.ArgSize = 80;
1641 }
1642 else if (GV.REGOPCODE == 4) {
1643 GV.MemDecoration = Arg2multibytes;
1644 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1645 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1646 #ifndef BEA_LIGHT_DISASSEMBLY
1647 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbld ");
1648 #endif
1649 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1650 (*pMyDisasm).Argument1.ArgSize = 80;
1651 }
1652 else if (GV.REGOPCODE == 5) {
1653 GV.MemDecoration = Arg2qword;
1654 MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm);
1655 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1656 #ifndef BEA_LIGHT_DISASSEMBLY
1657 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild ");
1658 #endif
1659 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1660 (*pMyDisasm).Argument1.ArgSize = 80;
1661 }
1662 else if (GV.REGOPCODE == 6) {
1663 GV.MemDecoration = Arg1multibytes;
1664 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1665 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1666 #ifndef BEA_LIGHT_DISASSEMBLY
1667 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbstp ");
1668 #endif
1669 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1670 (*pMyDisasm).Argument2.ArgSize = 80;
1671 }
1672 else if (GV.REGOPCODE == 7) {
1673 GV.MemDecoration = Arg1qword;
1674 MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
1675 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1676 #ifndef BEA_LIGHT_DISASSEMBLY
1677 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp ");
1678 #endif
1679 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0;
1680 (*pMyDisasm).Argument2.ArgSize = 80;
1681 }
1682 else {
1683 FailDecode(pMyDisasm);
1684 }
1685 }
1686 else {
1687 if ((MyMODRM & 0xf0) == 0xc0) {
1688 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1689 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1690 #ifndef BEA_LIGHT_DISASSEMBLY
1691 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffreep ");
1692 #endif
1693 }
1694 else {
1695 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1696 #ifndef BEA_LIGHT_DISASSEMBLY
1697 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch7 ");
1698 #endif
1699 (*pMyDisasm).Argument2.AccessMode = WRITE;
1700 }
1701 #ifndef BEA_LIGHT_DISASSEMBLY
1702 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1703 #endif
1704 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1705 (*pMyDisasm).Argument1.ArgSize = 80;
1706 }
1707 else if ((MyMODRM & 0xf0) == 0xd0) {
1708 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1709 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1710 #ifndef BEA_LIGHT_DISASSEMBLY
1711 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp8 ");
1712 #endif
1713 }
1714 else {
1715 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER;
1716 #ifndef BEA_LIGHT_DISASSEMBLY
1717 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp9 ");
1718 #endif
1719 (*pMyDisasm).Argument2.AccessMode = WRITE;
1720 }
1721 #ifndef BEA_LIGHT_DISASSEMBLY
1722 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1723 #endif
1724 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1725 (*pMyDisasm).Argument1.ArgSize = 80;
1726
1727 }
1728 else if ((MyMODRM & 0xf0) == 0xe0) {
1729 if (MyMODRM == 0xe0) {
1730 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL;
1731 #ifndef BEA_LIGHT_DISASSEMBLY
1732 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstsw ");
1733 #endif
1734 }
1735 else if ((MyMODRM & 0xf) >=8) {
1736 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1737 #ifndef BEA_LIGHT_DISASSEMBLY
1738 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomip ");
1739 #endif
1740 #ifndef BEA_LIGHT_DISASSEMBLY
1741 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
1742 #endif
1743 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1744 (*pMyDisasm).Argument1.ArgSize = 80;
1745 #ifndef BEA_LIGHT_DISASSEMBLY
1746 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1747 #endif
1748 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1749 (*pMyDisasm).Argument2.ArgSize = 80;
1750 }
1751
1752
1753 else {
1754 FailDecode(pMyDisasm);
1755 }
1756 }
1757
1758 else if ((MyMODRM & 0xf0) == 0xf0) {
1759 if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) {
1760 (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION;
1761 #ifndef BEA_LIGHT_DISASSEMBLY
1762 (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomip ");
1763 #endif
1764 #ifndef BEA_LIGHT_DISASSEMBLY
1765 (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]);
1766 #endif
1767 (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0];
1768 (*pMyDisasm).Argument1.ArgSize = 80;
1769 #ifndef BEA_LIGHT_DISASSEMBLY
1770 (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]);
1771 #endif
1772 (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8];
1773 (*pMyDisasm).Argument2.ArgSize = 80;
1774 }
1775 else {
1776 FailDecode(pMyDisasm);
1777 }
1778
1779 }
1780 else {
1781 FailDecode(pMyDisasm);
1782 }
1783 }
1784 GV.EIP_ += GV.DECALAGE_EIP+2;
1785}
Note: See TracBrowser for help on using the repository browser.