[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 | *
|
---|
| 21 | * ==================================================================== */
|
---|
| 22 | void __bea_callspec__ G13_(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, "psrld ");
|
---|
| 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, "psrld ");
|
---|
| 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, "psrad ");
|
---|
| 92 | #endif
|
---|
| 93 | }
|
---|
| 94 | else {
|
---|
| 95 | FailDecode(pMyDisasm);
|
---|
| 96 | }
|
---|
| 97 | GV.EIP_ += GV.DECALAGE_EIP+3;
|
---|
| 98 | if (!Security(0, pMyDisasm)) return;
|
---|
| 99 | MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
|
---|
| 100 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 101 | (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
|
---|
| 102 | #endif
|
---|
| 103 | (*pMyDisasm).Instruction.Immediat = MyNumber;
|
---|
| 104 | (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
|
---|
| 105 | (*pMyDisasm).Argument2.ArgSize = 8;
|
---|
| 106 | }
|
---|
| 107 | else {
|
---|
| 108 | (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
|
---|
| 109 | GV.MemDecoration = Arg1qword;
|
---|
| 110 | GV.ImmediatSize = 8;
|
---|
| 111 | GV.MMX_ = 1;
|
---|
| 112 | MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
|
---|
| 113 | GV.MMX_ = 0;
|
---|
| 114 | if (GV.MOD_== 0x3) {
|
---|
| 115 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 116 | (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad ");
|
---|
| 117 | #endif
|
---|
| 118 | }
|
---|
| 119 | else {
|
---|
| 120 | FailDecode(pMyDisasm);
|
---|
| 121 | }
|
---|
| 122 | GV.EIP_ += GV.DECALAGE_EIP+3;
|
---|
| 123 | if (!Security(0, pMyDisasm)) return;
|
---|
| 124 |
|
---|
| 125 | MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
|
---|
| 126 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 127 | (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
|
---|
| 128 | #endif
|
---|
| 129 | (*pMyDisasm).Instruction.Immediat = MyNumber;
|
---|
| 130 | (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
|
---|
| 131 | (*pMyDisasm).Argument2.ArgSize = 8;
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | }
|
---|
| 135 | else if (GV.REGOPCODE == 6) {
|
---|
| 136 | if (GV.OperandSize == 16) {
|
---|
| 137 | (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE;
|
---|
| 138 | GV.MemDecoration = Arg1dqword;
|
---|
| 139 | GV.ImmediatSize = 8;
|
---|
| 140 | GV.SSE_ = 1;
|
---|
| 141 | MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
|
---|
| 142 | GV.SSE_ = 0;
|
---|
| 143 | if (GV.MOD_== 0x3) {
|
---|
| 144 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 145 | (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld ");
|
---|
| 146 | #endif
|
---|
| 147 | }
|
---|
| 148 | else {
|
---|
| 149 | FailDecode(pMyDisasm);
|
---|
| 150 | }
|
---|
| 151 | GV.EIP_ += GV.DECALAGE_EIP+3;
|
---|
| 152 | if (!Security(0, pMyDisasm)) return;
|
---|
| 153 |
|
---|
| 154 | MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
|
---|
| 155 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 156 | (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
|
---|
| 157 | #endif
|
---|
| 158 | (*pMyDisasm).Instruction.Immediat = MyNumber;
|
---|
| 159 | (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
|
---|
| 160 | (*pMyDisasm).Argument2.ArgSize = 8;
|
---|
| 161 | }
|
---|
| 162 | else {
|
---|
| 163 | (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE;
|
---|
| 164 | GV.MemDecoration = Arg1qword;
|
---|
| 165 | GV.ImmediatSize = 8;
|
---|
| 166 | GV.MMX_ = 1;
|
---|
| 167 | MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm);
|
---|
| 168 | GV.MMX_ = 0;
|
---|
| 169 | if (GV.MOD_== 0x3) {
|
---|
| 170 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 171 | (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld ");
|
---|
| 172 | #endif
|
---|
| 173 | }
|
---|
| 174 | else {
|
---|
| 175 | FailDecode(pMyDisasm);
|
---|
| 176 | }
|
---|
| 177 | GV.EIP_ += GV.DECALAGE_EIP+3;
|
---|
| 178 | if (!Security(0, pMyDisasm)) return;
|
---|
| 179 |
|
---|
| 180 | MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1));
|
---|
| 181 | #ifndef BEA_LIGHT_DISASSEMBLY
|
---|
| 182 | (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber);
|
---|
| 183 | #endif
|
---|
| 184 | (*pMyDisasm).Instruction.Immediat = MyNumber;
|
---|
| 185 | (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_;
|
---|
| 186 | (*pMyDisasm).Argument2.ArgSize = 8;
|
---|
| 187 | }
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | else {
|
---|
| 191 | FailDecode(pMyDisasm);
|
---|
| 192 | }
|
---|
| 193 |
|
---|
| 194 | }
|
---|