diff --git a/beaengine/beaengineSources/Includes/BeaEngineVersion.c b/beaengine/beaengineSources/Includes/BeaEngineVersion.c index 834c0cb30a08c04eb56dd3446b18a13be3ca818a..80a81eddfec4aabdda39b8febf91ee2a1ac62a16 100644 --- a/beaengine/beaengineSources/Includes/BeaEngineVersion.c +++ b/beaengine/beaengineSources/Includes/BeaEngineVersion.c @@ -1,23 +1,23 @@ -/* Copyright 2006-2010, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ -const__ char* __bea_callspec__ BeaEngineVersion(void) { - return "4.1"; -} -const__ char* __bea_callspec__ BeaEngineRevision(void) { - return "166"; -} +/* Copyright 2006-2010, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ +const__ char* __bea_callspec__ BeaEngineVersion(void) { + return "4.1"; +} +const__ char* __bea_callspec__ BeaEngineRevision(void) { + return "166"; +} diff --git a/beaengine/beaengineSources/Includes/Routines_Disasm.c b/beaengine/beaengineSources/Includes/Routines_Disasm.c index 53e6cc5ad6fdd40269e15469f38453247636fed3..695f3a348c732c2945d35b937bd19a8e9ee2b6de 100644 --- a/beaengine/beaengineSources/Includes/Routines_Disasm.c +++ b/beaengine/beaengineSources/Includes/Routines_Disasm.c @@ -464,6 +464,62 @@ void __bea_callspec__ GxEx(PDISASM pMyDisasm) GV.EIP_ += GV.DECALAGE_EIP+2; } +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ VxGxEx(PDISASM pMyDisasm) +{ + int origOperandSize=GV.OperandSize; + GV.OperandSize=128+128*GV.AVX_; + V_reg(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize=origOperandSize; + MOD_RM(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +void __bea_callspec__ Vx_opt_GxEx_vexlen(PDISASM pMyDisasm) +{ + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.AVX_ = 0; + GV.SSE_ = 0; +} + +void __bea_callspec__ Vx_opt_GxEx_vexlen_imm(PDISASM pMyDisasm) +{ + Vx_opt_GxEx_vexlen(pMyDisasm); + if(GV.VEX.has_vex) + { + L_imm(&pMyDisasm->Argument4,pMyDisasm); + GV.forth_arg=1; + + } + else + { + GV.third_arg=1; + L_imm(&pMyDisasm->Argument3,pMyDisasm); + } + +} + + +void __bea_callspec__ Vx_opt_GxEx(PDISASM pMyDisasm) +{ + if(GV.VEX.has_vex) + { + GV.MemDecoration+=100; + VxGxEx(pMyDisasm); + GV.third_arg=1; + } + else + GxEx(pMyDisasm); +} + + /* ==================================================================== * * ==================================================================== */ @@ -933,9 +989,11 @@ void __bea_callspec__ BuildCompleteInstruction(PDISASM pMyDisasm) { (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, ", "); i += 2; - if ((GV.MemDecoration >200) && (GV.MemDecoration < 399)) + if ((GV.MemDecoration >200) && (GV.MemDecoration < 299)) { GV.MemDecoration -= 200; + (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, NasmPrefixes[GV.MemDecoration-1]); + i = strlen((char*) &(*pMyDisasm).CompleteInstr); if (GV.SYNTAX_ == NasmSyntax) { i = strlen((char*) &(*pMyDisasm).CompleteInstr); diff --git a/beaengine/beaengineSources/Includes/Routines_ModRM.c b/beaengine/beaengineSources/Includes/Routines_ModRM.c index 2d080df8a14a850dc16c4d0400df83268da0f8e9..ea9840f2c9fdcbabbf86298b8d1b970f8b83ecc7 100644 --- a/beaengine/beaengineSources/Includes/Routines_ModRM.c +++ b/beaengine/beaengineSources/Includes/Routines_ModRM.c @@ -446,13 +446,13 @@ void __bea_callspec__ Addr_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) CalculateRelativeAddress(&MyAddress, (Int64)MyNumber, pMyDisasm); (*pMyDisasm).Instruction.AddrValue = MyAddress; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.16llX", (Int64)MyAddress); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.16llx", (Int64)MyAddress); #endif (*pMyArgument).ArgType |= RELATIVE_; } else { #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X", (Int64)MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x", (Int64)MyNumber); #endif } } @@ -515,7 +515,7 @@ void __bea_callspec__ Addr_ESI(ARGTYPE* pMyArgument, PDISASM pMyDisasm) (*pMyArgument).Memory.DisplacementSize = 2; if (!Security(2, pMyDisasm)) return; #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.4X", (Int64)MyNumber); + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x", (Int64)MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -603,13 +603,13 @@ void __bea_callspec__ Addr_EAX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -671,7 +671,7 @@ void __bea_callspec__ Addr_EAX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -680,7 +680,7 @@ void __bea_callspec__ Addr_EAX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -705,13 +705,13 @@ void __bea_callspec__ Addr_ECX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -773,7 +773,7 @@ void __bea_callspec__ Addr_ECX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -782,7 +782,7 @@ void __bea_callspec__ Addr_ECX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -807,13 +807,13 @@ void __bea_callspec__ Addr_EDX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -874,7 +874,7 @@ void __bea_callspec__ Addr_EDX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -883,7 +883,7 @@ void __bea_callspec__ Addr_EDX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -908,13 +908,13 @@ void __bea_callspec__ Addr_EBX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -975,7 +975,7 @@ void __bea_callspec__ Addr_EBX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -984,7 +984,7 @@ void __bea_callspec__ Addr_EBX_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1017,13 +1017,13 @@ void __bea_callspec__ Addr_SIB_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } /*#ifndef BEA_LIGHT_DISASSEMBLY @@ -1062,7 +1062,7 @@ void __bea_callspec__ Addr_SIB_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1071,7 +1071,7 @@ void __bea_callspec__ Addr_SIB_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1097,13 +1097,13 @@ void __bea_callspec__ Addr_EBP_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1163,7 +1163,7 @@ void __bea_callspec__ Addr_EBP_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1172,7 +1172,7 @@ void __bea_callspec__ Addr_EBP_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1197,13 +1197,13 @@ void __bea_callspec__ Addr_ESI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1263,7 +1263,7 @@ void __bea_callspec__ Addr_ESI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1272,7 +1272,7 @@ void __bea_callspec__ Addr_ESI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1297,13 +1297,13 @@ void __bea_callspec__ Addr_EDI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1363,7 +1363,7 @@ void __bea_callspec__ Addr_EDI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1372,7 +1372,7 @@ void __bea_callspec__ Addr_EDI_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.2X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1404,13 +1404,13 @@ void __bea_callspec__ Addr_EAX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1470,7 +1470,7 @@ void __bea_callspec__ Addr_EAX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1479,7 +1479,7 @@ void __bea_callspec__ Addr_EAX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1511,13 +1511,13 @@ void __bea_callspec__ Addr_ECX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1578,7 +1578,7 @@ void __bea_callspec__ Addr_ECX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1587,7 +1587,7 @@ void __bea_callspec__ Addr_ECX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1618,13 +1618,13 @@ void __bea_callspec__ Addr_EDX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1685,7 +1685,7 @@ void __bea_callspec__ Addr_EDX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1694,7 +1694,7 @@ void __bea_callspec__ Addr_EDX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1725,13 +1725,13 @@ void __bea_callspec__ Addr_EBX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1792,7 +1792,7 @@ void __bea_callspec__ Addr_EBX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1801,7 +1801,7 @@ void __bea_callspec__ Addr_EBX_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1835,13 +1835,13 @@ void __bea_callspec__ Addr_SIB_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } /*#ifndef BEA_LIGHT_DISASSEMBLY @@ -1879,7 +1879,7 @@ void __bea_callspec__ Addr_SIB_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1888,7 +1888,7 @@ void __bea_callspec__ Addr_SIB_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -1920,13 +1920,13 @@ void __bea_callspec__ Addr_EBP_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -1986,7 +1986,7 @@ void __bea_callspec__ Addr_EBP_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -1995,7 +1995,7 @@ void __bea_callspec__ Addr_EBP_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -2026,13 +2026,13 @@ void __bea_callspec__ Addr_ESI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -2092,7 +2092,7 @@ void __bea_callspec__ Addr_ESI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -2101,7 +2101,7 @@ void __bea_callspec__ Addr_ESI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -2132,13 +2132,13 @@ void __bea_callspec__ Addr_EDI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) i ++; j=i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) ~MyNumber+1); #endif } else { j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) MyNumber); #endif } #ifndef BEA_LIGHT_DISASSEMBLY @@ -2198,7 +2198,7 @@ void __bea_callspec__ Addr_EDI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) ~MyNumber+1); #endif } else { @@ -2207,7 +2207,7 @@ void __bea_callspec__ Addr_EDI_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm) #endif i++; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%x",(Int64) MyNumber); #endif } } @@ -3255,12 +3255,13 @@ size_t __bea_callspec__ SIB_0(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) /* ========================= Interpret Base */ size_t j; - if ((GV.BASE_ == 5) && (GV.MOD_ == 0)) { + if ((GV.BASE_ == 5) && (GV.MOD_ == 0) && (GV.REX.B_==0)) + { GV.DECALAGE_EIP += 4; if (!Security(7, pMyDisasm)) return i; j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); #endif (*pMyArgument).Memory.Displacement = *((UInt32*)(UIntPtr) (GV.EIP_+3)); (*pMyArgument).Memory.DisplacementAddr = GV.EIP_+3; @@ -3311,7 +3312,7 @@ size_t __bea_callspec__ SIB_0(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) /* ======================== Interpret Index */ - if (GV.INDEX_ != 4 || GV.REX.X_) { + if (GV.INDEX_ != 4 || GV.REX.X_ || (GV.VEX.has_vex && !GV.VEX.notX)) { if (GV.SYNTAX_ == ATSyntax) { if (GV.BASE_ == 5) { #ifndef BEA_LIGHT_DISASSEMBLY @@ -3389,7 +3390,7 @@ size_t __bea_callspec__ SIB_1(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) if (!Security(7, pMyDisasm)) return i; j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); #endif (*pMyArgument).Memory.Displacement = *((UInt32*)(UIntPtr) (GV.EIP_+3)); (*pMyArgument).Memory.DisplacementAddr = GV.EIP_+3; @@ -3438,7 +3439,7 @@ size_t __bea_callspec__ SIB_1(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) } /* ======================== Interpret Index */ - if (GV.INDEX_ != 4 || GV.REX.X_) { + if (GV.INDEX_ != 4 || GV.REX.X_ || (GV.VEX.has_vex && !GV.VEX.notX)) { if (GV.SYNTAX_ == ATSyntax) { if (GV.BASE_ == 5) { #ifndef BEA_LIGHT_DISASSEMBLY @@ -3531,7 +3532,7 @@ size_t __bea_callspec__ SIB_2(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) if (!Security(7, pMyDisasm)) return i; j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); #endif (*pMyArgument).Memory.Displacement = *((UInt32*)(UIntPtr) (GV.EIP_+3)); (*pMyArgument).Memory.DisplacementAddr = GV.EIP_+3; @@ -3580,7 +3581,7 @@ size_t __bea_callspec__ SIB_2(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) } /* ======================== Interpret Index */ - if (GV.INDEX_ != 4) { + if (GV.INDEX_ != 4 || GV.REX.X_ || (GV.VEX.has_vex && !GV.VEX.notX)) { if (GV.SYNTAX_ == ATSyntax) { if (GV.BASE_ == 5) { #ifndef BEA_LIGHT_DISASSEMBLY @@ -3672,7 +3673,7 @@ size_t __bea_callspec__ SIB_3(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) if (!Security(7, pMyDisasm)) return i; j = i; #ifndef BEA_LIGHT_DISASSEMBLY - i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); + i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%x",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3))); #endif (*pMyArgument).Memory.Displacement = *((UInt32*)(UIntPtr) (GV.EIP_+3)); (*pMyArgument).Memory.DisplacementAddr = GV.EIP_+3; @@ -3721,7 +3722,7 @@ size_t __bea_callspec__ SIB_3(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm) } /* ======================== Interpret Index */ - if (GV.INDEX_ != 4 || GV.REX.X_) { + if (GV.INDEX_ != 4 || GV.REX.X_ || (GV.VEX.has_vex && !GV.VEX.notX)) { if (GV.SYNTAX_ == ATSyntax) { if (GV.BASE_ == 5) { #ifndef BEA_LIGHT_DISASSEMBLY diff --git a/beaengine/beaengineSources/Includes/instr_set/Data_opcode.h b/beaengine/beaengineSources/Includes/instr_set/Data_opcode.h index 9fd715d2284ca9d67b0235131422cd1cbe1eee76..70da8cfa57e0f8fefd6c745353c3df63de10faf3 100644 --- a/beaengine/beaengineSources/Includes/instr_set/Data_opcode.h +++ b/beaengine/beaengineSources/Includes/instr_set/Data_opcode.h @@ -1,175 +1,177 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* =============================================================================== */ -/* */ -/* */ -/* 1 BYTE_OPCODE MAP */ -/* */ -/* */ -/* =============================================================================== */ - -void (__bea_callspec__ * opcode_map1[])(PDISASM) = { - add_EbGb , add_EvGv , add_GbEb , add_GvEv , add_ALIb , add_eAX_Iv, push_es , pop_es , or_EbGb , or_EvGv , or_GbEb , or_GvEv , or_ALIb , or_eAX_Iv , push_cs , Esc_2byte , - adc_EbGb , adc_EvGv , adc_GbEb , adc_GvEv , adc_ALIb , adc_eAX_Iv, push_ss , pop_ss , sbb_EbGb , sbb_EvGv , sbb_GbEb , sbb_GvEv , sbb_ALIb , sbb_eAX_Iv, push_ds , pop_ds , - and_EbGb , and_EvGv , and_GbEb , and_GvEv , and_ALIb , and_eAX_Iv, PrefSEGES , daa_ , sub_EbGb , sub_EvGv , sub_GbEb , sub_GvEv , sub_ALIb , sub_eAX_Iv, PrefSEGCS , das_ , - xor_EbGb , xor_EvGv , xor_GbEb , xor_GvEv , xor_ALIb , xor_eAX_Iv, PrefSEGSS , aaa_ , cmp_EbGb , cmp_EvGv , cmp_GbEb , cmp_GvEv , cmp_ALIb , cmp_eAX_Iv, PrefSEGDS , aas_ , - inc_eax , inc_ecx , inc_edx , inc_ebx , inc_esp , inc_ebp , inc_esi , inc_edi , dec_eax , dec_ecx , dec_edx , dec_ebx , dec_esp , dec_ebp , dec_esi , dec_edi , - push_eax , push_ecx , push_edx , push_ebx , push_esp , push_ebp , push_esi , push_edi , pop_eax , pop_ecx , pop_edx , pop_ebx , pop_esp , pop_ebp , pop_esi , pop_edi , - pushad_ , popad_ , bound_ , arpl_ , PrefSEGFS , PrefSEGGS , PrefOpSize, PrefAdSize, push_Iv ,imul_GvEvIv, push_Ib ,imul_GvEvIb, insb_ , ins_ , outsb_ , outsw_ , - jo_ , jno_ , jc_ , jnc_ , je_ , jne_ , jbe_ , jnbe_ , js_ , jns_ , jp_ , jnp_ , jl_ , jnl_ , jle_ , jnle_ , - G1_EbIb , G1_EvIv , G1_EbIb2 , G1_EvIb , test_EbGb , test_EvGv , xchg_EbGb , xchg_EvGv , mov_EbGb , mov_EvGv , mov_GbEb , mov_GvEv , mov_EwSreg, lea_GvM , mov_SregEw, pop_Ev , - nop_ , xchg_ecx , xchg_edx , xchg_ebx , xchg_esp , xchg_ebp , xchg_esi , xchg_edi , cwde_ , cdq_ , callf_ , wait_ , pushfd_ , popfd_ , sahf_ , lahf_ , - mov_ALOb , mov_eAXOv , mov_ObAL , mov_OveAX , movs_ , movsw_ , cmpsb_ , cmps_ , test_ALIb ,test_eAX_Iv, stos_ , stosw_ , lodsb_ , lodsw_ , scasb_ , scas_ , - mov_ALIb , mov_CLIb , mov_DLIb , mov_BLIb , mov_AHIb , mov_CHIb , mov_DHIb , mov_BHIb , mov_EAX , mov_ECX , mov_EDX , mov_EBX , mov_ESP , mov_EBP , mov_ESI , mov_EDI , - G2_EbIb , G2_EvIb , retn_ , ret_ , les_GvM , lds_GvM , mov_EbIb , mov_EvIv , enter_ , leave_ , retf_Iw , retf_ , int3_ , int_ , into_ , iret_ , - G2_Eb1 , G2_Ev1 , G2_EbCL , G2_EvCL , aam_ , aad_ , salc_ , xlat_ , D8_ , D9_ , DA_ , DB_ , DC_ , DD_ , DE_ , DF_ , - loopne_ , loope_ , loop_ , jecxz_ , in_ALIb , in_eAX_Ib , out_IbAL , out_Ib_eAX, call_ , jmp_near , jmp_far , jmp_short , in_ALDX , in_eAX , out_DXAL , out_DXeAX , - PrefLock , int1_ , PrefREPNE , PrefREPE , hlt_ , cmc_ , G3_Eb , G3_Ev , clc_ , stc_ , cli_ , sti_ , cld_ , std_ , G4_Eb , G5_Ev , - }; - -/* =============================================================================== */ -/* */ -/* */ -/* 2 BYTE_OPCODE MAP --> 0F xx */ -/* */ -/* */ -/* =============================================================================== */ -void (__bea_callspec__ *opcode_map2[])(PDISASM) = { - G6_ , G7_ , lar_GvEw , lsl_GvEw , FailDecode, syscall_ , clts_ , sysret_ , invd_ , wbinvd_ , FailDecode, ud2_ , FailDecode, nop_Ev , femms_ , FailDecode, - movups_VW , movups_WV , movlps_VM , movlps_MV , unpcklps_ , unpckhps_ , movhps_VM , movhps_MV , G16_ , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , nop_Ev , - mov_RdCd , mov_RdDd , mov_CdRd , mov_DdRd , FailDecode, FailDecode, FailDecode, FailDecode, movaps_VW , movaps_WV , cvtpi2ps_ , movntps_ , cvttps2pi_, cvtps2pi_ , ucomiss_VW, comiss_VW , - wrmsr_ , rdtsc_ , rdmsr_ , rdpmc_ , sysenter_ , sysexit_ , FailDecode, FailDecode,Esc_tableA4, FailDecode,Esc_tableA5, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - cmovo_ , cmovno_ , cmovb_ , cmovnb_ , cmove_ , cmovne_ , cmovbe_ , cmovnbe_ , cmovs_ , cmovns_ , cmovp_ , cmovnp_ , cmovl_ , cmovnl_ , cmovle_ , cmovnle_ , - movmskps_ , sqrtps_VW , rsqrtps_ , rcpps_ , andps_VW , andnps_VW , orps_VW , xorps_VW , addps_VW , mulps_VW , cvtps2pd_ , cvtdq2ps_ , subps_VW , minps_VW , divps_VW , maxps_VW , - punpcklbw_, punpcklwd_, punpckldq_, packsswb_ , pcmpgtb_ , pcmpgtw_ , pcmpgtd_ , packuswb_ , punpckhbw_, punpckhwd_, punpckhdq_, packssdw_ ,punpcklqdq_,punpckhqdq_, movd_PE , movq_PQ , - pshufw_ , G12_ , G13_ , G14_ , pcmpeqb_ , pcmpeqw_ , pcmpeqd_ , emms_ , vmread_ , vmwrite_ , FailDecode, FailDecode, haddpd_VW , hsubpd_VW , movd_EP , movq_QP , - jo_near , jno_near , jc_near , jnc_near , je_near , jne_near , jbe_near , ja_near , js_near , jns_near , jp_near , jnp_near , jl_near , jnl_near , jle_near , jnle_near , - seto_ , setno_ , setb_ , setnb_ , sete_ , setne_ , setbe_ , setnbe_ , sets_ , setns_ , setp_ , setnp_ , setnge_ , setge_ , setle_ , setnle_ , - push_fs , pop_fs , cpuid_ , bt_EvGv ,shld_EvGvIb,shld_EvGvCL, FailDecode, FailDecode, push_gs , pop_gs , rsm_ , bts_EvGv ,shrd_EvGvIb,shrd_EvGvCL, G15_ , imul_GvEv , - cmpx_EbGb , cmpx_EvGv , lss_Mp , btr_EvGv , lfs_Mp , lgs_Mp , movzx_GvEb, movzx_GvEw, popcnt_ , ud2_ , G8_EvIb , btc_EvGv , bsf_GvEv , bsr_GvEv , movsx_GvEb, movsx_GvEw, - xadd_EbGb , xadd_EvGv , cmpps_VW , movnti_ , pinsrw_ , pextrw_ , shufps_ , G9_ , bswap_eax , bswap_ecx , bswap_edx , bswap_ebx , bswap_esp , bswap_ebp , bswap_esi , bswap_edi , - addsubpd_ , psrlw_ , psrld_ , psrlq_ , paddq_ , pmullw_ , movq_WV , pmovmskb_ , psubusb_ , psubusw_ , pminub_ , pand_ , paddusb_ , paddusw_ , pmaxub_ , pandn_ , - pavgb_ , psraw_ , psrad_ , pavgw_ , pmulhuw_ , pmulhw_ , cvtpd2dq_ , movntq_ , psubsb_ , psubsw_ , pminsw_ , por_ , paddsb_ , paddsw_ , pmaxsw_ , pxor_ , - lddqu_ , psllw_ , pslld_ , psllq_ , pmuludq_ , pmaddwd_ , psadbw_ , maskmovq_ , psubb_ , psubw_ , psubd_ , psubq_ , paddb_ , paddw_ , paddd_ , FailDecode, - }; - -/* =============================================================================== */ -/* */ -/* */ -/* 3 BYTE_OPCODE MAP --> 0F 38 xx */ -/* */ -/* */ -/* =============================================================================== */ - void (__bea_callspec__ *opcode_map3[])(PDISASM) = { - pshufb_ , phaddw_ , phaddd_ , phaddsw_ , pmaddubsw_, phsubw_ , phsubd_ , phsubsw_ , psignb_ , psignw_ , psignd_ , pmulhrsw_ , FailDecode, FailDecode, FailDecode, FailDecode, - pblendvb_ , FailDecode, FailDecode, FailDecode, blendvps_ , blendvpd_ , FailDecode, ptest_ , FailDecode, FailDecode, FailDecode, FailDecode, pabsb_ , pabsw_ , pabsd_ , FailDecode, - pmovsxbw_ , pmovsxbd_ , pmovsxbq_ , pmovsxwd_ , pmovsxwq_ , pmovsxdq_ , FailDecode, FailDecode, pmuldq_ , pcmpeqq_ , movntdqa_ , packusdw_ , FailDecode, FailDecode, FailDecode, FailDecode, - pmovzxbw_ , pmovzxbd_ , pmovzxbq_ , pmovzxwd_ , pmovzxwq_ , pmovzxdq_ , FailDecode, pcmpgtq_ , pminsb_ , pminsd_ , pminuw_ , pminud_ , pmaxsb_ , pmaxsd_ , pmaxuw_ , pmaxud_ , - pmulld_ ,phminposuw_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aesimc , aesenc , aesenclast, aesdec , aesdeclast, - FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - crc32_GvEb, crc32_GvEv, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - }; - -/* =============================================================================== */ -/* */ -/* */ -/* 3 UInt8_OPCODE MAP --> 0F 3A xx */ -/* */ -/* */ -/* =============================================================================== */ - void (__bea_callspec__ *opcode_map4[])(PDISASM) = { +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* =============================================================================== */ +/* */ +/* */ +/* 1 BYTE_OPCODE MAP */ +/* */ +/* */ +/* =============================================================================== */ + +void (__bea_callspec__ * opcode_map1[])(PDISASM) = { + add_EbGb , add_EvGv , add_GbEb , add_GvEv , add_ALIb , add_eAX_Iv, push_es , pop_es , or_EbGb , or_EvGv , or_GbEb , or_GvEv , or_ALIb , or_eAX_Iv , push_cs , Esc_2byte , + adc_EbGb , adc_EvGv , adc_GbEb , adc_GvEv , adc_ALIb , adc_eAX_Iv, push_ss , pop_ss , sbb_EbGb , sbb_EvGv , sbb_GbEb , sbb_GvEv , sbb_ALIb , sbb_eAX_Iv, push_ds , pop_ds , + and_EbGb , and_EvGv , and_GbEb , and_GvEv , and_ALIb , and_eAX_Iv, PrefSEGES , daa_ , sub_EbGb , sub_EvGv , sub_GbEb , sub_GvEv , sub_ALIb , sub_eAX_Iv, PrefSEGCS , das_ , + xor_EbGb , xor_EvGv , xor_GbEb , xor_GvEv , xor_ALIb , xor_eAX_Iv, PrefSEGSS , aaa_ , cmp_EbGb , cmp_EvGv , cmp_GbEb , cmp_GvEv , cmp_ALIb , cmp_eAX_Iv, PrefSEGDS , aas_ , + inc_eax , inc_ecx , inc_edx , inc_ebx , inc_esp , inc_ebp , inc_esi , inc_edi , dec_eax , dec_ecx , dec_edx , dec_ebx , dec_esp , dec_ebp , dec_esi , dec_edi , + push_eax , push_ecx , push_edx , push_ebx , push_esp , push_ebp , push_esi , push_edi , pop_eax , pop_ecx , pop_edx , pop_ebx , pop_esp , pop_ebp , pop_esi , pop_edi , + pushad_ , popad_ , bound_ , arpl_ , PrefSEGFS , PrefSEGGS , PrefOpSize, PrefAdSize, push_Iv ,imul_GvEvIv, push_Ib ,imul_GvEvIb, insb_ , ins_ , outsb_ , outsw_ , + jo_ , jno_ , jc_ , jnc_ , je_ , jne_ , jbe_ , jnbe_ , js_ , jns_ , jp_ , jnp_ , jl_ , jnl_ , jle_ , jnle_ , + G1_EbIb , G1_EvIv , G1_EbIb2 , G1_EvIb , test_EbGb , test_EvGv , xchg_EbGb , xchg_EvGv , mov_EbGb , mov_EvGv , mov_GbEb , mov_GvEv , mov_EwSreg, lea_GvM , mov_SregEw, pop_Ev , + nop_ , xchg_ecx , xchg_edx , xchg_ebx , xchg_esp , xchg_ebp , xchg_esi , xchg_edi , cwde_ , cdq_ , callf_ , wait_ , pushfd_ , popfd_ , sahf_ , lahf_ , + mov_ALOb , mov_eAXOv , mov_ObAL , mov_OveAX , movs_ , movsw_ , cmpsb_ , cmps_ , test_ALIb ,test_eAX_Iv, stos_ , stosw_ , lodsb_ , lodsw_ , scasb_ , scas_ , + mov_ALIb , mov_CLIb , mov_DLIb , mov_BLIb , mov_AHIb , mov_CHIb , mov_DHIb , mov_BHIb , mov_EAX , mov_ECX , mov_EDX , mov_EBX , mov_ESP , mov_EBP , mov_ESI , mov_EDI , + G2_EbIb , G2_EvIb , retn_ , ret_ , les_GvM , lds_GvM , mov_EbIb , mov_EvIv , enter_ , leave_ , retf_Iw , retf_ , int3_ , int_ , into_ , iret_ , + G2_Eb1 , G2_Ev1 , G2_EbCL , G2_EvCL , aam_ , aad_ , salc_ , xlat_ , D8_ , D9_ , DA_ , DB_ , DC_ , DD_ , DE_ , DF_ , + loopne_ , loope_ , loop_ , jecxz_ , in_ALIb , in_eAX_Ib , out_IbAL , out_Ib_eAX, call_ , jmp_near , jmp_far , jmp_short , in_ALDX , in_eAX , out_DXAL , out_DXeAX , + PrefLock , int1_ , PrefREPNE , PrefREPE , hlt_ , cmc_ , G3_Eb , G3_Ev , clc_ , stc_ , cli_ , sti_ , cld_ , std_ , G4_Eb , G5_Ev , + }; + +/* =============================================================================== */ +/* */ +/* */ +/* 2 BYTE_OPCODE MAP --> 0F xx */ +/* */ +/* */ +/* =============================================================================== */ +void (__bea_callspec__ *opcode_map2[])(PDISASM) = { +/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ +/*0*/G6_ , G7_ , lar_GvEw , lsl_GvEw , FailDecode, syscall_ , clts_ , sysret_ , invd_ , wbinvd_ , FailDecode, ud2_ , FailDecode, nop_Ev , femms_ , three_dnow_, +/*1*/movups_VW , movups_WV , movlps_VM , movlps_MV , unpcklps_ , unpckhps_ , movhps_VM , movhps_MV , G16_ , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , hint_nop , nop_Ev , +/*2*/mov_RdCd , mov_RdDd , mov_CdRd , mov_DdRd , FailDecode, FailDecode, FailDecode, FailDecode, movaps_VW , movaps_WV , cvtpi2ps_ , movntps_ , cvttps2pi_, cvtps2pi_ , ucomiss_VW, comiss_VW , +/*3*/wrmsr_ , rdtsc_ , rdmsr_ , rdpmc_ , sysenter_ , sysexit_ , FailDecode, FailDecode,Esc_tableA4, FailDecode,Esc_tableA5, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*4*/cmovo_ , cmovno_ , cmovb_ , cmovnb_ , cmove_ , cmovne_ , cmovbe_ , cmovnbe_ , cmovs_ , cmovns_ , cmovp_ , cmovnp_ , cmovl_ , cmovnl_ , cmovle_ , cmovnle_ , +/*5*/movmskps_ , sqrtps_VW , rsqrtps_ , rcpps_ , andps_VW , andnps_VW , orps_VW , xorps_VW , addps_VW , mulps_VW , cvtps2pd_ , cvtdq2ps_ , subps_VW , minps_VW , divps_VW , maxps_VW , +/*6*/punpcklbw_, punpcklwd_, punpckldq_, packsswb_ , pcmpgtb_ , pcmpgtw_ , pcmpgtd_ , packuswb_ , punpckhbw_, punpckhwd_, punpckhdq_, packssdw_ ,punpcklqdq_,punpckhqdq_, movd_PE , movq_PQ , +/*7*/pshufw_ , G12_ , G13_ , G14_ , pcmpeqb_ , pcmpeqw_ , pcmpeqd_ , emms_ , vmread_ , vmwrite_ , FailDecode, FailDecode, haddpd_VW , hsubpd_VW , movd_EP , movq_QP , +/*8*/jo_near , jno_near , jc_near , jnc_near , je_near , jne_near , jbe_near , ja_near , js_near , jns_near , jp_near , jnp_near , jl_near , jnl_near , jle_near , jnle_near , +/*9*/seto_ , setno_ , setb_ , setnb_ , sete_ , setne_ , setbe_ , setnbe_ , sets_ , setns_ , setp_ , setnp_ , setnge_ , setge_ , setle_ , setnle_ , +/*a*/push_fs , pop_fs , cpuid_ , bt_EvGv ,shld_EvGvIb,shld_EvGvCL, FailDecode, FailDecode, push_gs , pop_gs , rsm_ , bts_EvGv ,shrd_EvGvIb,shrd_EvGvCL, G15_ , imul_GvEv , +/*b*/cmpx_EbGb , cmpx_EvGv , lss_Mp , btr_EvGv , lfs_Mp , lgs_Mp , movzx_GvEb, movzx_GvEw, popcnt_ , ud2_ , G8_EvIb , btc_EvGv , bsf_GvEv , bsr_GvEv , movsx_GvEb, movsx_GvEw, +/*c*/xadd_EbGb , xadd_EvGv , cmpps_VW , movnti_ , pinsrw_ , pextrw_ , shufps_ , G9_ , bswap_eax , bswap_ecx , bswap_edx , bswap_ebx , bswap_esp , bswap_ebp , bswap_esi , bswap_edi , +/*d*/addsubpd_ , psrlw_ , psrld_ , psrlq_ , paddq_ , pmullw_ , movq_WV , pmovmskb_ , psubusb_ , psubusw_ , pminub_ , pand_ , paddusb_ , paddusw_ , pmaxub_ , pandn_ , +/*e*/pavgb_ , psraw_ , psrad_ , pavgw_ , pmulhuw_ , pmulhw_ , cvtpd2dq_ , movntq_ , psubsb_ , psubsw_ , pminsw_ , por_ , paddsb_ , paddsw_ , pmaxsw_ , pxor_ , +/*f*/lddqu_ , psllw_ , pslld_ , psllq_ , pmuludq_ , pmaddwd_ , psadbw_ , maskmovq_ , psubb_ , psubw_ , psubd_ , psubq_ , paddb_ , paddw_ , paddd_ , FailDecode, + }; + +/* =============================================================================== */ +/* */ +/* */ +/* 3 BYTE_OPCODE MAP --> 0F 38 xx */ +/* */ +/* */ +/* =============================================================================== */ + void (__bea_callspec__ *opcode_map3[])(PDISASM) = { +/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ +/*0*/pshufb_ , phaddw_ , phaddd_ , phaddsw_ , pmaddubsw_, phsubw_ , phsubd_ , phsubsw_ , psignb_ , psignw_ , psignd_ , pmulhrsw_ , vpermilps1, FailDecode, FailDecode, FailDecode, +/*1*/pblendvb_ , FailDecode, FailDecode, FailDecode, blendvps_ , blendvpd_ , FailDecode, ptest_ , vbrdcstss , vbrdcstsd , FailDecode, FailDecode, pabsb_ , pabsw_ , pabsd_ , FailDecode, +/*2*/pmovsxbw_ , pmovsxbd_ , pmovsxbq_ , pmovsxwd_ , pmovsxwq_ , pmovsxdq_ , FailDecode, FailDecode, pmuldq_ , pcmpeqq_ , movntdqa_ , packusdw_ , FailDecode, FailDecode, FailDecode, FailDecode, +/*3*/pmovzxbw_ , pmovzxbd_ , pmovzxbq_ , pmovzxwd_ , pmovzxwq_ , pmovzxdq_ , FailDecode, pcmpgtq_ , pminsb_ , pminsd_ , pminuw_ , pminud_ , pmaxsb_ , pmaxsd_ , pmaxuw_ , pmaxud_ , +/*4*/pmulld_ ,phminposuw_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*5*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*6*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*7*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*8*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*9*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*a*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*b*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*c*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*d*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aesimc , aesenc , aesenclast, aesdec , aesdeclast, +/*e*/FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*e*/crc32_GvEb, crc32_GvEv, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, + }; + +/* =============================================================================== */ +/* */ +/* */ +/* 3 UInt8_OPCODE MAP --> 0F 3A xx */ +/* */ +/* */ +/* =============================================================================== */ + void (__bea_callspec__ *opcode_map4[])(PDISASM) = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ -/*0*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, roundps_ , roundpd_ , roundss_ , roundsd_ , blendps_ , blendpd_ , pblendw_ , palignr_ , -/*1*/ FailDecode, FailDecode, FailDecode, FailDecode, pextrb_ , pextrw2_ , pextrd_ , extractps_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*2*/ pinsrb_ , insertps_ , pinsrd_ , FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*3*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*4*/ dpps_ , dppd_ , mpsadbw_ , FailDecode, pclmulqdq_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, vblendvpd, FailDecode, FailDecode, FailDecode, FailDecode, -/*5*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*6*/ pcmpestrm_, pcmpestri_, pcmpistrm_, pcmpistri_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*7*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*8*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*9*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*a*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*b*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*c*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*d*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aeskeygen , -/*e*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, -/*f*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, - }; - - -void (__bea_callspec__ *ModRM_0[])(ARGTYPE*, PDISASM) = { - Addr_EAX, - Addr_ECX, - Addr_EDX, - Addr_EBX, - Addr_SIB, - Addr_disp32, - Addr_ESI, - Addr_EDI, - }; - - void (__bea_callspec__ *ModRM_1[])(ARGTYPE*, PDISASM) = { - Addr_EAX_disp8, - Addr_ECX_disp8, - Addr_EDX_disp8, - Addr_EBX_disp8, - Addr_SIB_disp8, - Addr_EBP_disp8, - Addr_ESI_disp8, - Addr_EDI_disp8, - }; - - void (__bea_callspec__ *ModRM_2[])(ARGTYPE*, PDISASM) = { - Addr_EAX_disp32, - Addr_ECX_disp32, - Addr_EDX_disp32, - Addr_EBX_disp32, - Addr_SIB_disp32, - Addr_EBP_disp32, - Addr_ESI_disp32, - Addr_EDI_disp32, - }; - - void (__bea_callspec__ *ModRM_3[])(ARGTYPE*, PDISASM) = { - _rEAX, - _rECX, - _rEDX, - _rEBX, - _rESP, - _rEBP, - _rESI, - _rEDI, - }; - -size_t (__bea_callspec__ *SIB[])(ARGTYPE*, size_t, PDISASM) = { - SIB_0, - SIB_1, - SIB_2, - SIB_3, - }; +/*0*/ FailDecode, FailDecode, FailDecode, FailDecode, vpermilps2, FailDecode, vperm2f128, FailDecode, roundps_ , roundpd_ , roundss_ , roundsd_ , blendps_ , blendpd_ , pblendw_ , palignr_ , +/*1*/ FailDecode, FailDecode, FailDecode, FailDecode, pextrb_ , pextrw2_ , pextrd_ , extractps_, vinsrtf128, vextraf128, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*2*/ pinsrb_ , insertps_ , pinsrd_ , FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*3*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*4*/ dpps_ , dppd_ , mpsadbw_ , FailDecode, pclmulqdq_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, vblendvpd, FailDecode, FailDecode, FailDecode, FailDecode, +/*5*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*6*/ pcmpestrm_, pcmpestri_, pcmpistrm_, pcmpistri_, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*7*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*8*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*9*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*a*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*b*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*c*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*d*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, aeskeygen , +/*e*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, +/*f*/ FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, FailDecode, + }; + + +void (__bea_callspec__ *ModRM_0[])(ARGTYPE*, PDISASM) = { + Addr_EAX, + Addr_ECX, + Addr_EDX, + Addr_EBX, + Addr_SIB, + Addr_disp32, + Addr_ESI, + Addr_EDI, + }; + + void (__bea_callspec__ *ModRM_1[])(ARGTYPE*, PDISASM) = { + Addr_EAX_disp8, + Addr_ECX_disp8, + Addr_EDX_disp8, + Addr_EBX_disp8, + Addr_SIB_disp8, + Addr_EBP_disp8, + Addr_ESI_disp8, + Addr_EDI_disp8, + }; + + void (__bea_callspec__ *ModRM_2[])(ARGTYPE*, PDISASM) = { + Addr_EAX_disp32, + Addr_ECX_disp32, + Addr_EDX_disp32, + Addr_EBX_disp32, + Addr_SIB_disp32, + Addr_EBP_disp32, + Addr_ESI_disp32, + Addr_EDI_disp32, + }; + + void (__bea_callspec__ *ModRM_3[])(ARGTYPE*, PDISASM) = { + _rEAX, + _rECX, + _rEDX, + _rEBX, + _rESP, + _rEBP, + _rESI, + _rEDI, + }; + +size_t (__bea_callspec__ *SIB[])(ARGTYPE*, size_t, PDISASM) = { + SIB_0, + SIB_1, + SIB_2, + SIB_3, + }; diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_AES.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_AES.c index 94a98389a46d30bb3373e5c7929357ad0b2d3db9..e47418410efd5a09af18a4f5709fcf42e3abf4db 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_AES.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_AES.c @@ -1,168 +1,168 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0x 0f 38 db - * ==================================================================== */ -void __bea_callspec__ aesimc(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesimc "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ==================================================================== - * 0x 0f 38 dc - * ==================================================================== */ -void __bea_callspec__ aesenc(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenc "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ==================================================================== - * 0x 0f 38 dd - * ==================================================================== */ -void __bea_callspec__ aesenclast(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenclast "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ==================================================================== - * 0x 0f 38 de - * ==================================================================== */ -void __bea_callspec__ aesdec(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdec "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ==================================================================== - * 0x 0f 38 df - * ==================================================================== */ -void __bea_callspec__ aesdeclast(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdeclast "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ==================================================================== - * 0x 0f 3a df - * ==================================================================== */ -void __bea_callspec__ aeskeygen(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aeskeygenassist "); - #endif - GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; - - - } - else { - FailDecode(pMyDisasm); - } - -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0x 0f 38 db + * ==================================================================== */ +void __bea_callspec__ aesimc(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesimc "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ==================================================================== + * 0x 0f 38 dc + * ==================================================================== */ +void __bea_callspec__ aesenc(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenc "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ==================================================================== + * 0x 0f 38 dd + * ==================================================================== */ +void __bea_callspec__ aesenclast(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenclast "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ==================================================================== + * 0x 0f 38 de + * ==================================================================== */ +void __bea_callspec__ aesdec(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdec "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ==================================================================== + * 0x 0f 38 df + * ==================================================================== */ +void __bea_callspec__ aesdeclast(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdeclast "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ==================================================================== + * 0x 0f 3a df + * ==================================================================== */ +void __bea_callspec__ aeskeygen(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = AES_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aeskeygenassist "); + #endif + GV.ImmediatSize = 8; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.EIP_++; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument3.ArgSize = 8; + + + } + else { + FailDecode(pMyDisasm); + } + +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_CLMUL.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_CLMUL.c index 65f565ae11feb105ea71dbfdcc7bfa32ad6caa8e..22960ee63ca7af11272a88315e11b959db1c08eb 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_CLMUL.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_CLMUL.c @@ -1,74 +1,74 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0x 0f 3a 44 - * ==================================================================== */ -void __bea_callspec__ pclmulqdq_(PDISASM pMyDisasm) -{ - /* ========== 0x66 */ - if (GV.OperandSize == 16) { - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = CLMUL_INSTRUCTION; - - GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - - if ((*pMyDisasm).Instruction.Immediat == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqlqdq "); - #endif - } - else if ((*pMyDisasm).Instruction.Immediat == 0x01 ) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqlqdq "); - #endif - } - else if ((*pMyDisasm).Instruction.Immediat == 0x10 ) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqhqdq "); - #endif - } - else if ((*pMyDisasm).Instruction.Immediat == 0x011 ) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqhqdq "); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulqdq "); - #endif - GV.third_arg = 1; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; - } - } - else { - FailDecode(pMyDisasm); - } -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0x 0f 3a 44 + * ==================================================================== */ +void __bea_callspec__ pclmulqdq_(PDISASM pMyDisasm) +{ + /* ========== 0x66 */ + if (GV.OperandSize == 16) { + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = CLMUL_INSTRUCTION; + + GV.ImmediatSize = 8; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.EIP_++; + if (!Security(0, pMyDisasm)) return; + + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + + if ((*pMyDisasm).Instruction.Immediat == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqlqdq "); + #endif + } + else if ((*pMyDisasm).Instruction.Immediat == 0x01 ) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqlqdq "); + #endif + } + else if ((*pMyDisasm).Instruction.Immediat == 0x10 ) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmullqhqdq "); + #endif + } + else if ((*pMyDisasm).Instruction.Immediat == 0x011 ) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulhqhqdq "); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pclmulqdq "); + #endif + GV.third_arg = 1; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument3.ArgSize = 8; + } + } + else { + FailDecode(pMyDisasm); + } +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_FPU.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_FPU.c index 50fe7f6178688598597e4e8ac207672a18fd2317..bf258c8b6eabc237c9ff926bb7e801e7a44faf6b 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_FPU.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_FPU.c @@ -1,1801 +1,1801 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ D8_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - GV.MemDecoration = Arg2dword; - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 3) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 4) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xf0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ D9_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2multibytes; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldenv "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldcw "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg1multibytes; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstenv "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstcw "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - if (GV.SYNTAX_ != NasmSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ D8_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + GV.MemDecoration = Arg2dword; + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 3) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 4) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xf0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ D9_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2multibytes; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldenv "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldcw "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg1multibytes; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstenv "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstcw "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + if (GV.SYNTAX_ != NasmSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif } - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if ((MyMODRM & 0xf) ==0) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnop "); - #endif - } + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if ((MyMODRM & 0xf) ==0) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnop "); + #endif + } #if 0 /* cannot find these insns */ - else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp1 "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } + else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp1 "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } #endif - else { - FailDecode(pMyDisasm); - } - - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if ((MyMODRM & 0xf) ==0) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fchs "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==1) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fabs "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==4) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ftst "); - #endif - } - else if ((MyMODRM & 0xf) ==5) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxam "); - #endif - } - else if ((MyMODRM & 0xf) ==8) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld1 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - - } - else if ((MyMODRM & 0xf) ==9) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2t "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xa) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2e "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xb) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldpi "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xc) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldlg2 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - - else if ((MyMODRM & 0xf) ==0xd) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldln2 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xe) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldz "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 80; - } - - else { - FailDecode(pMyDisasm); - } - } - else if ((MyMODRM & 0xf0) == 0xf0) { - if ((MyMODRM & 0xf) ==0) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "f2xm1 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==1) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2x "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==2) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fptan "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==3) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fpatan "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==4) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxtract "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==5) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem1 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==6) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdecstp "); - #endif - } - else if ((MyMODRM & 0xf) ==7) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fincstp "); - #endif - } - else if ((MyMODRM & 0xf) ==8) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==9) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2xp1 "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xa) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsqrt "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xb) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsincos "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xc) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frndint "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xd) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fscale "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xe) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsin "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf) ==0xf) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcos "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DA_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovb "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmove "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovbe "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovu "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - - } - else if (MyMODRM == 0xe9) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucompp "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DB_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2dword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2tbyte; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg1tbyte; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnb "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovne "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnbe "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnu "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xe0) { - - if ((MyMODRM & 0xf) ==0) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fneni "); - #endif - } - else if ((MyMODRM & 0xf) ==1) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fndisi "); - #endif - } - else if ((MyMODRM & 0xf) ==2) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnclex "); - #endif - } - else if ((MyMODRM & 0xf) ==3) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fninit "); - #endif - } - else if ((MyMODRM & 0xf) ==4) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnsetpm "); - #endif - } - else if ((MyMODRM & 0xf) ==5) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstpm "); - #endif - } - else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomi "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else if ((MyMODRM & 0xf0) == 0xf0) { - if (((MyMODRM & 0xf) >=0x0) && ((MyMODRM & 0xf) <=0x7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomi "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DC_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - (*pMyDisasm).Argument1.AccessMode = READ; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); - #endif - (*pMyDisasm).Argument1.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - FailDecode(pMyDisasm); + else { + FailDecode(pMyDisasm); + } + + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if ((MyMODRM & 0xf) ==0) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fchs "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==1) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fabs "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==4) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ftst "); + #endif + } + else if ((MyMODRM & 0xf) ==5) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxam "); + #endif + } + else if ((MyMODRM & 0xf) ==8) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld1 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + + } + else if ((MyMODRM & 0xf) ==9) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2t "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xa) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldl2e "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xb) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldpi "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xc) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldlg2 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + + else if ((MyMODRM & 0xf) ==0xd) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldln2 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xe) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOAD_CONSTANTS; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fldz "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 80; + } + + else { + FailDecode(pMyDisasm); + } + } + else if ((MyMODRM & 0xf0) == 0xf0) { + if ((MyMODRM & 0xf) ==0) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "f2xm1 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==1) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2x "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==2) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fptan "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==3) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fpatan "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==4) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxtract "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==5) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem1 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==6) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdecstp "); + #endif + } + else if ((MyMODRM & 0xf) ==7) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fincstp "); + #endif + } + else if ((MyMODRM & 0xf) ==8) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fprem "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==9) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fyl2xp1 "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xa) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsqrt "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xb) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsincos "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xc) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frndint "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xd) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+LOGARITHMIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fscale "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xe) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsin "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf) ==0xf) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+TRIGONOMETRIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcos "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DA_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovb "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmove "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovbe "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovu "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + + } + else if (MyMODRM == 0xe9) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucompp "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DB_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2tbyte; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg1tbyte; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnb "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovne "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnbe "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcmovnu "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xe0) { + + if ((MyMODRM & 0xf) ==0) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fneni "); + #endif + } + else if ((MyMODRM & 0xf) ==1) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fndisi "); + #endif + } + else if ((MyMODRM & 0xf) ==2) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnclex "); + #endif + } + else if ((MyMODRM & 0xf) ==3) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fninit "); + #endif + } + else if ((MyMODRM & 0xf) ==4) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+UNSUPPORTED_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnsetpm "); + #endif + } + else if ((MyMODRM & 0xf) ==5) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstpm "); + #endif + } + else if (((MyMODRM & 0xf) >=0x8) && ((MyMODRM & 0xf) <=0xf)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomi "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else if ((MyMODRM & 0xf0) == 0xf0) { + if (((MyMODRM & 0xf) >=0x0) && ((MyMODRM & 0xf) <=0x7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomi "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DC_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + (*pMyDisasm).Argument1.AccessMode = READ; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fadd "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmul "); + #endif + (*pMyDisasm).Argument1.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + FailDecode(pMyDisasm); #if 0 /* cannot find in manual */ - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom2 "); - #endif - - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp3 "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcom2 "); + #endif + + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp3 "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + #endif - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xf0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - - } - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DD_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg1qword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg1qword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg1qword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2multibytes; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstor "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 108*8; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg1multibytes; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnsave "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 108*8; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstsw "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG; - (*pMyDisasm).Argument2.ArgSize = 16; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffree "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch4 "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucom "); - #endif - if (GV.SYNTAX_ != NasmSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubr "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsub "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xf0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivr "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdiv "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + + } + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DD_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fld "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg1qword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg1qword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg1qword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2multibytes; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "frstor "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 108*8; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg1multibytes; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnsave "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 108*8; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstsw "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG; + (*pMyDisasm).Argument2.ArgSize = 16; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffree "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch4 "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fst "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucom "); + #endif + if (GV.SYNTAX_ != NasmSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif } - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomp "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - - } - - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DE_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "faddp "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmulp "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp5 "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (MyMODRM == 0xd9){ - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcompp "); - #endif - } - else { - FailDecode(pMyDisasm); - } - - - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubrp "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubp "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xf0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivrp "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivp "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - - } - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ DF_(PDISASM pMyDisasm) -{ - long MyMODRM; - char (*pRegistersFPU)[8][8] ; - - GV.DECALAGE_EIP = 0; - if (!Security(1, pMyDisasm)) {return;} - MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - pRegistersFPU = &RegistersFPU_Masm; - if (GV.SYNTAX_ == NasmSyntax) { - pRegistersFPU = &RegistersFPU_Nasm; - } - if (MyMODRM <= 0xbf) { - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 1) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2multibytes; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbld "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg1multibytes; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbstp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else if (GV.REGOPCODE == 7) { - GV.MemDecoration = Arg1qword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if ((MyMODRM & 0xf0) == 0xc0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffreep "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch7 "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - } - else if ((MyMODRM & 0xf0) == 0xd0) { - FailDecode(pMyDisasm); + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomp "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + + } + + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DE_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fiadd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fimul "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficom "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ficomp "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisub "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisubr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidiv "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fidivr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "faddp "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fmulp "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomp5 "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (MyMODRM == 0xd9){ + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcompp "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubrp "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fsubp "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xf0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivrp "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fdivp "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + + } + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ DF_(PDISASM pMyDisasm) +{ + long MyMODRM; + char (*pRegistersFPU)[8][8] ; + + GV.DECALAGE_EIP = 0; + if (!Security(1, pMyDisasm)) {return;} + MyMODRM = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + pRegistersFPU = &RegistersFPU_Masm; + if (GV.SYNTAX_ == NasmSyntax) { + pRegistersFPU = &RegistersFPU_Nasm; + } + if (MyMODRM <= 0xbf) { + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 1) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fisttp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fist "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2multibytes; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbld "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fild "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg1multibytes; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fbstp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else if (GV.REGOPCODE == 7) { + GV.MemDecoration = Arg1qword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fistp "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if ((MyMODRM & 0xf0) == 0xc0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ffreep "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxch7 "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + } + else if ((MyMODRM & 0xf0) == 0xd0) { + FailDecode(pMyDisasm); #if 0 /* i can't find this instructino in any official manual. maybe existed on pentium II's? */ - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp8 "); - #endif - } - else { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp9 "); - #endif - (*pMyDisasm).Argument2.AccessMode = WRITE; - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument1.ArgSize = 80; - + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp8 "); + #endif + } + else { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fstp9 "); + #endif + (*pMyDisasm).Argument2.AccessMode = WRITE; + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument1.ArgSize = 80; + #endif - } - else if ((MyMODRM & 0xf0) == 0xe0) { - if (MyMODRM == 0xe0) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstsw ax "); - #endif - } - else if ((MyMODRM & 0xf) >=8) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomip "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - - - else { - FailDecode(pMyDisasm); - } - } - - else if ((MyMODRM & 0xf0) == 0xf0) { - if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomip "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 80; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; - (*pMyDisasm).Argument2.ArgSize = 80; - } - else { - FailDecode(pMyDisasm); - } - - } - else { - FailDecode(pMyDisasm); - } - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} + } + else if ((MyMODRM & 0xf0) == 0xe0) { + if (MyMODRM == 0xe0) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fnstsw ax "); + #endif + } + else if ((MyMODRM & 0xf) >=8) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fucomip "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + + + else { + FailDecode(pMyDisasm); + } + } + + else if ((MyMODRM & 0xf0) == 0xf0) { + if (((MyMODRM & 0xf) >=0) && ((MyMODRM & 0xf) <=7)) { + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+COMPARISON_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fcomip "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, (*pRegistersFPU)[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 80; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, (*pRegistersFPU)[(MyMODRM & 0xf)%8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+REGS[(MyMODRM & 0xf)%8]; + (*pMyDisasm).Argument2.ArgSize = 80; + } + else { + FailDecode(pMyDisasm); + } + + } + else { + FailDecode(pMyDisasm); + } + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp1.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp1.c index 3a5b898ad0388029de488737e645ae3ac71f6f40..a714f15014a6a47ef7537d0c0c3a55e8415d6eb7 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp1.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp1.c @@ -1,297 +1,297 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 80h - * ==================================================================== */ -void __bea_callspec__ G1_EbIb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EbIb(pMyDisasm); - if (GV.REGOPCODE == 0) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); - #endif - FillFlags(pMyDisasm, 5); - } - else if (GV.REGOPCODE == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - FillFlags(pMyDisasm, 74); - } - else if (GV.REGOPCODE == 2) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); - #endif - FillFlags(pMyDisasm, 4); - } - else if (GV.REGOPCODE == 3) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - FillFlags(pMyDisasm, 93); - } - else if (GV.REGOPCODE == 4) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); - #endif - FillFlags(pMyDisasm, 6); - } - else if (GV.REGOPCODE == 5) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - FillFlags(pMyDisasm, 103); - } - - else if (GV.REGOPCODE == 6) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - FillFlags(pMyDisasm, 113); - } - - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); - #endif - FillFlags(pMyDisasm, 20); - (*pMyDisasm).Argument1.AccessMode = READ; - } -} - -/* ==================================================================== - * 82h - * ==================================================================== */ -void __bea_callspec__ G1_EbIb2(PDISASM pMyDisasm) -{ - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - G1_EbIb(pMyDisasm); - } -} - -/* ==================================================================== - * 81h - * ==================================================================== */ -void __bea_callspec__ G1_EvIv(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EvIv(pMyDisasm); - if (GV.REGOPCODE == 0) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); - #endif - FillFlags(pMyDisasm, 5); - } - else if (GV.REGOPCODE == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - FillFlags(pMyDisasm, 74); - } - else if (GV.REGOPCODE == 2) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); - #endif - FillFlags(pMyDisasm, 4); - } - else if (GV.REGOPCODE == 3) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - FillFlags(pMyDisasm, 93); - } - else if (GV.REGOPCODE == 4) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); - #endif - FillFlags(pMyDisasm, 6); - } - else if (GV.REGOPCODE == 5) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - FillFlags(pMyDisasm, 103); - } - - else if (GV.REGOPCODE == 6) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - FillFlags(pMyDisasm, 113); - } - - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); - #endif - FillFlags(pMyDisasm, 20); - (*pMyDisasm).Argument1.AccessMode = READ; - } -} - -/* ==================================================================== - * 83h - * ==================================================================== */ -void __bea_callspec__ G1_EvIb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EvIb(pMyDisasm, 1); - if (GV.REGOPCODE == 0) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); - #endif - FillFlags(pMyDisasm, 5); - } - else if (GV.REGOPCODE == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - FillFlags(pMyDisasm, 74); - } - else if (GV.REGOPCODE == 2) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); - #endif - FillFlags(pMyDisasm, 4); - } - else if (GV.REGOPCODE == 3) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - FillFlags(pMyDisasm, 93); - } - else if (GV.REGOPCODE == 4) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); - #endif - FillFlags(pMyDisasm, 6); - } - else if (GV.REGOPCODE == 5) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - FillFlags(pMyDisasm, 103); - } - - else if (GV.REGOPCODE == 6) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - FillFlags(pMyDisasm, 113); - } - - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); - #endif - FillFlags(pMyDisasm, 20); - (*pMyDisasm).Argument1.AccessMode = READ; - } -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 80h + * ==================================================================== */ +void __bea_callspec__ G1_EbIb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EbIb(pMyDisasm); + if (GV.REGOPCODE == 0) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); + #endif + FillFlags(pMyDisasm, 5); + } + else if (GV.REGOPCODE == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + FillFlags(pMyDisasm, 74); + } + else if (GV.REGOPCODE == 2) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); + #endif + FillFlags(pMyDisasm, 4); + } + else if (GV.REGOPCODE == 3) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + FillFlags(pMyDisasm, 93); + } + else if (GV.REGOPCODE == 4) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); + #endif + FillFlags(pMyDisasm, 6); + } + else if (GV.REGOPCODE == 5) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + FillFlags(pMyDisasm, 103); + } + + else if (GV.REGOPCODE == 6) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + FillFlags(pMyDisasm, 113); + } + + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); + #endif + FillFlags(pMyDisasm, 20); + (*pMyDisasm).Argument1.AccessMode = READ; + } +} + +/* ==================================================================== + * 82h + * ==================================================================== */ +void __bea_callspec__ G1_EbIb2(PDISASM pMyDisasm) +{ + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + G1_EbIb(pMyDisasm); + } +} + +/* ==================================================================== + * 81h + * ==================================================================== */ +void __bea_callspec__ G1_EvIv(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EvIv(pMyDisasm); + if (GV.REGOPCODE == 0) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); + #endif + FillFlags(pMyDisasm, 5); + } + else if (GV.REGOPCODE == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + FillFlags(pMyDisasm, 74); + } + else if (GV.REGOPCODE == 2) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); + #endif + FillFlags(pMyDisasm, 4); + } + else if (GV.REGOPCODE == 3) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + FillFlags(pMyDisasm, 93); + } + else if (GV.REGOPCODE == 4) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); + #endif + FillFlags(pMyDisasm, 6); + } + else if (GV.REGOPCODE == 5) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + FillFlags(pMyDisasm, 103); + } + + else if (GV.REGOPCODE == 6) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + FillFlags(pMyDisasm, 113); + } + + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); + #endif + FillFlags(pMyDisasm, 20); + (*pMyDisasm).Argument1.AccessMode = READ; + } +} + +/* ==================================================================== + * 83h + * ==================================================================== */ +void __bea_callspec__ G1_EvIb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EvIb(pMyDisasm, 1); + if (GV.REGOPCODE == 0) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "add "); + #endif + FillFlags(pMyDisasm, 5); + } + else if (GV.REGOPCODE == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + FillFlags(pMyDisasm, 74); + } + else if (GV.REGOPCODE == 2) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "adc "); + #endif + FillFlags(pMyDisasm, 4); + } + else if (GV.REGOPCODE == 3) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + FillFlags(pMyDisasm, 93); + } + else if (GV.REGOPCODE == 4) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "and "); + #endif + FillFlags(pMyDisasm, 6); + } + else if (GV.REGOPCODE == 5) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + FillFlags(pMyDisasm, 103); + } + + else if (GV.REGOPCODE == 6) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + FillFlags(pMyDisasm, 113); + } + + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmp "); + #endif + FillFlags(pMyDisasm, 20); + (*pMyDisasm).Argument1.AccessMode = READ; + } +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c index 90c1f79d5357b65394dc8cc1f5daecbd062692a2..d762c3dcba3ef7d9dff71a39b743e66e5469afeb 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c @@ -1,195 +1,194 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ G12_(PDISASM pMyDisasm) -{ - long MyNumber; - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 2) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - else if (GV.REGOPCODE == 4) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - - } - else if (GV.REGOPCODE == 6) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - - else { - FailDecode(pMyDisasm); - } - -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ G12_(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 2) { + if (GV.OperandSize == 16 || pMyDisasm->Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + + if(GV.VEX.has_vex) + { + V_reg(&(*pMyDisasm).Argument1, pMyDisasm); + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + } + else + { + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + GV.SSE_ = 0; + GV.AVX_ = 0; + + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + + } + } + else if (GV.REGOPCODE == 4) { + if (GV.OperandSize == 16 || pMyDisasm->Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&pMyDisasm->Argument2,pMyDisasm); + + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&pMyDisasm->Argument2,pMyDisasm); + + } + + } + else if (GV.REGOPCODE == 6) { + if (GV.OperandSize == 16|| (*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + if(GV.VEX.has_vex) + { + GV.MemDecoration = Arg2dqword; + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + V_reg(&(*pMyDisasm).Argument1, pMyDisasm); + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.AVX_ = 0; + GV.SSE_ = 0; + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + } + else + { + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psllw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + } + + else { + FailDecode(pMyDisasm); + } + +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp13.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp13.c index dba7ed30b2846afb51066428195564fc5a2f13a7..f444e4a92724da6ffccba559c62fcb14f62b644f 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp13.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp13.c @@ -1,194 +1,178 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ G13_(PDISASM pMyDisasm) -{ - long MyNumber; - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 2) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - else if (GV.REGOPCODE == 4) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - - } - else if (GV.REGOPCODE == 6) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - - else { - FailDecode(pMyDisasm); - } - -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ G13_(PDISASM pMyDisasm) +{ + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 2) { + if (GV.OperandSize == 16) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + + L_imm(&(*pMyDisasm).Argument2,pMyDisasm); + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2,pMyDisasm); + } + } + else if (GV.REGOPCODE == 4) { + if (GV.OperandSize == 16 || (*pMyDisasm).Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + + if(GV.VEX.has_vex) + { + V_reg(&(*pMyDisasm).Argument1, pMyDisasm); + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + } + else + { + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrad "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + + } + else if (GV.REGOPCODE == 6) { + if (GV.OperandSize == 16) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + } + + else { + FailDecode(pMyDisasm); + } + +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp14.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp14.c index 939ca9c18810c881d91ec03b5f926d922f48e25e..705c0308fd05e464649a8e7e104206477f7a19d8 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp14.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp14.c @@ -1,203 +1,200 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ G14_(PDISASM pMyDisasm) -{ - long MyNumber; - - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 2) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - else if (GV.REGOPCODE == 3) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrldq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - FailDecode(pMyDisasm); - } - - } - else if (GV.REGOPCODE == 6) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1qword; - GV.ImmediatSize = 8; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - } - else if (GV.REGOPCODE == 7) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; - GV.MemDecoration = Arg1dqword; - GV.ImmediatSize = 8; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - if (GV.MOD_== 0x3) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslldq "); - #endif - } - else { - FailDecode(pMyDisasm); - } - GV.EIP_ += GV.DECALAGE_EIP+3; - if (!Security(0, pMyDisasm)) return; - - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_-1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Instruction.Immediat = MyNumber; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - } - else { - FailDecode(pMyDisasm); - } - - } - else { - FailDecode(pMyDisasm); - } - -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0f 73 /<const> + * ==================================================================== */ +void __bea_callspec__ G14_(PDISASM pMyDisasm) +{ + + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 2) { + if (GV.OperandSize == 16 || pMyDisasm->Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + + } + } + else if (GV.REGOPCODE == 3) { + if (GV.OperandSize == 16 || pMyDisasm->Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + { + V_reg(&(*pMyDisasm).Argument1, pMyDisasm); + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + } + else + { + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + GV.SSE_ = 0; + GV.AVX_ = 0; + + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrldq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + + } + else { + FailDecode(pMyDisasm); + } + + } + else if (GV.REGOPCODE == 6) { + if (GV.OperandSize == 16 || pMyDisasm->Prefix.OperandSize==InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1dqword; + GV.ImmediatSize = 8; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&pMyDisasm->Argument2,pMyDisasm); + } + else { + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + GV.MemDecoration = Arg1qword; + GV.ImmediatSize = 8; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&pMyDisasm->Argument2,pMyDisasm); + } + } + else if (GV.REGOPCODE == 7) { + if (GV.OperandSize == 16 || (*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHIFT_ROTATE; + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + + + if(GV.VEX.has_vex) + { + GV.MemDecoration = Arg2dqword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + V_reg(&(*pMyDisasm).Argument1, pMyDisasm); + GV.third_arg=1; + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); + } + else + { + GV.MemDecoration = Arg1dqword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + if (!Security(0, pMyDisasm)) return; + L_imm(&(*pMyDisasm).Argument2, pMyDisasm); + } + if (GV.MOD_== 0x3) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pslldq "); + #endif + } + else { + FailDecode(pMyDisasm); + } + GV.AVX_ = 0; + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } + + } + else { + FailDecode(pMyDisasm); + } + +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp15.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp15.c index 9a57b4d8fca09bb5ae4da3c26e346f944ea14f0a..1489d0abbfa624244627c8f6e4c3bdd4c89f897a 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp15.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp15.c @@ -1,166 +1,166 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ G15_(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg1multibytes; - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxsave "); - #endif - (*pMyDisasm).Argument1.ArgSize = 512; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; - (*pMyDisasm).Argument2.ArgSize = 512; - } - else { - FailDecode(pMyDisasm); - } - } - else if (GV.REGOPCODE == 1) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2multibytes; - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxrstor "); - #endif - (*pMyDisasm).Argument2.ArgSize = 512; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; - (*pMyDisasm).Argument1.ArgSize = 512; - } - else { - FailDecode(pMyDisasm); - } - - } - else if (GV.REGOPCODE == 2) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2dword; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ldmxcsr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - FailDecode(pMyDisasm); - } - - } - else if (GV.REGOPCODE == 3) { - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg1dword; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stmxcsr "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - FailDecode(pMyDisasm); - } - - } - - else if (GV.REGOPCODE == 4) { - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg1multibytes; - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsave "); - #endif - (*pMyDisasm).Argument1.ArgSize = 512; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; - (*pMyDisasm).Argument2.ArgSize = 512; - } - else { - FailDecode(pMyDisasm); - } - } - - else if (GV.REGOPCODE == 5) { - GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; - if (GV.MOD_== 0x3) { - (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lfence "); - #endif - } - else { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MemDecoration = Arg2multibytes; - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xrstor "); - #endif - (*pMyDisasm).Argument2.ArgSize = 512; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; - (*pMyDisasm).Argument1.ArgSize = 512; - } - - } - else if (GV.REGOPCODE == 6) { - GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; - if (GV.MOD_== 0x3) { - (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mfence "); - #endif - } - else { - FailDecode(pMyDisasm); - } - } - else if (GV.REGOPCODE == 7) { - GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; - if (GV.MOD_== 0x3) { - (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sfence "); - #endif - } - else { - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.OperandSize = 32; - GV.MemDecoration = Arg2byte; - (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clflush "); - #endif - } - - } - - else { - FailDecode(pMyDisasm); - } - GV.EIP_+= GV.DECALAGE_EIP+2; -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ G15_(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg1multibytes; + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxsave "); + #endif + (*pMyDisasm).Argument1.ArgSize = 512; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; + (*pMyDisasm).Argument2.ArgSize = 512; + } + else { + FailDecode(pMyDisasm); + } + } + else if (GV.REGOPCODE == 1) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2multibytes; + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "fxrstor "); + #endif + (*pMyDisasm).Argument2.ArgSize = 512; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; + (*pMyDisasm).Argument1.ArgSize = 512; + } + else { + FailDecode(pMyDisasm); + } + + } + else if (GV.REGOPCODE == 2) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2dword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ldmxcsr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + FailDecode(pMyDisasm); + } + + } + else if (GV.REGOPCODE == 3) { + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg1dword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stmxcsr "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + FailDecode(pMyDisasm); + } + + } + + else if (GV.REGOPCODE == 4) { + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg1multibytes; + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsave "); + #endif + (*pMyDisasm).Argument1.ArgSize = 512; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; + (*pMyDisasm).Argument2.ArgSize = 512; + } + else { + FailDecode(pMyDisasm); + } + } + + else if (GV.REGOPCODE == 5) { + GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; + if (GV.MOD_== 0x3) { + (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lfence "); + #endif + } + else { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MemDecoration = Arg2multibytes; + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xrstor "); + #endif + (*pMyDisasm).Argument2.ArgSize = 512; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+FPU_REG+MMX_REG+SSE_REG; + (*pMyDisasm).Argument1.ArgSize = 512; + } + + } + else if (GV.REGOPCODE == 6) { + GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; + if (GV.MOD_== 0x3) { + (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mfence "); + #endif + } + else { + FailDecode(pMyDisasm); + } + } + else if (GV.REGOPCODE == 7) { + GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; + if (GV.MOD_== 0x3) { + (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sfence "); + #endif + } + else { + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize = 32; + GV.MemDecoration = Arg2byte; + (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clflush "); + #endif + } + + } + + else { + FailDecode(pMyDisasm); + } + GV.EIP_+= GV.DECALAGE_EIP+2; +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp16.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp16.c index 0f0b6460eb4044406ceb6af28d413a9ff13f3fc1..5956419c212c609febe53510fa48027fc0528e0d 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp16.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp16.c @@ -1,85 +1,85 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * - * ==================================================================== */ -void __bea_callspec__ G16_(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2byte; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchNTA "); - #endif - } - else { - FailDecode(pMyDisasm); - } - } - else if (GV.REGOPCODE == 1) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2byte; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT0 "); - #endif - } - else { - FailDecode(pMyDisasm); - } - - } - else if (GV.REGOPCODE == 2) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2byte; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT1 "); - #endif - } - else { - FailDecode(pMyDisasm); - } - - } - else if (GV.REGOPCODE == 3) { - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.MOD_!= 0x3) { - GV.MemDecoration = Arg2byte; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT2 "); - #endif - } - else { - FailDecode(pMyDisasm); - } - - } - - else { - FailDecode(pMyDisasm); - } - GV.EIP_+= GV.DECALAGE_EIP+2; -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * + * ==================================================================== */ +void __bea_callspec__ G16_(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2fword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchNTA "); + #endif + } + else { + FailDecode(pMyDisasm); + } + } + else if (GV.REGOPCODE == 1) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2fword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT0 "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + } + else if (GV.REGOPCODE == 2) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2fword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT1 "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + } + else if (GV.REGOPCODE == 3) { + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.MOD_!= 0x3) { + GV.MemDecoration = Arg2fword; + (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "prefetchT2 "); + #endif + } + else { + FailDecode(pMyDisasm); + } + + } + + else { + FailDecode(pMyDisasm); + } + GV.EIP_+= GV.DECALAGE_EIP+2; +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp2.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp2.c index 5e866235e5750660d350d8d4dfdae8e6d3af2fe1..e2cd0cd86f35d569a963dacc3388a2834c504aee 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp2.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp2.c @@ -1,461 +1,461 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0c0h - * ==================================================================== */ -void __bea_callspec__ G2_EbIb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EbIb(pMyDisasm); - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 92); - } -} - - -/* ==================================================================== - * 0c1h - * ==================================================================== */ -void __bea_callspec__ G2_EvIb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EvIb(pMyDisasm, 0); - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 92); - } -} - -/* ==================================================================== - * 0d0h - * ==================================================================== */ -void __bea_callspec__ G2_Eb1(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 "); - #endif - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - (*pMyDisasm).Instruction.Immediat = 1; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 87); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 87); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 80); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 80); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 91); - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * 0d1h - * ==================================================================== */ -void __bea_callspec__ G2_Ev1(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg1qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg1dword; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 "); - #endif - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - (*pMyDisasm).Instruction.Immediat = 1; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 87); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 87); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 80); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 80); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 91); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 91); - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * 0d2h - * ==================================================================== */ -void __bea_callspec__ G2_EbCL(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 8; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 92); - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} - - -/* ==================================================================== - * 0d3h - * ==================================================================== */ -void __bea_callspec__ G2_EvCL(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg1qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg1dword; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 8; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); - #endif - FillFlags(pMyDisasm, 88); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); - #endif - FillFlags(pMyDisasm, 81); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); - #endif - FillFlags(pMyDisasm, 92); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); - #endif - FillFlags(pMyDisasm, 92); - } - GV.EIP_ += GV.DECALAGE_EIP+2; -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0c0h + * ==================================================================== */ +void __bea_callspec__ G2_EbIb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EbIb(pMyDisasm); + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 92); + } +} + + +/* ==================================================================== + * 0c1h + * ==================================================================== */ +void __bea_callspec__ G2_EvIb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EvIb(pMyDisasm, 0); + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 92); + } +} + +/* ==================================================================== + * 0d0h + * ==================================================================== */ +void __bea_callspec__ G2_Eb1(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 "); + #endif + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 8; + (*pMyDisasm).Instruction.Immediat = 1; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 87); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 87); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 80); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 80); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 91); + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * 0d1h + * ==================================================================== */ +void __bea_callspec__ G2_Ev1(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg1qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg1dword; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, "1 "); + #endif + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 8; + (*pMyDisasm).Instruction.Immediat = 1; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 87); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 87); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 80); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 80); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 91); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 91); + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * 0d2h + * ==================================================================== */ +void __bea_callspec__ G2_EbCL(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 8; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 92); + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} + + +/* ==================================================================== + * 0d3h + * ==================================================================== */ +void __bea_callspec__ G2_EvCL(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg1qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg1dword; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[1]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 8; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rol "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ror "); + #endif + FillFlags(pMyDisasm, 88); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcl "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcr "); + #endif + FillFlags(pMyDisasm, 81); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shl "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shr "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sal "); + #endif + FillFlags(pMyDisasm, 92); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sar "); + #endif + FillFlags(pMyDisasm, 92); + } + GV.EIP_ += GV.DECALAGE_EIP+2; +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp3.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp3.c index 94bb0695ca4b2e5b492928850cec1ae4f26271a1..2e2433c67b9025955a3ed06232cd6aa1b6ed594e 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp3.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp3.c @@ -1,257 +1,257 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0f6h - * ==================================================================== */ -void __bea_callspec__ G3_Eb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - EbIb(pMyDisasm); - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 104); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - EbIb(pMyDisasm); - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 104); - } - else if (GV.REGOPCODE == 2) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not "); - #endif - Eb(pMyDisasm); - FillFlags(pMyDisasm, 73); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg "); - #endif - Eb(pMyDisasm); - FillFlags(pMyDisasm, 71); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul "); - #endif - GV.MemDecoration = Arg2byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0; - FillFlags(pMyDisasm, 70); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul "); - #endif - GV.MemDecoration = Arg2byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 8; - FillFlags(pMyDisasm, 38); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div "); - #endif - GV.MemDecoration = Arg2byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 8; - FillFlags(pMyDisasm, 31); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv "); - #endif - GV.MemDecoration = Arg2byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0; - FillFlags(pMyDisasm, 37); - } -} - -/* ==================================================================== - * 0f7h - * ==================================================================== */ -void __bea_callspec__ G3_Ev(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - EvIv(pMyDisasm); - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 104); - } - else if (GV.REGOPCODE == 1) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - EvIv(pMyDisasm); - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 104); - } - else if (GV.REGOPCODE == 2) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not "); - #endif - Ev(pMyDisasm); - FillFlags(pMyDisasm, 73); - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg "); - #endif - Ev(pMyDisasm); - FillFlags(pMyDisasm, 71); - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - GV.MemDecoration = Arg2word; - (*pMyDisasm).Argument1.ArgSize = 16; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - FillFlags(pMyDisasm, 70); - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - GV.MemDecoration = Arg2word; - (*pMyDisasm).Argument1.ArgSize = 16; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - FillFlags(pMyDisasm, 38); - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - GV.MemDecoration = Arg2word; - (*pMyDisasm).Argument1.ArgSize = 16; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - FillFlags(pMyDisasm, 31); - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - GV.MemDecoration = Arg2word; - (*pMyDisasm).Argument1.ArgSize = 16; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - FillFlags(pMyDisasm, 37); - } -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0f6h + * ==================================================================== */ +void __bea_callspec__ G3_Eb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + EbIb(pMyDisasm); + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 104); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + EbIb(pMyDisasm); + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 104); + } + else if (GV.REGOPCODE == 2) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not "); + #endif + Eb(pMyDisasm); + FillFlags(pMyDisasm, 73); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg "); + #endif + Eb(pMyDisasm); + FillFlags(pMyDisasm, 71); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul "); + #endif + GV.MemDecoration = Arg2byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0; + FillFlags(pMyDisasm, 70); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul "); + #endif + GV.MemDecoration = Arg2byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 8; + FillFlags(pMyDisasm, 38); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div "); + #endif + GV.MemDecoration = Arg2byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 8; + FillFlags(pMyDisasm, 31); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv "); + #endif + GV.MemDecoration = Arg2byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0; + FillFlags(pMyDisasm, 37); + } +} + +/* ==================================================================== + * 0f7h + * ==================================================================== */ +void __bea_callspec__ G3_Ev(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + EvIv(pMyDisasm); + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 104); + } + else if (GV.REGOPCODE == 1) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + EvIv(pMyDisasm); + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 104); + } + else if (GV.REGOPCODE == 2) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "not "); + #endif + Ev(pMyDisasm); + FillFlags(pMyDisasm, 73); + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "neg "); + #endif + Ev(pMyDisasm); + FillFlags(pMyDisasm, 71); + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mul "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + GV.MemDecoration = Arg2word; + (*pMyDisasm).Argument1.ArgSize = 16; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + FillFlags(pMyDisasm, 70); + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "imul "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + GV.MemDecoration = Arg2word; + (*pMyDisasm).Argument1.ArgSize = 16; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + FillFlags(pMyDisasm, 38); + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "div "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + GV.MemDecoration = Arg2word; + (*pMyDisasm).Argument1.ArgSize = 16; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + FillFlags(pMyDisasm, 31); + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "idiv "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + GV.MemDecoration = Arg2word; + (*pMyDisasm).Argument1.ArgSize = 16; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + FillFlags(pMyDisasm, 37); + } +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp4.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp4.c index 7e7566a93c62b4881deb7fe30c521c2dd1d6d73c..4e430b9b6bec99dcf158dc17ce1dbc49dba84c7c 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp4.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp4.c @@ -1,51 +1,51 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0feh - * ==================================================================== */ -void __bea_callspec__ G4_Eb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc "); - #endif - Eb(pMyDisasm); - FillFlags(pMyDisasm, 40); - } - else if (GV.REGOPCODE == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec "); - #endif - Eb(pMyDisasm); - FillFlags(pMyDisasm, 30); - } - else { - FailDecode(pMyDisasm); - } -} - +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0feh + * ==================================================================== */ +void __bea_callspec__ G4_Eb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc "); + #endif + Eb(pMyDisasm); + FillFlags(pMyDisasm, 40); + } + else if (GV.REGOPCODE == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec "); + #endif + Eb(pMyDisasm); + FillFlags(pMyDisasm, 30); + } + else { + FailDecode(pMyDisasm); + } +} + diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp5.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp5.c index c999f58b2389614a1e80f4da34d3e558a26bbf29..f7ad8040a372ddaa4d58a9737fd09a06125014a7 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp5.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp5.c @@ -1,153 +1,153 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0ffh - * ==================================================================== */ -void __bea_callspec__ G5_Ev(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc "); - #endif - Ev(pMyDisasm); - FillFlags(pMyDisasm, 40); - } - else if (GV.REGOPCODE == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec "); - #endif - Ev(pMyDisasm); - FillFlags(pMyDisasm, 30); - } - else if (GV.REGOPCODE == 2) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = CallType; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - } - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg1qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg1dword; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } - else if (GV.REGOPCODE == 3) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = CallType; - if (GV.SYNTAX_ == ATSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lcall "); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call far "); - #endif - } - GV.MemDecoration = Arg1fword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } - else if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = JmpType; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - } - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg1qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg1dword; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 5) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = JmpType; - if (GV.SYNTAX_ == ATSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ljmp "); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp far "); - #endif - } - GV.MemDecoration = Arg1fword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 6) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - } - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - } - else { - GV.MemDecoration = Arg2word; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = GV.OperandSize; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } - else { - FailDecode(pMyDisasm); - } -} - +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0ffh + * ==================================================================== */ +void __bea_callspec__ G5_Ev(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "inc "); + #endif + Ev(pMyDisasm); + FillFlags(pMyDisasm, 40); + } + else if (GV.REGOPCODE == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "dec "); + #endif + Ev(pMyDisasm); + FillFlags(pMyDisasm, 30); + } + else if (GV.REGOPCODE == 2) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = CallType; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + } + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg1qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg1dword; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } + else if (GV.REGOPCODE == 3) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = CallType; + if (GV.SYNTAX_ == ATSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lcall "); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "call far "); + #endif + } + GV.MemDecoration = Arg1fword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } + else if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = JmpType; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + } + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg1qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg1dword; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 5) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = JmpType; + if (GV.SYNTAX_ == ATSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ljmp "); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jmp far "); + #endif + } + GV.MemDecoration = Arg1fword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 6) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + } + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + } + else { + GV.MemDecoration = Arg2word; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = GV.OperandSize; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } + else { + FailDecode(pMyDisasm); + } +} + diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp6.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp6.c index 9f622417b1caa1b185097bbe193311597310aa7c..af09f7a4bb53a891dd5f9b1fe0f5eb09e6786e07 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp6.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp6.c @@ -1,117 +1,117 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0f00h - * ==================================================================== */ -void __bea_callspec__ G6_(PDISASM pMyDisasm) -{ - Int32 OperandSizeOld = 0; - - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - OperandSizeOld = GV.OperandSize; - GV.OperandSize = 16; - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; - - if (GV.REGOPCODE == 0) { - if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) { - GV.OperandSize = OperandSizeOld; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sldt "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 32; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 1) { - if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) { - GV.OperandSize = OperandSizeOld; - } - else { - GV.MemDecoration = Arg1word; - } - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "str "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 2) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lldt "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1; - (*pMyDisasm).Argument1.ArgSize = 16; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 3) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ltr "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3; - (*pMyDisasm).Argument1.ArgSize = 16; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verr "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 5) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verw "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.OperandSize = OperandSizeOld; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 6) { - FailDecode(pMyDisasm); - GV.OperandSize = OperandSizeOld; - } - else { - FailDecode(pMyDisasm); - GV.OperandSize = OperandSizeOld; - } -} - +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0f00h + * ==================================================================== */ +void __bea_callspec__ G6_(PDISASM pMyDisasm) +{ + Int32 OperandSizeOld = 0; + + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + OperandSizeOld = GV.OperandSize; + GV.OperandSize = 16; + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; + + if (GV.REGOPCODE == 0) { + if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) { + GV.OperandSize = OperandSizeOld; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sldt "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 32; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 1) { + if ((OperandSizeOld == 64) && (GV.MOD_== 0x3)) { + GV.OperandSize = OperandSizeOld; + } + else { + GV.MemDecoration = Arg1word; + } + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "str "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 2) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lldt "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG1; + (*pMyDisasm).Argument1.ArgSize = 16; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 3) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ltr "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG3; + (*pMyDisasm).Argument1.ArgSize = 16; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verr "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 5) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "verw "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.OperandSize = OperandSizeOld; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 6) { + FailDecode(pMyDisasm); + GV.OperandSize = OperandSizeOld; + } + else { + FailDecode(pMyDisasm); + GV.OperandSize = OperandSizeOld; + } +} + diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp7.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp7.c index f657914444f2e01746fcc19239bd50ac5d19c6e2..465b6d619501f599310f0a6e22c5cd043f8040be 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp7.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp7.c @@ -1,278 +1,278 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0f01h - * ==================================================================== */ -void __bea_callspec__ G7_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; - GV.RM_ = (*((UInt8*)(UIntPtr) (GV.EIP_+1))) & 0x7; - if (GV.REGOPCODE == 0) { - if (GV.MOD_== 0x3) { - if (GV.RM_ == 0x1) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmcall "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x2) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmlaunch "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x3) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmresume "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x4) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxoff "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - else { - GV.MemDecoration = Arg1fword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sgdt "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 48; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else if (GV.REGOPCODE == 1) { - if (GV.MOD_== 0x3) { - if (GV.RM_ == 0x00) { - (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "monitor "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x01) { - (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mwait "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - else { - GV.MemDecoration = Arg1fword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sidt "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2; - (*pMyDisasm).Argument2.ArgSize = 48; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else if (GV.REGOPCODE == 2) { - if (GV.MOD_== 0x3) { - if (GV.RM_ == 0x0) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xgetbv "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x1) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsetbv "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - else { - GV.MemDecoration = Arg2fword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lgdt "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 48; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else if (GV.REGOPCODE == 3) { - if (GV.MOD_== 0x3) { - if (GV.RM_ == 0x0) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmrun "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x1) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmmcall "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x2) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmload "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x3) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmsave "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x4) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stgi "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x5) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clgi "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x6) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "skinit "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.RM_ == 0x7) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpga "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - else { - GV.MemDecoration = Arg2fword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lidt "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2; - (*pMyDisasm).Argument1.ArgSize = 48; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - - else if (GV.REGOPCODE == 4) { - GV.MemDecoration = Arg2word; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "smsw "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+CR_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 16; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - - else if (GV.REGOPCODE == 6) { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lmsw "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+CR_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else if (GV.REGOPCODE == 7) { - if (GV.MOD_== 0x3) { - if (GV.Architecture == 64) { - if (GV.RM_ == 0x0) { - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "swapgs "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - else { - if (GV.RM_ == 0x1) { - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdtscp "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - } - } - else { - GV.MemDecoration = Arg2byte; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpg "); - #endif - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else { - FailDecode(pMyDisasm); - } - - -} - +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0f01h + * ==================================================================== */ +void __bea_callspec__ G7_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; + GV.RM_ = (*((UInt8*)(UIntPtr) (GV.EIP_+1))) & 0x7; + if (GV.REGOPCODE == 0) { + if (GV.MOD_== 0x3) { + if (GV.RM_ == 0x1) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmcall "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x2) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmlaunch "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x3) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmresume "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x4) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxoff "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + else { + GV.MemDecoration = Arg1fword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sgdt "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 48; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else if (GV.REGOPCODE == 1) { + if (GV.MOD_== 0x3) { + if (GV.RM_ == 0x00) { + (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "monitor "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x01) { + (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+AGENT_SYNCHRONISATION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mwait "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + else { + GV.MemDecoration = Arg1fword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sidt "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2; + (*pMyDisasm).Argument2.ArgSize = 48; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else if (GV.REGOPCODE == 2) { + if (GV.MOD_== 0x3) { + if (GV.RM_ == 0x0) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xgetbv "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x1) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xsetbv "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + else { + GV.MemDecoration = Arg2fword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lgdt "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 48; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else if (GV.REGOPCODE == 3) { + if (GV.MOD_== 0x3) { + if (GV.RM_ == 0x0) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmrun "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x1) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmmcall "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x2) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmload "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x3) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmsave "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x4) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stgi "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x5) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "clgi "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x6) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "skinit "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.RM_ == 0x7) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpga "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + else { + GV.MemDecoration = Arg2fword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lidt "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+MEMORY_MANAGEMENT_REG+REG2; + (*pMyDisasm).Argument1.ArgSize = 48; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + + else if (GV.REGOPCODE == 4) { + GV.MemDecoration = Arg2word; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "smsw "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+CR_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 16; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + + else if (GV.REGOPCODE == 6) { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lmsw "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+CR_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else if (GV.REGOPCODE == 7) { + if (GV.MOD_== 0x3) { + if (GV.Architecture == 64) { + if (GV.RM_ == 0x0) { + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "swapgs "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + else { + if (GV.RM_ == 0x1) { + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdtscp "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + } + } + else { + GV.MemDecoration = Arg2byte; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "invlpg "); + #endif + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else { + FailDecode(pMyDisasm); + } + + +} + diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp8.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp8.c index 8057b7eb8945546df60ede61b6ff9d6baa472846..13eff4994214a52d364f125cffd336868cccaf43 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp8.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp8.c @@ -1,70 +1,70 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 0fbah - * ==================================================================== */ -void __bea_callspec__ G8_EvIb(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - EvIb(pMyDisasm,0); - if (GV.REGOPCODE == 4) { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bt "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 11); - } - else if (GV.REGOPCODE == 5) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bts "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 11); - } - else if (GV.REGOPCODE == 6) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btr "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 11); - } - else if (GV.REGOPCODE == 7) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btc "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 11); - } - else { - FailDecode(pMyDisasm); - } -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 0fbah + * ==================================================================== */ +void __bea_callspec__ G8_EvIb(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + EvIb(pMyDisasm,0); + if (GV.REGOPCODE == 4) { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bt "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 11); + } + else if (GV.REGOPCODE == 5) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "bts "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 11); + } + else if (GV.REGOPCODE == 6) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btr "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 11); + } + else if (GV.REGOPCODE == 7) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "btc "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 11); + } + else { + FailDecode(pMyDisasm); + } +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp9.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp9.c index 96db41edcfcc27e920722792ee62a4f868b2e52c..84d1dffb470b164538f282ba4aad2cefa0327e1d 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp9.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp9.c @@ -1,94 +1,94 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - - -/* ==================================================================== - * 0fc7h - * ==================================================================== */ -void __bea_callspec__ G9_(PDISASM pMyDisasm) -{ - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - GV.MemDecoration = Arg2qword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - if (GV.REGOPCODE == 1) { - if (GV.REX.W_ == 1) { - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg16b "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 128; - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 23); - GV.EIP_ += GV.DECALAGE_EIP+2; - } - else { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg8b "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument1.AccessMode = READ; - FillFlags(pMyDisasm, 23); - GV.EIP_ += GV.DECALAGE_EIP+2; - } - } - else if (GV.REGOPCODE == 6) { - if (GV.OperandSize == 16) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmclear "); - #endif - } - else if (GV.PrefRepe == 1) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxon "); - #endif - } +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + + +/* ==================================================================== + * 0fc7h + * ==================================================================== */ +void __bea_callspec__ G9_(PDISASM pMyDisasm) +{ + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + GV.MemDecoration = Arg2qword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + if (GV.REGOPCODE == 1) { + if (GV.REX.W_ == 1) { + GV.MemDecoration = Arg2dqword; + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg16b "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 128; + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 23); + GV.EIP_ += GV.DECALAGE_EIP+2; + } + else { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpxchg8b "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument1.AccessMode = READ; + FillFlags(pMyDisasm, 23); + GV.EIP_ += GV.DECALAGE_EIP+2; + } + } + else if (GV.REGOPCODE == 6) { + if (GV.OperandSize == 16) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmclear "); + #endif + } + else if (GV.PrefRepe == 1) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmxon "); + #endif + } else if(GV.MOD_ == 3 ) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdrand "); - #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdrand "); + #endif } else { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrld "); - #endif + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrld "); + #endif } - - GV.EIP_ += GV.DECALAGE_EIP+2; - - } - else if (GV.REGOPCODE == 7) { - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrst "); - #endif - GV.EIP_ += GV.DECALAGE_EIP+2; - } - else { - FailDecode(pMyDisasm); - } - -} + + GV.EIP_ += GV.DECALAGE_EIP+2; + + } + else if (GV.REGOPCODE == 7) { + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmptrst "); + #endif + GV.EIP_ += GV.DECALAGE_EIP+2; + } + else { + FailDecode(pMyDisasm); + } + +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c index eeca02da0fcc0d61d4dbe7385f86495843ed560a..8f1405f6f1d015e0b94af38d5e89e0db437d8f10 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c @@ -1,1722 +1,1764 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -void __bea_callspec__ emms_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+STATE_MANAGEMENT; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "emms "); - #endif - GV.EIP_++; -} - -/* ==================================================================== - * 0x 0f 7e - * ==================================================================== */ -void __bea_callspec__ movd_EP(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; - /* ========= 0xf3 */ - if (GV.PrefRepe == 1) { - (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - if (GV.REX.W_ == 1) { - GV.MemDecoration = Arg1qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - GV.MemDecoration = Arg1dword; - GV.OperandSize = GV.OriginalOperandSize; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); - #endif - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else { - if (GV.REX.W_ == 1) { - GV.MemDecoration = Arg1qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MMX_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - GV.MemDecoration = Arg1dword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); - #endif - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MMX_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } -} - - -/* ==================================================================== - * 0x 0f 6e - * ==================================================================== */ -void __bea_callspec__ movd_PE(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - if (GV.REX.W_ == 1) { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +#include <assert.h> + +void __bea_callspec__ emms_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+STATE_MANAGEMENT; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "emms "); + #endif + GV.EIP_++; +} + +/* ==================================================================== + * 0x 0f 7e + * ==================================================================== */ +void __bea_callspec__ movd_EP(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; + /* ========= 0xf3 */ + if (GV.PrefRepe == 1) { + (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + /* ========== 0x66 */ + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + if (GV.REX.W_ == 1) { + GV.MemDecoration = Arg1qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + GV.MemDecoration = Arg1dword; + GV.OperandSize = GV.OriginalOperandSize; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); + #endif + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else { + if (GV.REX.W_ == 1) { + GV.MemDecoration = Arg1qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MMX_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + GV.MemDecoration = Arg1dword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); + #endif + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MMX_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } +} + + +/* ==================================================================== + * 0x 0f 6e + * ==================================================================== */ +void __bea_callspec__ movd_PE(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + if (GV.REX.W_ == 1) { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { GV.OperandSize = GV.OriginalOperandSize; - GV.MemDecoration = Arg2dword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); - #endif - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } - else { - if (GV.REX.W_ == 1) { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MMX_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - else { - GV.MemDecoration = Arg2dword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); - #endif - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MMX_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - } -} - - - -/* ==================================================================== - * 0x 0f 6f - * ==================================================================== */ -void __bea_callspec__ movq_PQ(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; - /* ========= 0xf3 */ - if (GV.PrefRepe == 1) { - (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqu "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqa "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - - -/* ==================================================================== - * 0x 0f 7f - * ==================================================================== */ -void __bea_callspec__ movq_QP(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; - /* ========= 0xf3 */ - if (GV.PrefRepe == 1) { - (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; - GV.MemDecoration = Arg1dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqu "); - #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; - } - /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg1dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqa "); - #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg1qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - GV.MMX_ = 1; - ExGx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d6 - * ==================================================================== */ -void __bea_callspec__ movq_WV(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; - /* ========= 0xf2 */ - if (GV.PrefRepne == 1) { - (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdq2q "); - #endif - GV.MMX_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.MMX_ = 0; - GV.SSE_ = 1; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.SSE_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - - } - /* ========= 0xf3 */ - else if (GV.PrefRepe == 1) { - (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq2dq "); - #endif - GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.SSE_ = 0; - GV.MMX_ = 1; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.MMX_ = 0; - GV.EIP_+= GV.DECALAGE_EIP+2; - } - /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg1qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); - #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; - } - else { - FailDecode(pMyDisasm); - } -} - - -/* ==================================================================== - * 0x 0f 38 1c - * ==================================================================== */ -void __bea_callspec__ pabsb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 38 1e - * ==================================================================== */ -void __bea_callspec__ pabsd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsd "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsd "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 38 1d - * ==================================================================== */ -void __bea_callspec__ pabsw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsw "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsw "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 63 - * ==================================================================== */ -void __bea_callspec__ packsswb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packsswb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packsswb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 6b - * ==================================================================== */ -void __bea_callspec__ packssdw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packssdw "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packssdw "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 67 - * ==================================================================== */ -void __bea_callspec__ packuswb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packuswb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packuswb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f fc - * ==================================================================== */ -void __bea_callspec__ paddb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f fd - * ==================================================================== */ -void __bea_callspec__ paddw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddw "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddw "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f fe - * ==================================================================== */ -void __bea_callspec__ paddd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddd "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddd "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f ec - * ==================================================================== */ -void __bea_callspec__ paddsb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f ed - * ==================================================================== */ -void __bea_callspec__ paddsw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsw "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsw "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f dc - * ==================================================================== */ -void __bea_callspec__ paddusb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusb "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusb "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f dd - * ==================================================================== */ -void __bea_callspec__ paddusw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusw "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusw "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f db - * ==================================================================== */ -void __bea_callspec__ pand_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pand "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pand "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} -/* ==================================================================== - * 0x 0f df - * ==================================================================== */ -void __bea_callspec__ pandn_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pandn "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pandn "); - #endif - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 74 - * ==================================================================== */ -void __bea_callspec__ pcmpeqb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 75 - * ==================================================================== */ -void __bea_callspec__ pcmpeqw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 76 - * ==================================================================== */ -void __bea_callspec__ pcmpeqd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 64 - * ==================================================================== */ -void __bea_callspec__ pcmpgtb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 65 - * ==================================================================== */ -void __bea_callspec__ pcmpgtw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 66 - * ==================================================================== */ -void __bea_callspec__ pcmpgtd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f e5 - * ==================================================================== */ -void __bea_callspec__ pmulhw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmulhw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmulhw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d5 - * ==================================================================== */ -void __bea_callspec__ pmullw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmullw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmullw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f5 - * ==================================================================== */ -void __bea_callspec__ pmaddwd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmaddwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmaddwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f eb - * ==================================================================== */ -void __bea_callspec__ por_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "por "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "por "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f1 - * ==================================================================== */ -void __bea_callspec__ psllw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f2 - * ==================================================================== */ -void __bea_callspec__ pslld_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f3 - * ==================================================================== */ -void __bea_callspec__ psllq_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d1 - * ==================================================================== */ -void __bea_callspec__ psrlw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d2 - * ==================================================================== */ -void __bea_callspec__ psrld_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d3 - * ==================================================================== */ -void __bea_callspec__ psrlq_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f e1 - * ==================================================================== */ -void __bea_callspec__ psraw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f e2 - * ==================================================================== */ -void __bea_callspec__ psrad_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f8 - * ==================================================================== */ -void __bea_callspec__ psubb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f f9 - * ==================================================================== */ -void __bea_callspec__ psubw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f fa - * ==================================================================== */ -void __bea_callspec__ psubd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f e8 - * ==================================================================== */ -void __bea_callspec__ psubsb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f e9 - * ==================================================================== */ -void __bea_callspec__ psubsw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d8 - * ==================================================================== */ -void __bea_callspec__ psubusb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusb "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f d9 - * ==================================================================== */ -void __bea_callspec__ psubusw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 68 - * ==================================================================== */ -void __bea_callspec__ punpckhbw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhbw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhbw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 69 - * ==================================================================== */ -void __bea_callspec__ punpckhwd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 6a - * ==================================================================== */ -void __bea_callspec__ punpckhdq_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhdq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhdq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 60 - * ==================================================================== */ -void __bea_callspec__ punpcklbw_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklbw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklbw "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 61 - * ==================================================================== */ -void __bea_callspec__ punpcklwd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklwd "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f 62 - * ==================================================================== */ -void __bea_callspec__ punpckldq_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckldq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckldq "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} - -/* ==================================================================== - * 0x 0f ef - * ==================================================================== */ -void __bea_callspec__ pxor_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; - /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - GV.OperandSize = GV.OriginalOperandSize; - (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; - GV.MemDecoration = Arg2dqword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pxor "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - } - else { - GV.MemDecoration = Arg2qword; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pxor "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GV.MMX_ = 1; - GxEx(pMyDisasm); - GV.MMX_ = 0; - } -} + GV.MemDecoration = Arg2dword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); + #endif + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } + else { + if (GV.REX.W_ == 1) { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MMX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + else { + GV.MemDecoration = Arg2dword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movd "); + #endif + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MMX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + } +} + + + +/* ==================================================================== + * 0x 0f 6f + * ==================================================================== */ +void __bea_callspec__ movq_PQ(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; + /* ========= 0xf3 */ + if (GV.PrefRepe == 1) { + (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqu "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + /* ========== 0x66 */ + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdqa "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + + +/* ==================================================================== + * 0x 0f 7f + * ==================================================================== */ +void __bea_callspec__ movq_QP(PDISASM pMyDisasm) +{ + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; + /* ========= 0xf3 */ + if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { + assert(!GV.VEX.has_vex); + (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; + GV.MemDecoration = Arg1dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movdqu "); + #endif + GV.SSE_ = 1; + ExGx(pMyDisasm); + GV.SSE_ = 0; + } + /* ========== 0x66 */ + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg1dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movdqa "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + ExGx(pMyDisasm); + GV.AVX_ = 0; + GV.SSE_ = 0; + } + else { + assert(!GV.VEX.has_vex); + GV.MemDecoration = Arg1qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + GV.MMX_ = 1; + ExGx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d6 + * ==================================================================== */ +void __bea_callspec__ movq_WV(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; + /* ========= 0xf2 */ + if (GV.PrefRepne == 1) { + (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movdq2q "); + #endif + GV.MMX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.MMX_ = 0; + GV.SSE_ = 1; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.SSE_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + + } + /* ========= 0xf3 */ + else if (GV.PrefRepe == 1) { + (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq2dq "); + #endif + GV.SSE_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_ = 0; + GV.MMX_ = 1; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.MMX_ = 0; + GV.EIP_+= GV.DECALAGE_EIP+2; + } + /* ========== 0x66 */ + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg1qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movq "); + #endif + GV.SSE_ = 1; + ExGx(pMyDisasm); + GV.SSE_ = 0; + } + else { + FailDecode(pMyDisasm); + } +} + + +/* ==================================================================== + * 0x 0f 38 1c + * ==================================================================== */ +void __bea_callspec__ pabsb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsb "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 38 1e + * ==================================================================== */ +void __bea_callspec__ pabsd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsd "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsd "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 38 1d + * ==================================================================== */ +void __bea_callspec__ pabsw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsw "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pabsw "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 63 + * ==================================================================== */ +void __bea_callspec__ packsswb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packsswb "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packsswb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 6b + * ==================================================================== */ +void __bea_callspec__ packssdw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packssdw "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packssdw "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 67 + * ==================================================================== */ +void __bea_callspec__ packuswb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packuswb "); + #endif + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "packuswb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f fc + * ==================================================================== */ +void __bea_callspec__ paddb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddb "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f fd + * ==================================================================== */ +void __bea_callspec__ paddw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddw "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddw "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f fe + * ==================================================================== */ +void __bea_callspec__ paddd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddd "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddd "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f ec + * ==================================================================== */ +void __bea_callspec__ paddsb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddsb "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f ed + * ==================================================================== */ +void __bea_callspec__ paddsw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddsw "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddsw "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f dc + * ==================================================================== */ +void __bea_callspec__ paddusb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddusb "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusb "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f dd + * ==================================================================== */ +void __bea_callspec__ paddusw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "paddusw "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "paddusw "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f db + * ==================================================================== */ +void __bea_callspec__ pand_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pand "); + #endif + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + Vx_opt_GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pand "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} +/* ==================================================================== + * 0x 0f df + * ==================================================================== */ +void __bea_callspec__ pandn_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pandn "); + #endif + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pandn "); + #endif + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 74 + * ==================================================================== */ +void __bea_callspec__ pcmpeqb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 75 + * ==================================================================== */ +void __bea_callspec__ pcmpeqw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 76 + * ==================================================================== */ +void __bea_callspec__ pcmpeqd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpeqd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 64 + * ==================================================================== */ +void __bea_callspec__ pcmpgtb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 65 + * ==================================================================== */ +void __bea_callspec__ pcmpgtw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 66 + * ==================================================================== */ +void __bea_callspec__ pcmpgtd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+COMPARISON_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pcmpgtd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f e5 + * ==================================================================== */ +void __bea_callspec__ pmulhw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pmulhw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmulhw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d5 + * ==================================================================== */ +void __bea_callspec__ pmullw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pmullw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmullw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f5 + * ==================================================================== */ +void __bea_callspec__ pmaddwd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pmaddwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmaddwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f eb + * ==================================================================== */ +void __bea_callspec__ por_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "por "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "por "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f1 + * ==================================================================== */ +void __bea_callspec__ psllw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f2 + * ==================================================================== */ +void __bea_callspec__ pslld_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pslld "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f3 + * ==================================================================== */ +void __bea_callspec__ psllq_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psllq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d1 + * ==================================================================== */ +void __bea_callspec__ psrlw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d2 + * ==================================================================== */ +void __bea_callspec__ psrld_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrld "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d3 + * ==================================================================== */ +void __bea_callspec__ psrlq_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrlq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f e1 + * ==================================================================== */ +void __bea_callspec__ psraw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psraw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f e2 + * ==================================================================== */ +void __bea_callspec__ psrad_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+SHIFT_ROTATE; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrad "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psrad "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f8 + * ==================================================================== */ +void __bea_callspec__ psubb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f f9 + * ==================================================================== */ +void __bea_callspec__ psubw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f fa + * ==================================================================== */ +void __bea_callspec__ psubd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f e8 + * ==================================================================== */ +void __bea_callspec__ psubsb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubsb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f e9 + * ==================================================================== */ +void __bea_callspec__ psubsw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubsw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubsw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d8 + * ==================================================================== */ +void __bea_callspec__ psubusb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubusb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusb "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f d9 + * ==================================================================== */ +void __bea_callspec__ psubusw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+ARITHMETIC_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psubusw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "psubusw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 68 + * ==================================================================== */ +void __bea_callspec__ punpckhbw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpckhbw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhbw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 69 + * ==================================================================== */ +void __bea_callspec__ punpckhwd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpckhwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 6a + * ==================================================================== */ +void __bea_callspec__ punpckhdq_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpckhdq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhdq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 60 + * ==================================================================== */ +void __bea_callspec__ punpcklbw_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpcklbw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklbw "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 61 + * ==================================================================== */ +void __bea_callspec__ punpcklwd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpcklwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklwd "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f 62 + * ==================================================================== */ +void __bea_callspec__ punpckldq_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+CONVERSION_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpckldq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckldq "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} + +/* ==================================================================== + * 0x 0f ef + * ==================================================================== */ +void __bea_callspec__ pxor_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+LOGICAL_INSTRUCTION; + /* ========== 0x66 */ + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + GV.OperandSize = GV.OriginalOperandSize; + (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; + GV.MemDecoration = Arg2dqword; + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pxor "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + Vx_opt_GxEx_vexlen(pMyDisasm); + } + else { + GV.MemDecoration = Arg2qword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pxor "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GV.MMX_ = 1; + GxEx(pMyDisasm); + GV.MMX_ = 0; + } +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_N_Z.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_N_Z.c index feb57ea70c4680ad64b39ef46e5094f7a484df9c..1477ad0de6882cefd40fef517a1b5d52ca5784b4 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_N_Z.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_N_Z.c @@ -1,3692 +1,3692 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * 90h - * ==================================================================== */ -void __bea_callspec__ nop_(PDISASM pMyDisasm) -{ - if (GV.PrefRepe == 1) { - (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pause "); - #endif - GV.EIP_++; - } - else { - if (GV.REX.B_ == 1) { - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0+8]); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0+8]); - #endif - - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0+8]); - #endif - - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - - } - else { - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); - #endif - GV.EIP_++; - } - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ nop_Ev(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - } - else { - GV.MemDecoration = Arg2word; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument2.AccessMode = 0; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ hint_nop(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); - #endif - if (GV.OperandSize == 64) { - GV.MemDecoration = Arg2qword; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg2dword; - } - else { - GV.MemDecoration = Arg2word; - } - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; -} - -/* ======================================= - * 08h - * ======================================= */ -void __bea_callspec__ or_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,74); -} - -/* ======================================= - * 09h - * ======================================= */ -void __bea_callspec__ or_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,74); -} - -/* ======================================= - * 0ah - * ======================================= */ -void __bea_callspec__ or_GbEb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - GbEb(pMyDisasm); - FillFlags(pMyDisasm,74); -} - -/* ======================================= - * 0bh - * ======================================= */ -void __bea_callspec__ or_GvEv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - GvEv(pMyDisasm); - FillFlags(pMyDisasm,74); -} - -/* ======================================= - * 0ch - * ======================================= */ -void __bea_callspec__ or_ALIb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - ALIb(pMyDisasm); - FillFlags(pMyDisasm,74); -} - -/* ======================================= - * 0dh - * ======================================= */ -void __bea_callspec__ or_eAX_Iv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); - #endif - eAX_Iv(pMyDisasm); - FillFlags(pMyDisasm,74); -} - - -/* ======================================= - * 06eh - * ======================================= */ -void __bea_callspec__ outsb_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsb "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; - (*pMyDisasm).Argument2.ArgSize = 8; - GV.EIP_++; - FillFlags(pMyDisasm, 76); -} - -/* ======================================= - * 06fh - * ======================================= */ -void __bea_callspec__ outsw_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - if (GV.OperandSize >= 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; - (*pMyDisasm).Argument2.ArgSize = 32; - GV.EIP_++; - FillFlags(pMyDisasm, 76); - } - - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsw "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.EIP_++; - FillFlags(pMyDisasm, 76); - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ out_IbAL(PDISASM pMyDisasm) -{ - long MyNumber; - - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); - #endif - if (!Security(2, pMyDisasm)) return; - GV.ImmediatSize = 8; - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Instruction.Immediat = MyNumber; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 8; - GV.EIP_ += 2; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ out_Ib_eAX(PDISASM pMyDisasm) -{ - long MyNumber; - - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); - #endif - if (!Security(2, pMyDisasm)) return; - GV.ImmediatSize = 8; - MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.2X",(Int64) MyNumber); - #endif - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Instruction.Immediat = MyNumber; - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgSize = 16; - } - GV.EIP_ += 2; -} - - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ out_DXAL(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2]); - #endif - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgSize = 8; - GV.EIP_ ++; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ out_DXeAX(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); - #endif - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2]); - #endif - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgSize = 16; - } - GV.EIP_ ++; -} - -/* ======================================= - * 8fh - * ======================================= */ -void __bea_callspec__ pop_Ev(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; - if (GV.REGOPCODE == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - GV.MemDecoration = Arg1qword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } - else if (GV.OperandSize == 32) { - GV.MemDecoration = Arg1dword; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } - else { - GV.MemDecoration = Arg1word; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+2; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } - } - else { - FailDecode(pMyDisasm); - } -} - -/* ======================================= - * 58h - * ======================================= */ -void __bea_callspec__ pop_eax(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 59h - * ======================================= */ -void __bea_callspec__ pop_ecx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[1+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[1+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[1+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[1+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5ah - * ======================================= */ -void __bea_callspec__ pop_edx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[2+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[2+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[2+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5bh - * ======================================= */ -void __bea_callspec__ pop_ebx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[3+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[3+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[3+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[3+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5ch - * ======================================= */ -void __bea_callspec__ pop_esp(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[4+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[4+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[4+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[4+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5dh - * ======================================= */ -void __bea_callspec__ pop_ebp(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[5+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[5+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[5+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[5+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5eh - * ======================================= */ -void __bea_callspec__ pop_esi(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[6+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[6+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[6+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[6+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 5fh - * ======================================= */ -void __bea_callspec__ pop_edi(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[7+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[7+0+8]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7+8]; - } - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[7+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[7+0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ pop_es(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[0]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[0]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ pop_ss(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[2]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[2]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ pop_ds(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[3]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[3]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ pop_fs(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[4]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[4]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ pop_gs(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[5]); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[5]; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * 9dh - * ======================================= */ -void __bea_callspec__ popfd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - - if (GV.Architecture == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popfq "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popfd "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popf "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } -} - -/* ======================================= - * 9dh - * ======================================= */ -void __bea_callspec__ popad_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popad "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popa "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } -} - - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_es(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_ss(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[2]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[2]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_ds(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[3]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[3]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_fs(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[4]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[4]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_gs(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[5]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[5]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ push_cs(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[1]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[1]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - GV.EIP_++; - } -} - - - -/* ======================================= - * 50h - * ======================================= */ -void __bea_callspec__ push_eax(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 51h - * ======================================= */ -void __bea_callspec__ push_ecx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 52h - * ======================================= */ -void __bea_callspec__ push_edx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 53h - * ======================================= */ -void __bea_callspec__ push_ebx(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 54h - * ======================================= */ -void __bea_callspec__ push_esp(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 55h - * ======================================= */ -void __bea_callspec__ push_ebp(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 56h - * ======================================= */ -void __bea_callspec__ push_esi(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - -/* ======================================= - * 57h - * ======================================= */ -void __bea_callspec__ push_edi(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (GV.REX.B_ == 0) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+0+8]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7+8]; - } - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7+0]); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgSize = 16; - } - } - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; -} - - -/* ======================================= - * 68h - * ======================================= */ -void __bea_callspec__ push_Iv(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (GV.Architecture == 64) { - if (!Security(5, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((UInt32*)(UIntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 32; - (*pMyDisasm).Instruction.Immediat = *((UInt32*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_ += 5; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } - else if (GV.OperandSize == 32) { - if (!Security(5, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((UInt32*)(UIntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 32; - (*pMyDisasm).Instruction.Immediat = *((UInt32*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_ += 5; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } - else { - if (!Security(3, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 16; - (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_ += 3; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - } -} - -/* ======================================= - * 6ah - * ======================================= */ -void __bea_callspec__ push_Ib(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); - #endif - if (!Security(1, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((Int8*)(IntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 8; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_ += 2; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument2.ArgSize = 8; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; - -} - - -/* ======================================= - * 9ch - * ======================================= */ -void __bea_callspec__ pushfd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - - if (GV.Architecture == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushfq "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushfd "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushf "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - FillFlags(pMyDisasm, 78); - } -} - - -/* ======================================= - * 60h - * ======================================= */ -void __bea_callspec__ pushad_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - - if (GV.Architecture == 64) { - FailDecode(pMyDisasm); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushad "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pusha "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; - } -} - -/* ======================================= - * 0c2h - * ======================================= */ -void __bea_callspec__ retn_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = RetType; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retn "); - #endif - if (!Security(3, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 16; - (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_+=3; - (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; -} - -/* ======================================= - * 0c3h - * ======================================= */ -void __bea_callspec__ ret_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = RetType; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ret "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ retf_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = RetType; - if (GV.SYNTAX_ == ATSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lret "); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); - #endif - } - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ retf_Iw(PDISASM pMyDisasm) -{ - int i = 0; - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; - (*pMyDisasm).Instruction.BranchType = RetType; - if (GV.SYNTAX_ == ATSyntax) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lret "); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); - #endif - } - if (!Security(3, pMyDisasm)) return; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic+i,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); - #endif - GV.ImmediatSize = 16; - (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); - GV.EIP_+=3; - (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ rdtsc_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdtsc "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 32; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ rdmsr_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdmsr "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 32; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ rdpmc_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdpmc "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument2.ArgSize = 32; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ rsm_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rsm "); - #endif - GV.EIP_++; - FillFlags(pMyDisasm, 89); -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ sysenter_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysenter "); - #endif - GV.EIP_++; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ sysexit_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysexit "); - #endif - GV.EIP_++; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ sahf_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sahf "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 8; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ salc_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = UNDOCUMENTED_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "salc "); - #endif - GV.EIP_++; -} - - -/* ======================================= - * 0ach - * ======================================= */ -void __bea_callspec__ scasb_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasb "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument2.ArgSize = 8; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 94); -} - -/* ======================================= - * 0adh - * ======================================= */ -void __bea_callspec__ scas_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasq "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 94); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasd "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 94); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasw "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument1.AccessMode = READ; - (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 94); - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ stc_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stc "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 1; - FillFlags(pMyDisasm, 98); -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ sti_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sti "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 1; - FillFlags(pMyDisasm, 100); -} - - -/* ======================================= - * 0aah - * ======================================= */ -void __bea_callspec__ stos_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosb "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 8; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 101); -} - -/* ======================================= - * 0abh - * ======================================= */ -void __bea_callspec__ stosw_(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; - } - if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { - (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosq "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 64; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 101); - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosd "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 32; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 101); - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosw "); - #endif - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgSize = 16; - (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; - (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; - GV.EIP_++; - FillFlags(pMyDisasm, 101); - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ syscall_(PDISASM pMyDisasm) -{ - if (GV.Architecture == 64) { - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION+CONTROL_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "syscall "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG1+REG11; - (*pMyDisasm).Argument1.ArgSize = 64; - } - else { - FailDecode(pMyDisasm); - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ sysret_(PDISASM pMyDisasm) -{ - if (GV.Architecture == 64) { - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysret "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1+REG11; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else { - FailDecode(pMyDisasm); - } -} - - - -/* ======================================= - * 18h - * ======================================= */ -void __bea_callspec__ sbb_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 19h - * ======================================= */ -void __bea_callspec__ sbb_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 1ah - * ======================================= */ -void __bea_callspec__ sbb_GbEb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - GbEb(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 1bh - * ======================================= */ -void __bea_callspec__ sbb_GvEv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - GvEv(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 1ch - * ======================================= */ -void __bea_callspec__ sbb_ALIb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - ALIb(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 1dh - * ======================================= */ -void __bea_callspec__ sbb_eAX_Iv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); - #endif - eAX_Iv(pMyDisasm); - FillFlags(pMyDisasm,93); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ seto_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "seto "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f91h - * ======================================= */ -void __bea_callspec__ setno_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setno "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setb "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setnb_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnb "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ sete_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sete "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setne_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setne "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setbe_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setbe "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setnbe_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnbe "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ sets_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sets "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setns_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setns "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setp_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setp "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setnp_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnp "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setge_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnl "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setnge_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setl "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setle_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setle "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - -/* ======================================= - * 0f90h - * ======================================= */ -void __bea_callspec__ setnle_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnle "); - #endif - GV.MemDecoration = Arg1byte; - GV.OperandSize = 8; - MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); - GV.OperandSize = 32; - GV.EIP_+= GV.DECALAGE_EIP+2; - FillFlags(pMyDisasm,95); -} - - -/* ======================================= - * 0fa4h - * ======================================= */ -void __bea_callspec__ shld_EvGvIb(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shld "); - #endif - GV.ImmediatSize = 8; - EvGv(pMyDisasm); - GV.EIP_+= 1; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.8X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; - - FillFlags(pMyDisasm, 97); -} - - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ shld_EvGvCL(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shld "); - #endif - EvGv(pMyDisasm); - GV.third_arg = 2; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument3.ArgMnemonic, Registers8Bits[1]); - #endif - (*pMyDisasm).Argument3.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument3.ArgSize = 8; - FillFlags(pMyDisasm, 97); -} - -/* ======================================= - * 0fach - * ======================================= */ -void __bea_callspec__ shrd_EvGvIb(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shrd "); - #endif - GV.ImmediatSize = 8; - EvGv(pMyDisasm); - GV.EIP_+= 1; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.8X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; - - FillFlags(pMyDisasm, 97); -} - - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ shrd_EvGvCL(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shrd "); - #endif - EvGv(pMyDisasm); - GV.third_arg = 2; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument3.ArgMnemonic, Registers8Bits[1]); - #endif - (*pMyDisasm).Argument3.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - (*pMyDisasm).Argument3.ArgSize = 8; - FillFlags(pMyDisasm, 97); -} - - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ std_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "std "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 1; - FillFlags(pMyDisasm, 99); -} - - -/* ======================================= - * 28h - * ======================================= */ -void __bea_callspec__ sub_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 29h - * ======================================= */ -void __bea_callspec__ sub_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 2ah - * ======================================= */ -void __bea_callspec__ sub_GbEb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - GbEb(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 2bh - * ======================================= */ -void __bea_callspec__ sub_GvEv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - GvEv(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 2ch - * ======================================= */ -void __bea_callspec__ sub_ALIb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - ALIb(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 2dh - * ======================================= */ -void __bea_callspec__ sub_eAX_Iv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); - #endif - eAX_Iv(pMyDisasm); - FillFlags(pMyDisasm,103); -} - -/* ======================================= - * 84h - * ======================================= */ -void __bea_callspec__ test_EbGb(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - EbGb(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * 85h - * ======================================= */ -void __bea_callspec__ test_EvGv(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - EvGv(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * 86h - * ======================================= */ -void __bea_callspec__ test_GbEb(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GbEb(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * 87h - * ======================================= */ -void __bea_callspec__ test_GvEv(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - GvEv(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * 88h - * ======================================= */ -void __bea_callspec__ test_ALIb(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - ALIb(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * 89h - * ======================================= */ -void __bea_callspec__ test_eAX_Iv(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); - #endif - (*pMyDisasm).Argument1.AccessMode = READ; - eAX_Iv(pMyDisasm); - FillFlags(pMyDisasm,104); -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ ud2_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ud2 "); - #endif - GV.EIP_++; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ vmread_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmread "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - } - EvGv(pMyDisasm); - if (GV.Architecture == 64) { - GV.OperandSize = 32; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ vmwrite_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmwrite "); - #endif - if (GV.Architecture == 64) { - GV.OperandSize = 64; - } - GvEv(pMyDisasm); - if (GV.Architecture == 64) { - GV.OperandSize = 32; - } -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ wbinvd_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wbinvd "); - #endif - GV.EIP_++; -} - -/* ======================================= - * 9Bh - * ======================================= */ -void __bea_callspec__ wait_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wait "); - #endif - GV.EIP_++; -} - -/* ======================================= - * - * ======================================= */ -void __bea_callspec__ wrmsr_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wrmsr "); - #endif - GV.EIP_++; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2; - (*pMyDisasm).Argument2.ArgSize = 32; -} - - -/* ======================================= - * 0fc0h - * ======================================= */ -void __bea_callspec__ xadd_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xadd "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,110); -} - -/* ======================================= - * 0fc1h - * ======================================= */ -void __bea_callspec__ xadd_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xadd "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,110); -} - -/* ======================================= - * 91h - * ======================================= */ -void __bea_callspec__ xchg_ecx(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 92h - * ======================================= */ -void __bea_callspec__ xchg_edx(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 93h - * ======================================= */ -void __bea_callspec__ xchg_ebx(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 94h - * ======================================= */ -void __bea_callspec__ xchg_esp(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG4; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 95h - * ======================================= */ -void __bea_callspec__ xchg_ebp(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG5; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 96h - * ======================================= */ -void __bea_callspec__ xchg_esi(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG6; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - - -/* ======================================= - * 97h - * ======================================= */ -void __bea_callspec__ xchg_edi(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG7; - if (GV.OperandSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 64; - (*pMyDisasm).Argument2.ArgSize = 64; - } - else if (GV.OperandSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 32; - (*pMyDisasm).Argument2.ArgSize = 32; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); - #endif - if (GV.REX.B_ == 1) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7+8]); - #endif - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7]); - #endif - } - GV.EIP_++; - (*pMyDisasm).Argument2.AccessMode = WRITE; - (*pMyDisasm).Argument1.ArgSize = 16; - (*pMyDisasm).Argument2.ArgSize = 16; - } -} - -/* ======================================= - * 0d7h - * ======================================= */ -void __bea_callspec__ xlat_(PDISASM pMyDisasm) -{ - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; - if (GV.AddressSize == 64) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; - (*pMyDisasm).Argument2.ArgSize = 64; - GV.EIP_++; - } - else if (GV.AddressSize == 32) { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; - (*pMyDisasm).Argument2.ArgSize = 32; - GV.EIP_++; - } - else { - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); - #endif - (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; - (*pMyDisasm).Argument1.ArgSize = 8; - (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; - (*pMyDisasm).Argument2.ArgSize = 16; - GV.EIP_++; - } -} - - -/* ======================================= - * 30h - * ======================================= */ -void __bea_callspec__ xor_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,113); -} - -/* ======================================= - * 31h - * ======================================= */ -void __bea_callspec__ xor_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,113); -} - -/* ======================================= - * 32h - * ======================================= */ -void __bea_callspec__ xor_GbEb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - GbEb(pMyDisasm); - FillFlags(pMyDisasm,113); -} - -/* ======================================= - * 33h - * ======================================= */ -void __bea_callspec__ xor_GvEv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - GvEv(pMyDisasm); - FillFlags(pMyDisasm,113); -} - -/* ======================================= - * 34h - * ======================================= */ -void __bea_callspec__ xor_ALIb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - ALIb(pMyDisasm); - FillFlags(pMyDisasm,113); -} - -/* ======================================= - * 35h - * ======================================= */ -void __bea_callspec__ xor_eAX_Iv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); - #endif - eAX_Iv(pMyDisasm); - FillFlags(pMyDisasm,113); -} - - -/* ======================================= - * 86h - * ======================================= */ -void __bea_callspec__ xchg_EbGb(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - EbGb(pMyDisasm); - FillFlags(pMyDisasm,113); - (*pMyDisasm).Argument2.AccessMode = WRITE; -} - -/* ======================================= - * 87h - * ======================================= */ -void __bea_callspec__ xchg_EvGv(PDISASM pMyDisasm) -{ - if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { - (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; - } - (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); - #endif - EvGv(pMyDisasm); - FillFlags(pMyDisasm,113); - (*pMyDisasm).Argument2.AccessMode = WRITE; -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * 90h + * ==================================================================== */ +void __bea_callspec__ nop_(PDISASM pMyDisasm) +{ + if (GV.PrefRepe == 1) { + (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CACHEABILITY_CONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pause "); + #endif + GV.EIP_++; + } + else { + if (GV.REX.B_ == 1) { + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0+8]); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0+8]); + #endif + + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0+8]); + #endif + + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + + } + else { + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); + #endif + GV.EIP_++; + } + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ nop_Ev(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + } + else { + GV.MemDecoration = Arg2word; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument2.AccessMode = 0; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ hint_nop(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "nop "); + #endif + if (GV.OperandSize == 64) { + GV.MemDecoration = Arg2qword; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg2dword; + } + else { + GV.MemDecoration = Arg2word; + } + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; +} + +/* ======================================= + * 08h + * ======================================= */ +void __bea_callspec__ or_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,74); +} + +/* ======================================= + * 09h + * ======================================= */ +void __bea_callspec__ or_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,74); +} + +/* ======================================= + * 0ah + * ======================================= */ +void __bea_callspec__ or_GbEb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + GbEb(pMyDisasm); + FillFlags(pMyDisasm,74); +} + +/* ======================================= + * 0bh + * ======================================= */ +void __bea_callspec__ or_GvEv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + GvEv(pMyDisasm); + FillFlags(pMyDisasm,74); +} + +/* ======================================= + * 0ch + * ======================================= */ +void __bea_callspec__ or_ALIb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + ALIb(pMyDisasm); + FillFlags(pMyDisasm,74); +} + +/* ======================================= + * 0dh + * ======================================= */ +void __bea_callspec__ or_eAX_Iv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "or "); + #endif + eAX_Iv(pMyDisasm); + FillFlags(pMyDisasm,74); +} + + +/* ======================================= + * 06eh + * ======================================= */ +void __bea_callspec__ outsb_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsb "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; + (*pMyDisasm).Argument2.ArgSize = 8; + GV.EIP_++; + FillFlags(pMyDisasm, 76); +} + +/* ======================================= + * 06fh + * ======================================= */ +void __bea_callspec__ outsw_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + if (GV.OperandSize >= 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; + (*pMyDisasm).Argument2.ArgSize = 32; + GV.EIP_++; + FillFlags(pMyDisasm, 76); + } + + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "outsw "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG6; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.EIP_++; + FillFlags(pMyDisasm, 76); + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ out_IbAL(PDISASM pMyDisasm) +{ + long MyNumber; + + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); + #endif + if (!Security(2, pMyDisasm)) return; + GV.ImmediatSize = 8; + MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.2X",(Int64) MyNumber); + #endif + (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Instruction.Immediat = MyNumber; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 8; + GV.EIP_ += 2; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ out_Ib_eAX(PDISASM pMyDisasm) +{ + long MyNumber; + + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); + #endif + if (!Security(2, pMyDisasm)) return; + GV.ImmediatSize = 8; + MyNumber = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.2X",(Int64) MyNumber); + #endif + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Instruction.Immediat = MyNumber; + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgSize = 16; + } + GV.EIP_ += 2; +} + + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ out_DXAL(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2]); + #endif + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers8Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgSize = 8; + GV.EIP_ ++; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ out_DXeAX(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+InOutINSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "out "); + #endif + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2]); + #endif + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgSize = 16; + } + GV.EIP_ ++; +} + +/* ======================================= + * 8fh + * ======================================= */ +void __bea_callspec__ pop_Ev(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7; + if (GV.REGOPCODE == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + GV.MemDecoration = Arg1qword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } + else if (GV.OperandSize == 32) { + GV.MemDecoration = Arg1dword; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } + else { + GV.MemDecoration = Arg1word; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } + } + else { + FailDecode(pMyDisasm); + } +} + +/* ======================================= + * 58h + * ======================================= */ +void __bea_callspec__ pop_eax(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 59h + * ======================================= */ +void __bea_callspec__ pop_ecx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[1+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[1+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[1+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[1+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5ah + * ======================================= */ +void __bea_callspec__ pop_edx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[2+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[2+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[2+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[2+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5bh + * ======================================= */ +void __bea_callspec__ pop_ebx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[3+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[3+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[3+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[3+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5ch + * ======================================= */ +void __bea_callspec__ pop_esp(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[4+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[4+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[4+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[4+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5dh + * ======================================= */ +void __bea_callspec__ pop_ebp(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[5+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[5+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[5+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[5+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5eh + * ======================================= */ +void __bea_callspec__ pop_esi(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[6+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[6+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[6+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[6+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 5fh + * ======================================= */ +void __bea_callspec__ pop_edi(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[7+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[7+0+8]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7+8]; + } + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[7+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[7+0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ pop_es(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[0]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[0]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ pop_ss(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[2]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[2]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ pop_ds(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[3]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[3]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ pop_fs(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[4]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[4]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ pop_gs(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pop "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[5]); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[5]; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * 9dh + * ======================================= */ +void __bea_callspec__ popfd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + + if (GV.Architecture == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popfq "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popfd "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popf "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } +} + +/* ======================================= + * 9dh + * ======================================= */ +void __bea_callspec__ popad_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popad "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "popa "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } +} + + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_es(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_ss(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[2]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[2]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_ds(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[3]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[3]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_fs(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[4]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[4]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_gs(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[5]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[5]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ push_cs(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument1.ArgMnemonic, RegistersSEG[1]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[1]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + GV.EIP_++; + } +} + + + +/* ======================================= + * 50h + * ======================================= */ +void __bea_callspec__ push_eax(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[0]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 51h + * ======================================= */ +void __bea_callspec__ push_ecx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[1]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 52h + * ======================================= */ +void __bea_callspec__ push_edx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[2]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 53h + * ======================================= */ +void __bea_callspec__ push_ebx(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[3]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 54h + * ======================================= */ +void __bea_callspec__ push_esp(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[4]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 55h + * ======================================= */ +void __bea_callspec__ push_ebp(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[5]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 56h + * ======================================= */ +void __bea_callspec__ push_esi(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[6]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + +/* ======================================= + * 57h + * ======================================= */ +void __bea_callspec__ push_edi(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (GV.REX.B_ == 0) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+0+8]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7+8]; + } + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy((char*) &(*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7+0]); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REGS[7]; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgSize = 16; + } + } + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; +} + + +/* ======================================= + * 68h + * ======================================= */ +void __bea_callspec__ push_Iv(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (GV.Architecture == 64) { + if (!Security(5, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((UInt32*)(UIntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 32; + (*pMyDisasm).Instruction.Immediat = *((UInt32*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_ += 5; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } + else if (GV.OperandSize == 32) { + if (!Security(5, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((UInt32*)(UIntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 32; + (*pMyDisasm).Instruction.Immediat = *((UInt32*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_ += 5; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } + else { + if (!Security(3, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 16; + (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_ += 3; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + } +} + +/* ======================================= + * 6ah + * ======================================= */ +void __bea_callspec__ push_Ib(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "push "); + #endif + if (!Security(1, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument2.ArgMnemonic,"%.8X",(Int64)*((Int8*)(IntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 8; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_ += 2; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Argument2.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument2.ArgSize = 8; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = REGISTER_TYPE+GENERAL_REG+REG4; + +} + + +/* ======================================= + * 9ch + * ======================================= */ +void __bea_callspec__ pushfd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + + if (GV.Architecture == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushfq "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushfd "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushf "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + FillFlags(pMyDisasm, 78); + } +} + + +/* ======================================= + * 60h + * ======================================= */ +void __bea_callspec__ pushad_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + + if (GV.Architecture == 64) { + FailDecode(pMyDisasm); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pushad "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pusha "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2+REG3+REG4+REG5+REG6+REG7; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; + } +} + +/* ======================================= + * 0c2h + * ======================================= */ +void __bea_callspec__ retn_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = RetType; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retn "); + #endif + if (!Security(3, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 16; + (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_+=3; + (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; +} + +/* ======================================= + * 0c3h + * ======================================= */ +void __bea_callspec__ ret_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = RetType; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ret "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ retf_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = RetType; + if (GV.SYNTAX_ == ATSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lret "); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); + #endif + } + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG4; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ retf_Iw(PDISASM pMyDisasm) +{ + int i = 0; + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER; + (*pMyDisasm).Instruction.BranchType = RetType; + if (GV.SYNTAX_ == ATSyntax) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "lret "); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "retf "); + #endif + } + if (!Security(3, pMyDisasm)) return; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) &(*pMyDisasm).Argument1.ArgMnemonic+i,"%.4X",(Int64)*((UInt16*)(UIntPtr) (GV.EIP_+1))); + #endif + GV.ImmediatSize = 16; + (*pMyDisasm).Instruction.Immediat = *((UInt16*)(UIntPtr) (GV.EIP_+1)); + GV.EIP_+=3; + (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG4; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ rdtsc_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdtsc "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 32; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ rdmsr_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdmsr "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 32; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ rdpmc_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rdpmc "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG2; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument2.ArgSize = 32; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ rsm_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rsm "); + #endif + GV.EIP_++; + FillFlags(pMyDisasm, 89); +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ sysenter_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysenter "); + #endif + GV.EIP_++; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ sysexit_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysexit "); + #endif + GV.EIP_++; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ sahf_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sahf "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 8; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ salc_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = UNDOCUMENTED_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "salc "); + #endif + GV.EIP_++; +} + + +/* ======================================= + * 0ach + * ======================================= */ +void __bea_callspec__ scasb_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasb "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument2.ArgSize = 8; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 94); +} + +/* ======================================= + * 0adh + * ======================================= */ +void __bea_callspec__ scas_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasq "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 94); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasd "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 94); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "scasw "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument1.AccessMode = READ; + (*pMyDisasm).Argument2.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument2.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 94); + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ stc_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stc "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 1; + FillFlags(pMyDisasm, 98); +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ sti_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sti "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 1; + FillFlags(pMyDisasm, 100); +} + + +/* ======================================= + * 0aah + * ======================================= */ +void __bea_callspec__ stos_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosb "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 8; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 101); +} + +/* ======================================= + * 0abh + * ======================================= */ +void __bea_callspec__ stosw_(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.RepnePrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepnePrefix = InUsePrefix; + } + if ((*pMyDisasm).Prefix.RepPrefix == SuperfluousPrefix) { + (*pMyDisasm).Prefix.RepPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+STRING_INSTRUCTION; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosq "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 64; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 101); + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosd "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 32; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 101); + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "stosw "); + #endif + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgSize = 16; + (*pMyDisasm).Argument1.ArgType = MEMORY_TYPE; + (*pMyDisasm).Argument1.Memory.BaseRegister = REG7; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG7; + GV.EIP_++; + FillFlags(pMyDisasm, 101); + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ syscall_(PDISASM pMyDisasm) +{ + if (GV.Architecture == 64) { + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION+CONTROL_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "syscall "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG1+REG11; + (*pMyDisasm).Argument1.ArgSize = 64; + } + else { + FailDecode(pMyDisasm); + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ sysret_(PDISASM pMyDisasm) +{ + if (GV.Architecture == 64) { + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sysret "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1+REG11; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else { + FailDecode(pMyDisasm); + } +} + + + +/* ======================================= + * 18h + * ======================================= */ +void __bea_callspec__ sbb_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 19h + * ======================================= */ +void __bea_callspec__ sbb_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 1ah + * ======================================= */ +void __bea_callspec__ sbb_GbEb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + GbEb(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 1bh + * ======================================= */ +void __bea_callspec__ sbb_GvEv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + GvEv(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 1ch + * ======================================= */ +void __bea_callspec__ sbb_ALIb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + ALIb(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 1dh + * ======================================= */ +void __bea_callspec__ sbb_eAX_Iv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sbb "); + #endif + eAX_Iv(pMyDisasm); + FillFlags(pMyDisasm,93); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ seto_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "seto "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f91h + * ======================================= */ +void __bea_callspec__ setno_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setno "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setb "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setnb_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnb "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ sete_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sete "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setne_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setne "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setbe_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setbe "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setnbe_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnbe "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ sets_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sets "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setns_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setns "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setp_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setp "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setnp_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnp "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setge_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnl "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setnge_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setl "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setle_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setle "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + +/* ======================================= + * 0f90h + * ======================================= */ +void __bea_callspec__ setnle_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "setnle "); + #endif + GV.MemDecoration = Arg1byte; + GV.OperandSize = 8; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize = 32; + GV.EIP_+= GV.DECALAGE_EIP+2; + FillFlags(pMyDisasm,95); +} + + +/* ======================================= + * 0fa4h + * ======================================= */ +void __bea_callspec__ shld_EvGvIb(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shld "); + #endif + GV.ImmediatSize = 8; + EvGv(pMyDisasm); + GV.EIP_+= 1; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.8X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument3.ArgSize = 8; + + FillFlags(pMyDisasm, 97); +} + + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ shld_EvGvCL(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shld "); + #endif + EvGv(pMyDisasm); + GV.third_arg = 2; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument3.ArgMnemonic, Registers8Bits[1]); + #endif + (*pMyDisasm).Argument3.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument3.ArgSize = 8; + FillFlags(pMyDisasm, 97); +} + +/* ======================================= + * 0fach + * ======================================= */ +void __bea_callspec__ shrd_EvGvIb(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shrd "); + #endif + GV.ImmediatSize = 8; + EvGv(pMyDisasm); + GV.EIP_+= 1; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.8X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument3.ArgSize = 8; + + FillFlags(pMyDisasm, 97); +} + + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ shrd_EvGvCL(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+SHIFT_ROTATE; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shrd "); + #endif + EvGv(pMyDisasm); + GV.third_arg = 2; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument3.ArgMnemonic, Registers8Bits[1]); + #endif + (*pMyDisasm).Argument3.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + (*pMyDisasm).Argument3.ArgSize = 8; + FillFlags(pMyDisasm, 97); +} + + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ std_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+FLAG_CONTROL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "std "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+SPECIAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 1; + FillFlags(pMyDisasm, 99); +} + + +/* ======================================= + * 28h + * ======================================= */ +void __bea_callspec__ sub_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 29h + * ======================================= */ +void __bea_callspec__ sub_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 2ah + * ======================================= */ +void __bea_callspec__ sub_GbEb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + GbEb(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 2bh + * ======================================= */ +void __bea_callspec__ sub_GvEv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + GvEv(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 2ch + * ======================================= */ +void __bea_callspec__ sub_ALIb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + ALIb(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 2dh + * ======================================= */ +void __bea_callspec__ sub_eAX_Iv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "sub "); + #endif + eAX_Iv(pMyDisasm); + FillFlags(pMyDisasm,103); +} + +/* ======================================= + * 84h + * ======================================= */ +void __bea_callspec__ test_EbGb(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + EbGb(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * 85h + * ======================================= */ +void __bea_callspec__ test_EvGv(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + EvGv(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * 86h + * ======================================= */ +void __bea_callspec__ test_GbEb(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GbEb(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * 87h + * ======================================= */ +void __bea_callspec__ test_GvEv(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + GvEv(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * 88h + * ======================================= */ +void __bea_callspec__ test_ALIb(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + ALIb(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * 89h + * ======================================= */ +void __bea_callspec__ test_eAX_Iv(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+BIT_UInt8; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "test "); + #endif + (*pMyDisasm).Argument1.AccessMode = READ; + eAX_Iv(pMyDisasm); + FillFlags(pMyDisasm,104); +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ ud2_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ud2 "); + #endif + GV.EIP_++; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ vmread_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmread "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + } + EvGv(pMyDisasm); + if (GV.Architecture == 64) { + GV.OperandSize = 32; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ vmwrite_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = VM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vmwrite "); + #endif + if (GV.Architecture == 64) { + GV.OperandSize = 64; + } + GvEv(pMyDisasm); + if (GV.Architecture == 64) { + GV.OperandSize = 32; + } +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ wbinvd_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wbinvd "); + #endif + GV.EIP_++; +} + +/* ======================================= + * 9Bh + * ======================================= */ +void __bea_callspec__ wait_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = FPU_INSTRUCTION+FPUCONTROL; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wait "); + #endif + GV.EIP_++; +} + +/* ======================================= + * + * ======================================= */ +void __bea_callspec__ wrmsr_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = SYSTEM_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "wrmsr "); + #endif + GV.EIP_++; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG0+REG1+REG2; + (*pMyDisasm).Argument2.ArgSize = 32; +} + + +/* ======================================= + * 0fc0h + * ======================================= */ +void __bea_callspec__ xadd_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xadd "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,110); +} + +/* ======================================= + * 0fc1h + * ======================================= */ +void __bea_callspec__ xadd_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xadd "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,110); +} + +/* ======================================= + * 91h + * ======================================= */ +void __bea_callspec__ xchg_ecx(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG1; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[1]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[1]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[1]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 92h + * ======================================= */ +void __bea_callspec__ xchg_edx(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG2; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[2]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[2]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[2]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 93h + * ======================================= */ +void __bea_callspec__ xchg_ebx(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 94h + * ======================================= */ +void __bea_callspec__ xchg_esp(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG4; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[4]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[4]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[4]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 95h + * ======================================= */ +void __bea_callspec__ xchg_ebp(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG5; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[5]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[5]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[5]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 96h + * ======================================= */ +void __bea_callspec__ xchg_esi(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG6; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[6]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[6]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[6]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + + +/* ======================================= + * 97h + * ======================================= */ +void __bea_callspec__ xchg_edi(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG7; + if (GV.OperandSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[7]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 64; + (*pMyDisasm).Argument2.ArgSize = 64; + } + else if (GV.OperandSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[7]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 32; + (*pMyDisasm).Argument2.ArgSize = 32; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]); + #endif + if (GV.REX.B_ == 1) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7+8]); + #endif + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[7]); + #endif + } + GV.EIP_++; + (*pMyDisasm).Argument2.AccessMode = WRITE; + (*pMyDisasm).Argument1.ArgSize = 16; + (*pMyDisasm).Argument2.ArgSize = 16; + } +} + +/* ======================================= + * 0d7h + * ======================================= */ +void __bea_callspec__ xlat_(PDISASM pMyDisasm) +{ + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+MISCELLANEOUS_INSTRUCTION; + if (GV.AddressSize == 64) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; + (*pMyDisasm).Argument2.ArgSize = 64; + GV.EIP_++; + } + else if (GV.AddressSize == 32) { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; + (*pMyDisasm).Argument2.ArgSize = 32; + GV.EIP_++; + } + else { + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xlatb "); + #endif + (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0; + (*pMyDisasm).Argument1.ArgSize = 8; + (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3; + (*pMyDisasm).Argument2.ArgSize = 16; + GV.EIP_++; + } +} + + +/* ======================================= + * 30h + * ======================================= */ +void __bea_callspec__ xor_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,113); +} + +/* ======================================= + * 31h + * ======================================= */ +void __bea_callspec__ xor_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,113); +} + +/* ======================================= + * 32h + * ======================================= */ +void __bea_callspec__ xor_GbEb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + GbEb(pMyDisasm); + FillFlags(pMyDisasm,113); +} + +/* ======================================= + * 33h + * ======================================= */ +void __bea_callspec__ xor_GvEv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + GvEv(pMyDisasm); + FillFlags(pMyDisasm,113); +} + +/* ======================================= + * 34h + * ======================================= */ +void __bea_callspec__ xor_ALIb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + ALIb(pMyDisasm); + FillFlags(pMyDisasm,113); +} + +/* ======================================= + * 35h + * ======================================= */ +void __bea_callspec__ xor_eAX_Iv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+LOGICAL_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xor "); + #endif + eAX_Iv(pMyDisasm); + FillFlags(pMyDisasm,113); +} + + +/* ======================================= + * 86h + * ======================================= */ +void __bea_callspec__ xchg_EbGb(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + EbGb(pMyDisasm); + FillFlags(pMyDisasm,113); + (*pMyDisasm).Argument2.AccessMode = WRITE; +} + +/* ======================================= + * 87h + * ======================================= */ +void __bea_callspec__ xchg_EvGv(PDISASM pMyDisasm) +{ + if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) { + (*pMyDisasm).Prefix.LockPrefix = InUsePrefix; + } + (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg "); + #endif + EvGv(pMyDisasm); + FillFlags(pMyDisasm,113); + (*pMyDisasm).Argument2.AccessMode = WRITE; +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c index 4c79210571d35aee00b6a1d29ef878e4f2b2eefe..b609a677427968840969ef4d6ff63da73feeecee 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c @@ -46,53 +46,50 @@ void __bea_callspec__ implicit_xmm0(ARGTYPE *arg, PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ addps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + { + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + } + #endif /* ========= 0xf2 */ - if (GV.PrefRepne == 1) { + if (GV.PrefRepne == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3)) { + assert(!GV.VEX.has_vex); (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; - GV.MemDecoration = Arg2qword; + GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "addsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addsd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========= 0xf3 */ - else if (GV.PrefRepe == 1) { + else if (GV.PrefRepe == 1|| (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { + + assert(!GV.VEX.has_vex); (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2dword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "addss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix|| (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "addpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { - GV.MemDecoration = Arg2dqword; - (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; - #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "addps "); - #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + GV.MemDecoration = Arg2fword; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addps "); + #endif } + Vx_opt_GxEx_vexlen(pMyDisasm); } /* ==================================================================== @@ -182,7 +179,7 @@ void __bea_callspec__ andps_VW(PDISASM pMyDisasm) GV.SSE_ = 0; } else { - GV.MemDecoration = Arg2dqword; + GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+LOGICAL_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "andps "); @@ -237,27 +234,55 @@ void __bea_callspec__ blendpd_(PDISASM pMyDisasm) void __bea_callspec__ blendps_(PDISASM pMyDisasm) { /* ========== 0x66 */ - if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE41_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "blendps "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vblendps "); + else + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "blendps "); #endif - GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + if(GV.VEX.has_vex) + { + GV.ImmediatSize = 8; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + VxGxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; + GV.EIP_++; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + GV.forth_arg = 1; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + + /* forth arg */ + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument4.ArgMnemonic, "%x",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument4.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument4.ArgSize = 8; + } + + else + { + GV.ImmediatSize = 8; + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.EIP_++; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%x",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + #endif + (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; + (*pMyDisasm).Argument3.ArgSize = 8; + } } else { @@ -322,6 +347,10 @@ void __bea_callspec__ blendvps_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ cmpps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ GV.ImmediatSize = 8; @@ -330,11 +359,8 @@ void __bea_callspec__ cmpps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cmpsd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0xf3 */ else if (GV.PrefRepe == 1) { @@ -342,11 +368,8 @@ void __bea_callspec__ cmpps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cmpss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { @@ -355,33 +378,28 @@ void __bea_callspec__ cmpps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmppd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cmppd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cmpps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cmpps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } - (*pMyDisasm).Argument1.AccessMode = READ; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; - + Vx_opt_GxEx_vexlen(pMyDisasm); + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + if(GV.VEX.has_vex) + { + GV.forth_arg = 1; + L_imm(&pMyDisasm->Argument4,pMyDisasm); + } + else + { + L_imm(&pMyDisasm->Argument3,pMyDisasm); + } } @@ -584,40 +602,50 @@ void __bea_callspec__ cvtps2pd_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ cvtdq2ps_(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + { + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + } + #endif + /* ========== 0xf3 */ - if (GV.PrefRepe == 1) { + if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CONVERSION_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cvttps2dq "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cvttps2dq "); #endif GV.SSE_ = 1; GxEx(pMyDisasm); GV.SSE_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CONVERSION_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cvtps2dq "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cvtps2dq "); #endif GV.SSE_ = 1; GxEx(pMyDisasm); GV.SSE_ = 0; } else { - GV.MemDecoration = Arg2dqword; + GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CONVERSION_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "cvtdq2ps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "cvtdq2ps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; } } @@ -630,14 +658,12 @@ void __bea_callspec__ cvtpi2ps_(PDISASM pMyDisasm) /* ========= VEX 0xf2 */ if (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3) { + (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CONVERSION_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vcvtsi2sd "); #endif - /* MOD_RM will clear if it's not actually memory */ - GV.MemDecoration=Arg3fword; - if(GV.VEX.W==0 || GV.Architecture==32) { @@ -653,6 +679,7 @@ AVX Convert one signed quadword integer from r/m64 to one double-precision floating-point value in xmm1 *************************************************************/ + GV.MemDecoration=Arg3dword; GV.SSE_ = 1; V_reg(&(*pMyDisasm).Argument2, pMyDisasm); Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); @@ -662,11 +689,12 @@ value in xmm1 } else if(GV.VEX.W==1) { + GV.MemDecoration=Arg3qword; GV.SSE_ = 1; V_reg(&(*pMyDisasm).Argument2, pMyDisasm); Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); GV.SSE_ = 0; - GV.OperandSize=GV.OriginalOperandSize; + GV.OperandSize=64; MOD_RM(&(*pMyDisasm).Argument3, pMyDisasm); /************************************************************ VEX.NDS.LIG.F2.0F.W1 2A /r @@ -966,7 +994,7 @@ void __bea_callspec__ cvtpd2dq_(PDISASM pMyDisasm) /* ========== 0xf3 */ else if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; - GV.MemDecoration = Arg2qword; + GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+CONVERSION_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY if(GV.VEX.has_vex) @@ -976,20 +1004,21 @@ void __bea_callspec__ cvtpd2dq_(PDISASM pMyDisasm) #endif if(GV.VEX.has_vex && GV.VEX.length==1) { - GV.AVX_ = 1; - GV.MemDecoration=Arg2yword; - MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); - GV.AVX_ = 0; + GV.MemDecoration=Arg2fword; GV.SSE_ = 1; - Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); GV.SSE_ = 0; + + GV.AVX_ = 1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.AVX_ = 0; GV.EIP_ += GV.DECALAGE_EIP+2; } else { GV.SSE_ = 1; - GV.MemDecoration=Arg2oword; + GV.MemDecoration=Arg2fword; GxEx(pMyDisasm); GV.SSE_ = 0; } @@ -1429,48 +1458,70 @@ void __bea_callspec__ maxps_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ minps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ - if (GV.PrefRepne == 1) { + if (GV.PrefRepne == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3)) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "minsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "minsd "); #endif GV.SSE_ = 1; GxEx(pMyDisasm); GV.SSE_ = 0; } /* ========= 0xf3 */ - else if (GV.PrefRepe == 1) { + else if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "minss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "minss "); #endif GV.SSE_ = 1; GxEx(pMyDisasm); GV.SSE_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "minpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "minpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + + if(GV.VEX.has_vex) + { + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + GV.MemDecoration=Arg3fword; + V_reg(&(*pMyDisasm).Argument2, pMyDisasm); + MOD_RM(&(*pMyDisasm).Argument3, pMyDisasm); + GV.third_arg=1; + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.AVX_ = 0; + GV.SSE_ = 0; + GV.EIP_ += GV.DECALAGE_EIP+2; + + } + else + { + GV.SSE_ = 1; + GxEx(pMyDisasm); + GV.SSE_ = 0; + } } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "minps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "minps "); #endif GV.SSE_ = 1; GxEx(pMyDisasm); @@ -1483,8 +1534,14 @@ void __bea_callspec__ minps_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movaps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif + /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + assert(!GV.VEX.has_vex); /* FIXME */ GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; @@ -1500,11 +1557,13 @@ void __bea_callspec__ movaps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movaps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movaps "); #endif - GV.SSE_ = 1; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } } @@ -1513,8 +1572,13 @@ void __bea_callspec__ movaps_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movaps_WV(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + assert(!GV.VEX.has_vex); /* FIXME */ GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg1dqword; @@ -1527,14 +1591,16 @@ void __bea_callspec__ movaps_WV(PDISASM pMyDisasm) GV.SSE_ = 0; } else { - GV.MemDecoration = Arg1dqword; + GV.MemDecoration = Arg1fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movaps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movaps "); #endif - GV.SSE_ = 1; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; ExGx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } } @@ -1544,31 +1610,28 @@ void __bea_callspec__ movaps_WV(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movhps_VM(PDISASM pMyDisasm) { - + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf3 */ - if (GV.PrefRepe == 1) { + if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2qword; (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movshdup "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movshdup "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movhpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movhpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2fword; @@ -1576,18 +1639,23 @@ void __bea_callspec__ movhps_VM(PDISASM pMyDisasm) GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; if (GV.MOD_== 0x3) { #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movlhps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movlhps "); #endif } else { #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movhps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movhps "); #endif } - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + VxGxEx(pMyDisasm); + else + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; } @@ -1628,42 +1696,62 @@ void __bea_callspec__ movhps_MV(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movlps_VM(PDISASM pMyDisasm) { + + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ - if (GV.PrefRepne == 1) { + if (GV.PrefRepne == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3)) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movddup "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movddup "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + VxGxEx(pMyDisasm); + else + GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } /* ========= 0xf3 */ - else if (GV.PrefRepe == 1) { + else if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2qword; (*pMyDisasm).Instruction.Category = SSE3_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movsldup "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movsldup "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + VxGxEx(pMyDisasm); + else + GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movlpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movlpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + VxGxEx(pMyDisasm); + else + GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } else { GV.MemDecoration = Arg2fword; @@ -1672,17 +1760,22 @@ void __bea_callspec__ movlps_VM(PDISASM pMyDisasm) (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+DATA_TRANSFER; if (GV.MOD_== 0x3) { #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movhlps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movhlps "); #endif } else { #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movlps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movlps "); #endif } - GV.SSE_ = 1; - GxEx(pMyDisasm); + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + VxGxEx(pMyDisasm); + else + GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } } @@ -1880,53 +1973,51 @@ void __bea_callspec__ movntq_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movups_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif + /* ========= 0xf2 */ - if (GV.PrefRepne == 1) { + if (GV.PrefRepne == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3)) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movsd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========= 0xf3 */ - else if (GV.PrefRepe == 1) { + else if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ - else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { + else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movupd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movupd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movups "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movups "); #endif - GV.SSE_ = 1; + } + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; GxEx(pMyDisasm); GV.SSE_ = 0; - } + GV.AVX_ = 0; } @@ -1936,17 +2027,18 @@ void __bea_callspec__ movups_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ movups_WV(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ if (GV.PrefRepne == 1) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg1dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movsd "); #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; } /* ========= 0xf3 */ else if (GV.PrefRepe == 1) { @@ -1954,11 +2046,8 @@ void __bea_callspec__ movups_WV(PDISASM pMyDisasm) GV.MemDecoration = Arg1fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movss "); #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { @@ -1967,22 +2056,21 @@ void __bea_callspec__ movups_WV(PDISASM pMyDisasm) GV.MemDecoration = Arg1dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movupd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movupd "); #endif - GV.SSE_ = 1; - ExGx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg1dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movups "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movups "); #endif - GV.SSE_ = 1; + } + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; ExGx(pMyDisasm); GV.SSE_ = 0; - } + GV.AVX_ = 0; } @@ -2028,6 +2116,10 @@ void __bea_callspec__ mpsadbw_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ mulps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ if (GV.PrefRepne == 1) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; @@ -2036,11 +2128,8 @@ void __bea_callspec__ mulps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mulsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "mulsd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0xf3 */ else if (GV.PrefRepe == 1) { @@ -2048,11 +2137,8 @@ void __bea_callspec__ mulps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mulss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "mulss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { @@ -2061,22 +2147,27 @@ void __bea_callspec__ mulps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mulpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "mulpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "mulps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "mulps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; + if(GV.VEX.has_vex) + { + GV.MemDecoration+=100; + VxGxEx(pMyDisasm); + } + else + GxEx(pMyDisasm); + GV.SSE_ = 0; + GV.AVX_ = 0; } @@ -2179,11 +2270,11 @@ void __bea_callspec__ pavgb_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pavgb "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pavgb "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { GV.MemDecoration = Arg2qword; @@ -2209,11 +2300,11 @@ void __bea_callspec__ pavgw_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pavgw "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pavgw "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { GV.MemDecoration = Arg2qword; @@ -2239,21 +2330,21 @@ void __bea_callspec__ palignr_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "palignr "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "palignr "); #endif GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + Vx_opt_GxEx_vexlen(pMyDisasm); + GV.third_arg=1; + if(GV.VEX.has_vex) + { + L_imm(&(*pMyDisasm).Argument4,pMyDisasm); + GV.forth_arg=1; + } + else + L_imm(&(*pMyDisasm).Argument3,pMyDisasm); + } else { @@ -2265,15 +2356,9 @@ void __bea_callspec__ palignr_(PDISASM pMyDisasm) GV.MMX_ = 1; GxEx(pMyDisasm); GV.MMX_ = 0; - GV.EIP_++; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3,pMyDisasm); } } @@ -2559,6 +2644,9 @@ void __bea_callspec__ pcmpgtq_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ pextrb_(PDISASM pMyDisasm) { + UInt8 oldRexW=GV.REX.W_; + int oldOperandSize=GV.OperandSize; + /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { @@ -2568,12 +2656,18 @@ void __bea_callspec__ pextrb_(PDISASM pMyDisasm) if(GV.VEX.has_vex && GV.VEX.W!=0) FailDecode(pMyDisasm); + GV.REX.W_=0; /* REX.w ignored for pextrb */ + #ifndef BEA_LIGHT_DISASSEMBLY if(GV.VEX.has_vex) (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vpextrb "); else (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pextrb "); #endif + if(GV.VEX.has_vex) + GV.OperandSize=64; + else + GV.OperandSize=32; GV.MOD_= ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 6) & 0x3; if (GV.MOD_== 0x3) { GV.MemDecoration = Arg1dword; @@ -2583,6 +2677,7 @@ void __bea_callspec__ pextrb_(PDISASM pMyDisasm) } GV.ImmediatSize = 8; MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize=oldOperandSize; GV.SSE_ = 1; Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); GV.SSE_ = 0; @@ -2597,6 +2692,7 @@ void __bea_callspec__ pextrb_(PDISASM pMyDisasm) (*pMyDisasm).Argument3.ArgSize = 8; + GV.REX.W_=oldRexW; /* restore REX.w if it was ignored */ } else { FailDecode(pMyDisasm); @@ -2610,6 +2706,7 @@ void __bea_callspec__ pextrb_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ pextrd_(PDISASM pMyDisasm) { + int oldOperandSize=GV.OperandSize; /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { GV.OperandSize = GV.OriginalOperandSize; @@ -2636,7 +2733,15 @@ void __bea_callspec__ pextrd_(PDISASM pMyDisasm) GV.MemDecoration = Arg1dword; } GV.ImmediatSize = 8; + /* pextrq should always be size=64. pextrd needs toc hange based on the v- or not v-variant */ + if (!(GV.REX.W_ == 0x1 || GV.VEX.W==0x1)) { + if(GV.VEX.has_vex) + GV.OperandSize=64; + else + GV.OperandSize=32; + } MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.OperandSize=oldOperandSize; GV.SSE_ = 1; Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); GV.SSE_ = 0; @@ -2645,7 +2750,7 @@ void __bea_callspec__ pextrd_(PDISASM pMyDisasm) GV.third_arg = 1; (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%x",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); #endif (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; (*pMyDisasm).Argument3.ArgSize = 8; @@ -2663,6 +2768,7 @@ void __bea_callspec__ pextrd_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ pextrw_(PDISASM pMyDisasm) { + int oldOperandSize=GV.OperandSize; /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { @@ -2680,16 +2786,16 @@ void __bea_callspec__ pextrw_(PDISASM pMyDisasm) GV.SSE_ = 1; MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); GV.SSE_ = 0; + if(GV.VEX.has_vex) + GV.OperandSize=64; + else + GV.OperandSize=32; Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+3; + GV.OperandSize=oldOperandSize; + GV.EIP_ += GV.DECALAGE_EIP+2; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); } @@ -2704,15 +2810,10 @@ void __bea_callspec__ pextrw_(PDISASM pMyDisasm) MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); GV.MMX_ = 0; Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); - GV.EIP_ += GV.DECALAGE_EIP+3; + GV.EIP_ += GV.DECALAGE_EIP+2; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); } @@ -2746,15 +2847,10 @@ void __bea_callspec__ pextrw2_(PDISASM pMyDisasm) GV.SSE_ = 1; Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); GV.SSE_ = 0; - GV.EIP_ += GV.DECALAGE_EIP+3; + GV.EIP_ += GV.DECALAGE_EIP+2; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); } @@ -3078,15 +3174,10 @@ void __bea_callspec__ pinsrw_(PDISASM pMyDisasm) GV.SSE_ = 1; Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); GV.SSE_ = 0; - GV.EIP_ += GV.DECALAGE_EIP+3; + GV.EIP_ += GV.DECALAGE_EIP+2; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); } @@ -3101,15 +3192,10 @@ void __bea_callspec__ pinsrw_(PDISASM pMyDisasm) GV.MMX_ = 1; Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); GV.MMX_ = 0; - GV.EIP_ += GV.DECALAGE_EIP+3; + GV.EIP_ += GV.DECALAGE_EIP+2; if (!Security(0, pMyDisasm)) return; GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + L_imm(&(*pMyDisasm).Argument3, pMyDisasm); } @@ -3976,11 +4062,11 @@ void __bea_callspec__ pshufb_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSSE3_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pshufb "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pshufb "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { GV.MemDecoration = Arg2qword; @@ -4006,21 +4092,12 @@ void __bea_callspec__ pshufw_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pshufhw "); #endif GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + Vx_opt_GxEx_vexlen_imm(pMyDisasm); } /* ========= 0xf2 */ @@ -4028,21 +4105,12 @@ void __bea_callspec__ pshufw_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2dqword; #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pshuflw "); #endif GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + Vx_opt_GxEx_vexlen_imm(pMyDisasm); } @@ -4052,21 +4120,12 @@ void __bea_callspec__ pshufw_(PDISASM pMyDisasm) (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pshufd "); #endif GV.ImmediatSize = 8; - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + Vx_opt_GxEx_vexlen_imm(pMyDisasm); } else { @@ -4083,7 +4142,7 @@ void __bea_callspec__ pshufw_(PDISASM pMyDisasm) GV.third_arg = 1; (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); + (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%x",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); #endif (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; (*pMyDisasm).Argument3.ArgSize = 8; @@ -4251,11 +4310,11 @@ void __bea_callspec__ punpcklqdq_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SIMD128bits; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpcklqdq "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpcklqdq "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { FailDecode(pMyDisasm); @@ -4275,11 +4334,11 @@ void __bea_callspec__ punpckhqdq_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SIMD128bits; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "punpckhqdq "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "punpckhqdq "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { FailDecode(pMyDisasm); @@ -4299,11 +4358,11 @@ void __bea_callspec__ rcpps_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcpss "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "rcpss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { GV.MemDecoration = Arg2dqword; @@ -4311,9 +4370,7 @@ void __bea_callspec__ rcpps_(PDISASM pMyDisasm) #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "rcpps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } } @@ -4502,33 +4559,35 @@ void __bea_callspec__ shufps_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shufpd "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "shufpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "shufps "); + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "shufps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; + Vx_opt_GxEx_vexlen(pMyDisasm); } - (*pMyDisasm).Argument1.AccessMode = READ; - GV.EIP_++; - if (!Security(0, pMyDisasm)) return; - GV.third_arg = 1; - (*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); - #ifndef BEA_LIGHT_DISASSEMBLY - (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); - #endif - (*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; - (*pMyDisasm).Argument3.ArgSize = 8; + (*pMyDisasm).Argument1.AccessMode = READ; + if (!Security(0, pMyDisasm)) return; + GV.third_arg = 1; + if(GV.VEX.has_vex) + { + GV.forth_arg = 1; + L_imm(&pMyDisasm->Argument4,pMyDisasm); + } + else + { + L_imm(&pMyDisasm->Argument3,pMyDisasm); + } } @@ -4592,17 +4651,18 @@ void __bea_callspec__ sqrtps_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ subps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========= 0xf2 */ if (GV.PrefRepne == 1) { (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "subsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "subsd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========= 0xf3 */ else if (GV.PrefRepe == 1) { @@ -4610,11 +4670,8 @@ void __bea_callspec__ subps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "subss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "subss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } /* ========== 0x66 */ else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { @@ -4625,20 +4682,15 @@ void __bea_callspec__ subps_VW(PDISASM pMyDisasm) #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "subpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "subps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "subps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + Vx_opt_GxEx_vexlen(pMyDisasm); } @@ -4647,29 +4699,28 @@ void __bea_callspec__ subps_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ ucomiss_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========== 0x66 */ - if (GV.OperandSize == 16) { + if (pMyDisasm->Prefix.OperandSize == InUsePrefix) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ucomisd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "ucomisd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+COMPARISON_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "ucomiss "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "ucomiss "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + Vx_opt_GxEx_vexlen(pMyDisasm); } @@ -4678,29 +4729,28 @@ void __bea_callspec__ ucomiss_VW(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ unpckhps_(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========== 0x66 */ - if (GV.OperandSize == 16) { + if (pMyDisasm->Prefix.OperandSize == InUsePrefix) { GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "unpckhpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "unpckhpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "unpckhps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "unpckhps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + Vx_opt_GxEx_vexlen(pMyDisasm); } /* ==================================================================== @@ -4708,6 +4758,10 @@ void __bea_callspec__ unpckhps_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ unpcklps_(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { GV.OperandSize = GV.OriginalOperandSize; @@ -4715,22 +4769,17 @@ void __bea_callspec__ unpcklps_(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "unpcklpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "unpcklpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+SHUFFLE_UNPACK; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "unpcklps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "unpcklps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + Vx_opt_GxEx_vexlen(pMyDisasm); } @@ -4739,6 +4788,10 @@ void __bea_callspec__ unpcklps_(PDISASM pMyDisasm) * ==================================================================== */ void __bea_callspec__ xorps_VW(PDISASM pMyDisasm) { + #ifndef BEA_LIGHT_DISASSEMBLY + if(GV.VEX.has_vex) + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); + #endif /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { GV.OperandSize = GV.OriginalOperandSize; @@ -4746,20 +4799,15 @@ void __bea_callspec__ xorps_VW(PDISASM pMyDisasm) GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+LOGICAL_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xorpd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "xorpd "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } else { GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+LOGICAL_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xorps "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "xorps "); #endif - GV.SSE_ = 1; - GxEx(pMyDisasm); - GV.SSE_ = 0; } + Vx_opt_GxEx_vexlen(pMyDisasm); } diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c index 12aed3abaca13de99d3dfbc199068302e8e0adb1..e2cdb8c83d75f33c50fe8fa7bf0335b075535fcb 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c @@ -123,9 +123,17 @@ static void finish_vex(PDISASM pMyDisasm) switch(GV.VEX.implicit_prefixes) { case 0: + break; case 1: /* 0x66 */ + (*pMyDisasm).Prefix.OperandSize = InUsePrefix; + break; case 2: /* 0xf3 */ + (*pMyDisasm).Prefix.RepPrefix= InUsePrefix; + GV.PrefRepe= 1; /* why are these diff? not sure, but seems to be how it should be */ + break; case 3: /* 0xf2 */ + (*pMyDisasm).Prefix.RepnePrefix= InUsePrefix; + GV.PrefRepne = 1; /* why are these diff? not sure, but seems to be how it should be */ break; default: FailDecode(pMyDisasm); @@ -162,7 +170,7 @@ void __bea_callspec__ HandleVex3(PDISASM pMyDisasm) GV.REX.R_=!GV.VEX.notR; GV.VEX.notX=(byte1>>6)&1; /* bit 7 */ GV.REX.X_=!GV.VEX.notX; - GV.VEX.notB=(byte1>>6)&1; /* bit 6 */ + GV.VEX.notB=(byte1>>5)&1; /* bit 6 */ GV.REX.B_=!GV.VEX.notB; GV.VEX.opcode_escape=byte1&0x1f; /* bits 5-0 */ @@ -231,6 +239,10 @@ void __bea_callspec__ HandleVex2(PDISASM pMyDisasm) /* fill in fields from byte1. */ GV.VEX.notR=(byte1>>7)&1; /* bit 7 */ GV.REX.R_=!GV.VEX.notR; + GV.VEX.notX=1; /* not set, so they should default to 1, not 0 */ + GV.REX.X_=!GV.VEX.notX; + GV.VEX.notB=1; + GV.REX.B_=!GV.VEX.notB; GV.VEX.notV=(byte1>>3)&0xf; /* bits 6-3 */ GV.VEX.length=(byte1>>2)&01; /* bit 2 */ @@ -260,26 +272,44 @@ void V_reg(ARGTYPE* arg, PDISASM pMyDisasm) arg->ArgSize=GV.OperandSize; arg->ArgType=REGISTER_TYPE+REGS[reg]; - switch(GV.OperandSize) + if(GV.OperandSize==128 || GV.SSE_) { - case 128: #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy((char*) arg->ArgMnemonic, RegistersSSE[reg]); #endif arg->ArgType+=SSE_REG; - break; - case 256: + } + else if(GV.OperandSize==256 || GV.AVX_) + { #ifndef BEA_LIGHT_DISASSEMBLY (void) strcpy((char*) arg->ArgMnemonic, RegistersAVX[reg]); #endif arg->ArgType+=AVX_REG; - break; - default: + } + else + { FailDecode(pMyDisasm); - break; } } +void L_imm(ARGTYPE* arg, PDISASM pMyDisasm) +{ + + UInt8 imm8; + + if (!Security(1, pMyDisasm)) return; + imm8=*(UInt8*)GV.EIP_; + + arg->ArgSize=8; + arg->ArgType=CONSTANT_TYPE+ABSOLUTE_; + + #ifndef BEA_LIGHT_DISASSEMBLY + (void) CopyFormattedNumber(pMyDisasm, (char*) arg->ArgMnemonic, "%x",(Int64) imm8); + #endif + + GV.EIP_++; +} + /* L_reg -- process an 8-byte immediate into a register for Arg */ void L_reg(ARGTYPE* arg, PDISASM pMyDisasm) { @@ -390,3 +420,184 @@ void vblendvpd /*VxHxWxLx */ (PDISASM pMyDisasm) } } + +/* not really VEX instructions, but handle all 3dnow instructions. */ +void three_dnow_ (PDISASM pMyDisasm) +{ + UInt8 suffix; + + GV.MMX_=1; + GV.MemDecoration=Arg2fword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + GV.MMX_=0; + + + suffix=*(UInt8*)GV.EIP_; + GV.EIP_++; + +#ifndef BEA_LIGHT_DISASSEMBLY + switch(suffix) + { + case 0xbf: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pavgusb "); break; + case 0x9e: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfadd "); break; + case 0x9a: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfsub "); break; + case 0xaa: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfsubr "); break; + case 0xae: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfacc "); break; + case 0x90: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfcmpge "); break; + case 0xa0: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfcmpgt "); break; + case 0xb0: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfcmpeq "); break; + case 0x94: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfmin "); break; + case 0xa4: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfmax "); break; + case 0x0d: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pi2fd "); break; + case 0x1d: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pf2id "); break; + case 0x96: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfrcp "); break; + case 0x97: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfrsqrt "); break; + case 0xb4: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfmul "); break; + case 0xa6: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfrcpit1 "); break; + case 0xa7: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfrsqit1 "); break; + case 0xb6: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pfrcqit2 "); break; + case 0xb7: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pmulhrwa "); break; + case 0xbb: (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "pswapd "); break; + } +#endif + + +} + +void helperf128 (PDISASM pMyDisasm, const char* mnemonic, int third_reg_avx) +{ + if(GV.VEX.has_vex && GV.VEX.length==1 && GV.VEX.implicit_prefixes==1 /* 66 */ && GV.VEX.W==0) + { + (*pMyDisasm).Instruction.Category = AVX_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, mnemonic); + #endif + + GV.MemDecoration=Arg3fword; + GV.AVX_=third_reg_avx; + GV.SSE_=!third_reg_avx; + MOD_RM(&(*pMyDisasm).Argument3, pMyDisasm); + GV.AVX_=0; + GV.SSE_=0; + GV.AVX_=1; + V_reg( &(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.AVX_=0; + GV.EIP_ += GV.DECALAGE_EIP+2; + GV.third_arg=1; + GV.forth_arg=1; + L_imm(&(*pMyDisasm).Argument4,pMyDisasm); + } + else + FailDecode(pMyDisasm); +} + + + +/* vbroadcastss -- shortened for table formatting reasons */ +void vbrdcstss (PDISASM pMyDisasm) +{ + int origOpSize=0; + + (*pMyDisasm).Instruction.Category = AVX_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vbroadcastss "); + #endif + + if(!GV.VEX.has_vex) + FailDecode(pMyDisasm); + + origOpSize=GV.OperandSize; + GV.OperandSize=128+GV.VEX.length*128; + + GV.AVX_=GV.VEX.length; + GV.SSE_=!GV.VEX.length; + + GV.MemDecoration=Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + + GV.AVX_=0; + GV.SSE_=0; + GV.OperandSize=origOpSize; +} + +/* vbroadcastsd -- shortened for table formatting reasons */ +void vbrdcstsd (PDISASM pMyDisasm) +{ +assert(pMyDisasm); +assert(0); +} + +/* 0f 3a 19 */ +void vextraf128 (PDISASM pMyDisasm) +{ + if(GV.VEX.has_vex && GV.VEX.length==1 && GV.VEX.implicit_prefixes==1 && GV.VEX.W==0) + { + (*pMyDisasm).Instruction.Category = AVX_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vextractf128 "); + #endif + GV.MemDecoration=Arg1fword; + GV.SSE_=1; + MOD_RM(&(*pMyDisasm).Argument1, pMyDisasm); + GV.SSE_=0; + GV.AVX_=1; + Reg_Opcode(&(*pMyDisasm).Argument2, pMyDisasm); + GV.AVX_=0; + GV.EIP_ += GV.DECALAGE_EIP+2; + GV.third_arg=1; + L_imm(&(*pMyDisasm).Argument3,pMyDisasm); + } + else + FailDecode(pMyDisasm); +} + + +/* 0f 3a 18 */ +void vinsrtf128 (PDISASM pMyDisasm) +{ + helperf128(pMyDisasm, "vinsertf128 ", 0); +} + +/* 0f 3a 06 */ +void vperm2f128 (PDISASM pMyDisasm) +{ + helperf128(pMyDisasm, "vperm2f128 ", 1); +} + +/* 0f 38 0c */ +void vpermilps1 (PDISASM pMyDisasm) +{ + if(GV.VEX.has_vex && GV.VEX.length==1 && GV.VEX.implicit_prefixes==1 /* 66 */ && GV.VEX.W==0) + { + + (*pMyDisasm).Instruction.Category = AVX_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vpermilps "); + #endif + + GV.MemDecoration=Arg3fword; + GV.AVX_=GV.VEX.length; + GV.SSE_=!GV.VEX.length; + MOD_RM(&(*pMyDisasm).Argument3, pMyDisasm); + V_reg( &(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + GV.third_arg=1; + GV.AVX_=0; + GV.SSE_=0; + } + else + FailDecode(pMyDisasm); +} + +/* 0f 3a 04 */ +void vpermilps2 (PDISASM pMyDisasm) +{ + assert(pMyDisasm); /* avoids warning */ + assert(0); +} diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_prefixes.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_prefixes.c index a55e61c9c2838637403869833a80e26d695f6b56..f22433c4f0f94b06d2e0d6929cf909dbd742ab13 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_prefixes.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_prefixes.c @@ -1,239 +1,239 @@ -/* Copyright 2006-2009, BeatriX - * File coded by BeatriX - * - * This file is part of BeaEngine. - * - * BeaEngine is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * BeaEngine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ - -/* ==================================================================== - * Legacy Prefix F0h-Group 1 - * ==================================================================== */ -void __bea_callspec__ PrefLock(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.LockPrefix = InvalidPrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); - GV.OperandSize = 32; -} - -/* ==================================================================== - * Legacy Prefix F2h-Group 1 - * ==================================================================== */ -void __bea_callspec__ PrefREPNE(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.RepnePrefix = SuperfluousPrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - GV.PrefRepne = 1; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); - GV.PrefRepne = 0; -} - -/* ==================================================================== - * Legacy Prefix F3h-Group 1 - * ==================================================================== */ -void __bea_callspec__ PrefREPE(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.RepPrefix = SuperfluousPrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - GV.PrefRepe = 1; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); - GV.PrefRepe = 0; -} - -/* ==================================================================== - * Legacy Prefix 2Eh-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGCS(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.CSPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Legacy Prefix 3Eh-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGDS(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.DSPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Legacy Prefix 26h-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGES(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.ESPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Legacy Prefix 64h-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGFS(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.FSPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - GV.SEGMENTFS = 1; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Legacy Prefix 65h-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGGS(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.GSPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - - -/* ==================================================================== - * Legacy Prefix 36h-Group 2 - * ==================================================================== */ -void __bea_callspec__ PrefSEGSS(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.SSPrefix = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Legacy Prefix 66h-Group 3 - * ==================================================================== */ -void __bea_callspec__ PrefOpSize(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.OperandSize = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - GV.OriginalOperandSize = GV.OperandSize; /* if GV.OperandSize is used as a mandatory prefix, keep the real operandsize value */ - if (GV.Architecture == 16) { - GV.OperandSize = 32; - } - else { - if (GV.OperandSize != 64) { - GV.OperandSize = 16; - } - } - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); - if (GV.Architecture == 16) { - GV.OperandSize = 16; - } - else { - GV.OperandSize = 32; - } -} - -/* ==================================================================== - * Legacy Prefix 67h-Group 4 - * ==================================================================== */ -void __bea_callspec__ PrefAdSize(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - (*pMyDisasm).Prefix.AddressSize = InUsePrefix; - GV.EIP_++; - (*pMyDisasm).Prefix.Number++; - GV.NB_PREFIX++; - if (GV.Architecture == 16) { - GV.AddressSize = GV.AddressSize << 1; - } - else { - GV.AddressSize = GV.AddressSize >> 1; - } - - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); - (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); - if (GV.Architecture == 16) { - GV.AddressSize = GV.AddressSize >> 1; - } - else { - GV.AddressSize = GV.AddressSize << 1; - } - -} - -/* ==================================================================== - * Escape Prefix 0Fh-two bytes opcodes - * ==================================================================== */ -void __bea_callspec__ Esc_2byte(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - GV.EIP_++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F00; - (void) opcode_map2[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} - -/* ==================================================================== - * Escape Prefix 0F38h-three bytes opcodes - * ==================================================================== */ -void __bea_callspec__ Esc_tableA4(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - GV.EIP_++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3800; - (void) opcode_map3[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} -/* ==================================================================== - * Escape Prefix 0F3Ah-three bytes opcodes - * ==================================================================== */ -void __bea_callspec__ Esc_tableA5(PDISASM pMyDisasm) -{ - if (!Security(0, pMyDisasm)) return; - GV.EIP_++; - (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3A00; - (void) opcode_map4[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); -} +/* Copyright 2006-2009, BeatriX + * File coded by BeatriX + * + * This file is part of BeaEngine. + * + * BeaEngine is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BeaEngine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ + +/* ==================================================================== + * Legacy Prefix F0h-Group 1 + * ==================================================================== */ +void __bea_callspec__ PrefLock(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.LockPrefix = InvalidPrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); + GV.OperandSize = 32; +} + +/* ==================================================================== + * Legacy Prefix F2h-Group 1 + * ==================================================================== */ +void __bea_callspec__ PrefREPNE(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.RepnePrefix = SuperfluousPrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + GV.PrefRepne = 1; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); + GV.PrefRepne = 0; +} + +/* ==================================================================== + * Legacy Prefix F3h-Group 1 + * ==================================================================== */ +void __bea_callspec__ PrefREPE(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.RepPrefix = SuperfluousPrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + GV.PrefRepe = 1; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); + GV.PrefRepe = 0; +} + +/* ==================================================================== + * Legacy Prefix 2Eh-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGCS(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.CSPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Legacy Prefix 3Eh-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGDS(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.DSPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Legacy Prefix 26h-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGES(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.ESPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Legacy Prefix 64h-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGFS(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.FSPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + GV.SEGMENTFS = 1; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Legacy Prefix 65h-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGGS(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.GSPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + + +/* ==================================================================== + * Legacy Prefix 36h-Group 2 + * ==================================================================== */ +void __bea_callspec__ PrefSEGSS(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.SSPrefix = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Legacy Prefix 66h-Group 3 + * ==================================================================== */ +void __bea_callspec__ PrefOpSize(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.OperandSize = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + GV.OriginalOperandSize = GV.OperandSize; /* if GV.OperandSize is used as a mandatory prefix, keep the real operandsize value */ + if (GV.Architecture == 16) { + GV.OperandSize = 32; + } + else { + if (GV.OperandSize != 64) { + GV.OperandSize = 16; + } + } + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); + if (GV.Architecture == 16) { + GV.OperandSize = 16; + } + else { + GV.OperandSize = 32; + } +} + +/* ==================================================================== + * Legacy Prefix 67h-Group 4 + * ==================================================================== */ +void __bea_callspec__ PrefAdSize(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + (*pMyDisasm).Prefix.AddressSize = InUsePrefix; + GV.EIP_++; + (*pMyDisasm).Prefix.Number++; + GV.NB_PREFIX++; + if (GV.Architecture == 16) { + GV.AddressSize = GV.AddressSize << 1; + } + else { + GV.AddressSize = GV.AddressSize >> 1; + } + + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_); + (void) opcode_map1[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); + if (GV.Architecture == 16) { + GV.AddressSize = GV.AddressSize >> 1; + } + else { + GV.AddressSize = GV.AddressSize << 1; + } + +} + +/* ==================================================================== + * Escape Prefix 0Fh-two bytes opcodes + * ==================================================================== */ +void __bea_callspec__ Esc_2byte(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + GV.EIP_++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F00; + (void) opcode_map2[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} + +/* ==================================================================== + * Escape Prefix 0F38h-three bytes opcodes + * ==================================================================== */ +void __bea_callspec__ Esc_tableA4(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + GV.EIP_++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3800; + (void) opcode_map3[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} +/* ==================================================================== + * Escape Prefix 0F3Ah-three bytes opcodes + * ==================================================================== */ +void __bea_callspec__ Esc_tableA5(PDISASM pMyDisasm) +{ + if (!Security(0, pMyDisasm)) return; + GV.EIP_++; + (*pMyDisasm).Instruction.Opcode = *((UInt8*) (UIntPtr)GV.EIP_)+0x0F3A00; + (void) opcode_map4[*((UInt8*) (UIntPtr)GV.EIP_)](pMyDisasm); +} diff --git a/beaengine/beaengineSources/Includes/protos.h b/beaengine/beaengineSources/Includes/protos.h index 357915845fe3f1c3e8a8f284900e68a72641113d..b9a489ebadf51a81a0240570bf5daa7e4a4ffb7b 100644 --- a/beaengine/beaengineSources/Includes/protos.h +++ b/beaengine/beaengineSources/Includes/protos.h @@ -75,6 +75,10 @@ void __bea_callspec__ Ev(PDISASM); void __bea_callspec__ GvEv(PDISASM); void __bea_callspec__ GvEb(PDISASM); void __bea_callspec__ GxEx(PDISASM); +void __bea_callspec__ VxGxEx(PDISASM pMyDisasm); +void __bea_callspec__ Vx_opt_GxEx(PDISASM pMyDisasm); +void __bea_callspec__ Vx_opt_GxEx_vexlen(PDISASM pMyDisasm); +void __bea_callspec__ Vx_opt_GxEx_vexlen_imm(PDISASM pMyDisasm); void __bea_callspec__ GvEw(PDISASM); void __bea_callspec__ GbEb(PDISASM); void __bea_callspec__ ALIb(PDISASM); @@ -712,8 +716,22 @@ void __bea_callspec__ HandleVex3(PDISASM); /* useful helpers */ void V_reg(ARGTYPE* arg, PDISASM pMyDisasm); +void L_imm(ARGTYPE* arg, PDISASM pMyDisasm); /* actual opcodes */ void vblendvpd /*VxHxWxLx */ (PDISASM pMyDisasm); +void three_dnow_ (PDISASM pMyDisasm); + +void vbrdcstss (PDISASM pMyDisasm); +void vbrdcstsd (PDISASM pMyDisasm); +void vextraf128 (PDISASM pMyDisasm); +void vinsrtf128 (PDISASM pMyDisasm); +void vperm2f128 (PDISASM pMyDisasm); +void vpermilps1 (PDISASM pMyDisasm); +void vpermilps2 (PDISASM pMyDisasm); + + + +