|
@@ -5,11 +5,42 @@
|
|
* (C) Cristina Cifuentes, Jeff Ledermann
|
|
* (C) Cristina Cifuentes, Jeff Ledermann
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
+#include <cstring>
|
|
|
|
+
|
|
#include "dcc.h"
|
|
#include "dcc.h"
|
|
#include "scanner.h"
|
|
#include "scanner.h"
|
|
-#include <string.h>
|
|
|
|
|
|
|
|
-#define iZERO (llIcode)0 // For neatness
|
|
|
|
|
|
+static void rm(Int i);
|
|
|
|
+static void modrm(Int i);
|
|
|
|
+static void segrm(Int i);
|
|
|
|
+static void data1(Int i);
|
|
|
|
+static void data2(Int i);
|
|
|
|
+static void regop(Int i);
|
|
|
|
+static void segop(Int i);
|
|
|
|
+static void strop(Int i);
|
|
|
|
+static void escop(Int i);
|
|
|
|
+static void axImp(Int i);
|
|
|
|
+static void alImp(Int i);
|
|
|
|
+static void axSrcIm(Int i);
|
|
|
|
+static void memImp(Int i);
|
|
|
|
+static void memReg0(Int i);
|
|
|
|
+static void memOnly(Int i);
|
|
|
|
+static void dispM(Int i);
|
|
|
|
+static void dispS(Int i);
|
|
|
|
+static void dispN(Int i);
|
|
|
|
+static void dispF(Int i);
|
|
|
|
+static void prefix(Int i);
|
|
|
|
+static void immed(Int i);
|
|
|
|
+static void shift(Int i);
|
|
|
|
+static void arith(Int i);
|
|
|
|
+static void trans(Int i);
|
|
|
|
+static void const1(Int i);
|
|
|
|
+static void const3(Int i);
|
|
|
|
+static void none1(Int i);
|
|
|
|
+static void none2(Int i);
|
|
|
|
+static void checkInt(Int i);
|
|
|
|
+
|
|
|
|
+#define iZERO (llIcode)0 // For neatness
|
|
#define IC llIcode
|
|
#define IC llIcode
|
|
|
|
|
|
static struct {
|
|
static struct {
|
|
@@ -20,120 +51,120 @@ static struct {
|
|
byte df;
|
|
byte df;
|
|
byte uf;
|
|
byte uf;
|
|
} stateTable[] = {
|
|
} stateTable[] = {
|
|
- { modrm, none2, B , iADD , Sf | Zf | Cf, }, /* 00 */
|
|
|
|
- { modrm, none2, 0 , iADD , Sf | Zf | Cf, }, /* 01 */
|
|
|
|
- { modrm, none2, TO_REG | B , iADD , Sf | Zf | Cf, }, /* 02 */
|
|
|
|
- { modrm, none2, TO_REG , iADD , Sf | Zf | Cf, }, /* 03 */
|
|
|
|
- { data1, axImp, B , iADD , Sf | Zf | Cf, }, /* 04 */
|
|
|
|
- { data2, axImp, 0 , iADD , Sf | Zf | Cf, }, /* 05 */
|
|
|
|
- { segop, none2, NO_SRC , iPUSH , 0 , }, /* 06 */
|
|
|
|
- { segop, none2, NO_SRC , iPOP , 0 , }, /* 07 */
|
|
|
|
- { modrm, none2, B , iOR , Sf | Zf | Cf, }, /* 08 */
|
|
|
|
- { modrm, none2, NSP , iOR , Sf | Zf | Cf, }, /* 09 */
|
|
|
|
- { modrm, none2, TO_REG | B , iOR , Sf | Zf | Cf, }, /* 0A */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iOR , Sf | Zf | Cf, }, /* 0B */
|
|
|
|
- { data1, axImp, B , iOR , Sf | Zf | Cf, }, /* 0C */
|
|
|
|
- { data2, axImp, 0 , iOR , Sf | Zf | Cf, }, /* 0D */
|
|
|
|
- { segop, none2, NO_SRC , iPUSH , 0 , }, /* 0E */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 0F */
|
|
|
|
- { modrm, none2, B , iADC , Sf | Zf | Cf, Cf }, /* 10 */
|
|
|
|
- { modrm, none2, NSP , iADC , Sf | Zf | Cf, Cf }, /* 11 */
|
|
|
|
- { modrm, none2, TO_REG | B , iADC , Sf | Zf | Cf, Cf }, /* 12 */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iADC , Sf | Zf | Cf, Cf }, /* 13 */
|
|
|
|
- { data1, axImp, B , iADC , Sf | Zf | Cf, Cf }, /* 14 */
|
|
|
|
- { data2, axImp, 0 , iADC , Sf | Zf | Cf, Cf }, /* 15 */
|
|
|
|
- { segop, none2, NOT_HLL | NO_SRC , iPUSH , 0 , }, /* 16 */
|
|
|
|
- { segop, none2, NOT_HLL | NO_SRC , iPOP , 0 , }, /* 17 */
|
|
|
|
- { modrm, none2, B , iSBB , Sf | Zf | Cf, Cf }, /* 18 */
|
|
|
|
- { modrm, none2, NSP , iSBB , Sf | Zf | Cf, Cf }, /* 19 */
|
|
|
|
- { modrm, none2, TO_REG | B , iSBB , Sf | Zf | Cf, Cf }, /* 1A */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iSBB , Sf | Zf | Cf, Cf }, /* 1B */
|
|
|
|
- { data1, axImp, B , iSBB , Sf | Zf | Cf, Cf }, /* 1C */
|
|
|
|
- { data2, axImp, 0 , iSBB , Sf | Zf | Cf, Cf }, /* 1D */
|
|
|
|
- { segop, none2, NO_SRC , iPUSH , 0 , }, /* 1E */
|
|
|
|
- { segop, none2, NO_SRC , iPOP , 0 , }, /* 1F */
|
|
|
|
- { modrm, none2, B , iAND , Sf | Zf | Cf, }, /* 20 */
|
|
|
|
- { modrm, none2, NSP , iAND , Sf | Zf | Cf, }, /* 21 */
|
|
|
|
- { modrm, none2, TO_REG | B , iAND , Sf | Zf | Cf, }, /* 22 */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iAND , Sf | Zf | Cf, }, /* 23 */
|
|
|
|
- { data1, axImp, B , iAND , Sf | Zf | Cf, }, /* 24 */
|
|
|
|
- { data2, axImp, 0 , iAND , Sf | Zf | Cf, }, /* 25 */
|
|
|
|
- { prefix, none2, 0 , (IC)rES,0 , }, /* 26 */
|
|
|
|
- { none1, axImp, NOT_HLL | B|NO_SRC , iDAA , Sf | Zf | Cf, }, /* 27 */
|
|
|
|
- { modrm, none2, B , iSUB , Sf | Zf | Cf, }, /* 28 */
|
|
|
|
- { modrm, none2, 0 , iSUB , Sf | Zf | Cf, }, /* 29 */
|
|
|
|
- { modrm, none2, TO_REG | B , iSUB , Sf | Zf | Cf, }, /* 2A */
|
|
|
|
- { modrm, none2, TO_REG , iSUB , Sf | Zf | Cf, }, /* 2B */
|
|
|
|
- { data1, axImp, B , iSUB , Sf | Zf | Cf, }, /* 2C */
|
|
|
|
- { data2, axImp, 0 , iSUB , Sf | Zf | Cf, }, /* 2D */
|
|
|
|
- { prefix, none2, 0 , (IC)rCS,0 , }, /* 2E */
|
|
|
|
- { none1, axImp, NOT_HLL | B|NO_SRC , iDAS , Sf | Zf | Cf, }, /* 2F */
|
|
|
|
- { modrm, none2, B , iXOR , Sf | Zf | Cf, }, /* 30 */
|
|
|
|
- { modrm, none2, NSP , iXOR , Sf | Zf | Cf, }, /* 31 */
|
|
|
|
- { modrm, none2, TO_REG | B , iXOR , Sf | Zf | Cf, }, /* 32 */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iXOR , Sf | Zf | Cf, }, /* 33 */
|
|
|
|
- { data1, axImp, B , iXOR , Sf | Zf | Cf, }, /* 34 */
|
|
|
|
- { data2, axImp, 0 , iXOR , Sf | Zf | Cf, }, /* 35 */
|
|
|
|
- { prefix, none2, 0 , (IC)rSS,0 , }, /* 36 */
|
|
|
|
- { none1, axImp, NOT_HLL | NO_SRC , iAAA , Sf | Zf | Cf, }, /* 37 */
|
|
|
|
- { modrm, none2, B , iCMP , Sf | Zf | Cf, }, /* 38 */
|
|
|
|
- { modrm, none2, NSP , iCMP , Sf | Zf | Cf, }, /* 39 */
|
|
|
|
- { modrm, none2, TO_REG | B , iCMP , Sf | Zf | Cf, }, /* 3A */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iCMP , Sf | Zf | Cf, }, /* 3B */
|
|
|
|
- { data1, axImp, B , iCMP , Sf | Zf | Cf, }, /* 3C */
|
|
|
|
- { data2, axImp, 0 , iCMP , Sf | Zf | Cf, }, /* 3D */
|
|
|
|
- { prefix, none2, 0 , (IC)rDS,0 , }, /* 3E */
|
|
|
|
- { none1, axImp, NOT_HLL | NO_SRC , iAAS , Sf | Zf | Cf, }, /* 3F */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 40 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 41 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 42 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 43 */
|
|
|
|
- { regop, none2, NOT_HLL , iINC , Sf | Zf, }, /* 44 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 45 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 46 */
|
|
|
|
- { regop, none2, 0 , iINC , Sf | Zf, }, /* 47 */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 48 */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 49 */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 4A */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 4B */
|
|
|
|
- { regop, none2, NOT_HLL , iDEC , Sf | Zf, }, /* 4C */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 4D */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 4E */
|
|
|
|
- { regop, none2, 0 , iDEC , Sf | Zf, }, /* 4F */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 50 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 51 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 52 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 53 */
|
|
|
|
- { regop, none2, NOT_HLL | NO_SRC , iPUSH , 0 , }, /* 54 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 55 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 56 */
|
|
|
|
- { regop, none2, NO_SRC , iPUSH , 0 , }, /* 57 */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 58 */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 59 */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 5A */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 5B */
|
|
|
|
- { regop, none2, NOT_HLL | NO_SRC , iPOP , 0 , }, /* 5C */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 5D */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 5E */
|
|
|
|
- { regop, none2, NO_SRC , iPOP , 0 , }, /* 5F */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iPUSHA, 0 , }, /* 60 */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iPOPA , 0 , }, /* 61 */
|
|
|
|
- { memOnly, modrm, TO_REG | NSP , iBOUND, 0 , }, /* 62 */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 63 */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 64 */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 65 */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 66 */
|
|
|
|
- { none1, none2, OP386 , iZERO , 0 , }, /* 67 */
|
|
|
|
- { data2, none2, NO_SRC , iPUSH , 0 , }, /* 68 */
|
|
|
|
- { modrm, data2, TO_REG | NSP , iIMUL , Sf | Zf | Cf, }, /* 69 */
|
|
|
|
- { data1, none2, S_EXT | NO_SRC , iPUSH , 0 , }, /* 6A */
|
|
|
|
- { modrm, data1, TO_REG | NSP | S_EXT , iIMUL , Sf | Zf | Cf, }, /* 6B */
|
|
|
|
|
|
+ { modrm, none2, B , iADD , Sf | Zf | Cf , 0 }, /* 00 */
|
|
|
|
+ { modrm, none2, 0 , iADD , Sf | Zf | Cf , 0 }, /* 01 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iADD , Sf | Zf | Cf , 0 }, /* 02 */
|
|
|
|
+ { modrm, none2, TO_REG , iADD , Sf | Zf | Cf , 0 }, /* 03 */
|
|
|
|
+ { data1, axImp, B , iADD , Sf | Zf | Cf , 0 }, /* 04 */
|
|
|
|
+ { data2, axImp, 0 , iADD , Sf | Zf | Cf , 0 }, /* 05 */
|
|
|
|
+ { segop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 06 */
|
|
|
|
+ { segop, none2, NO_SRC , iPOP , 0 , 0 }, /* 07 */
|
|
|
|
+ { modrm, none2, B , iOR , Sf | Zf | Cf , 0 }, /* 08 */
|
|
|
|
+ { modrm, none2, NSP , iOR , Sf | Zf | Cf , 0 }, /* 09 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iOR , Sf | Zf | Cf , 0 }, /* 0A */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iOR , Sf | Zf | Cf , 0 }, /* 0B */
|
|
|
|
+ { data1, axImp, B , iOR , Sf | Zf | Cf , 0 }, /* 0C */
|
|
|
|
+ { data2, axImp, 0 , iOR , Sf | Zf | Cf , 0 }, /* 0D */
|
|
|
|
+ { segop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 0E */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 0F */
|
|
|
|
+ { modrm, none2, B , iADC , Sf | Zf | Cf , Cf }, /* 10 */
|
|
|
|
+ { modrm, none2, NSP , iADC , Sf | Zf | Cf , Cf }, /* 11 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iADC , Sf | Zf | Cf , Cf }, /* 12 */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iADC , Sf | Zf | Cf , Cf }, /* 13 */
|
|
|
|
+ { data1, axImp, B , iADC , Sf | Zf | Cf , Cf }, /* 14 */
|
|
|
|
+ { data2, axImp, 0 , iADC , Sf | Zf | Cf , Cf }, /* 15 */
|
|
|
|
+ { segop, none2, NOT_HLL | NO_SRC , iPUSH , 0 , 0 }, /* 16 */
|
|
|
|
+ { segop, none2, NOT_HLL | NO_SRC , iPOP , 0 , 0 }, /* 17 */
|
|
|
|
+ { modrm, none2, B , iSBB , Sf | Zf | Cf , Cf }, /* 18 */
|
|
|
|
+ { modrm, none2, NSP , iSBB , Sf | Zf | Cf , Cf }, /* 19 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iSBB , Sf | Zf | Cf , Cf }, /* 1A */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iSBB , Sf | Zf | Cf , Cf }, /* 1B */
|
|
|
|
+ { data1, axImp, B , iSBB , Sf | Zf | Cf , Cf }, /* 1C */
|
|
|
|
+ { data2, axImp, 0 , iSBB , Sf | Zf | Cf , Cf }, /* 1D */
|
|
|
|
+ { segop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 1E */
|
|
|
|
+ { segop, none2, NO_SRC , iPOP , 0 , 0 }, /* 1F */
|
|
|
|
+ { modrm, none2, B , iAND , Sf | Zf | Cf , 0 }, /* 20 */
|
|
|
|
+ { modrm, none2, NSP , iAND , Sf | Zf | Cf , 0 }, /* 21 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iAND , Sf | Zf | Cf , 0 }, /* 22 */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iAND , Sf | Zf | Cf , 0 }, /* 23 */
|
|
|
|
+ { data1, axImp, B , iAND , Sf | Zf | Cf , 0 }, /* 24 */
|
|
|
|
+ { data2, axImp, 0 , iAND , Sf | Zf | Cf , 0 }, /* 25 */
|
|
|
|
+ { prefix, none2, 0 , (IC)rES,0 , 0 }, /* 26 */
|
|
|
|
+ { none1, axImp, NOT_HLL | B|NO_SRC , iDAA , Sf | Zf | Cf , 0 }, /* 27 */
|
|
|
|
+ { modrm, none2, B , iSUB , Sf | Zf | Cf , 0 }, /* 28 */
|
|
|
|
+ { modrm, none2, 0 , iSUB , Sf | Zf | Cf , 0 }, /* 29 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iSUB , Sf | Zf | Cf , 0 }, /* 2A */
|
|
|
|
+ { modrm, none2, TO_REG , iSUB , Sf | Zf | Cf , 0 }, /* 2B */
|
|
|
|
+ { data1, axImp, B , iSUB , Sf | Zf | Cf , 0 }, /* 2C */
|
|
|
|
+ { data2, axImp, 0 , iSUB , Sf | Zf | Cf , 0 }, /* 2D */
|
|
|
|
+ { prefix, none2, 0 , (IC)rCS,0 , 0 }, /* 2E */
|
|
|
|
+ { none1, axImp, NOT_HLL | B|NO_SRC , iDAS , Sf | Zf | Cf , 0 }, /* 2F */
|
|
|
|
+ { modrm, none2, B , iXOR , Sf | Zf | Cf , 0 }, /* 30 */
|
|
|
|
+ { modrm, none2, NSP , iXOR , Sf | Zf | Cf , 0 }, /* 31 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iXOR , Sf | Zf | Cf , 0 }, /* 32 */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iXOR , Sf | Zf | Cf , 0 }, /* 33 */
|
|
|
|
+ { data1, axImp, B , iXOR , Sf | Zf | Cf , 0 }, /* 34 */
|
|
|
|
+ { data2, axImp, 0 , iXOR , Sf | Zf | Cf , 0 }, /* 35 */
|
|
|
|
+ { prefix, none2, 0 , (IC)rSS,0 , 0 }, /* 36 */
|
|
|
|
+ { none1, axImp, NOT_HLL | NO_SRC , iAAA , Sf | Zf | Cf , 0 }, /* 37 */
|
|
|
|
+ { modrm, none2, B , iCMP , Sf | Zf | Cf , 0 }, /* 38 */
|
|
|
|
+ { modrm, none2, NSP , iCMP , Sf | Zf | Cf , 0 }, /* 39 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iCMP , Sf | Zf | Cf , 0 }, /* 3A */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iCMP , Sf | Zf | Cf , 0 }, /* 3B */
|
|
|
|
+ { data1, axImp, B , iCMP , Sf | Zf | Cf , 0 }, /* 3C */
|
|
|
|
+ { data2, axImp, 0 , iCMP , Sf | Zf | Cf , 0 }, /* 3D */
|
|
|
|
+ { prefix, none2, 0 , (IC)rDS,0 , 0 }, /* 3E */
|
|
|
|
+ { none1, axImp, NOT_HLL | NO_SRC , iAAS , Sf | Zf | Cf , 0 }, /* 3F */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 40 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 41 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 42 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 43 */
|
|
|
|
+ { regop, none2, NOT_HLL , iINC , Sf | Zf, 0 }, /* 44 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 45 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 46 */
|
|
|
|
+ { regop, none2, 0 , iINC , Sf | Zf, 0 }, /* 47 */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 48 */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 49 */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 4A */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 4B */
|
|
|
|
+ { regop, none2, NOT_HLL , iDEC , Sf | Zf, 0 }, /* 4C */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 4D */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 4E */
|
|
|
|
+ { regop, none2, 0 , iDEC , Sf | Zf, 0 }, /* 4F */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 50 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 51 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 52 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 53 */
|
|
|
|
+ { regop, none2, NOT_HLL | NO_SRC , iPUSH , 0 , 0 }, /* 54 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 55 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 56 */
|
|
|
|
+ { regop, none2, NO_SRC , iPUSH , 0 , 0 }, /* 57 */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 58 */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 59 */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 5A */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 5B */
|
|
|
|
+ { regop, none2, NOT_HLL | NO_SRC , iPOP , 0 , 0 }, /* 5C */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 5D */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 5E */
|
|
|
|
+ { regop, none2, NO_SRC , iPOP , 0 , 0 }, /* 5F */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iPUSHA, 0 , 0 }, /* 60 */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iPOPA , 0 , 0 }, /* 61 */
|
|
|
|
+ { memOnly, modrm, TO_REG | NSP , iBOUND, 0 , 0 }, /* 62 */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 63 */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 64 */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 65 */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 66 */
|
|
|
|
+ { none1, none2, OP386 , iZERO , 0 , 0 }, /* 67 */
|
|
|
|
+ { data2, none2, NO_SRC , iPUSH , 0 , 0 }, /* 68 */
|
|
|
|
+ { modrm, data2, TO_REG | NSP , iIMUL , Sf | Zf | Cf, 0 }, /* 69 */
|
|
|
|
+ { data1, none2, S_EXT | NO_SRC , iPUSH , 0 , 0 }, /* 6A */
|
|
|
|
+ { modrm, data1, TO_REG | NSP | S_EXT , iIMUL , Sf | Zf | Cf, 0 }, /* 6B */
|
|
{ strop, memImp, NOT_HLL | B|IM_OPS , iINS , 0 , Df }, /* 6C */
|
|
{ strop, memImp, NOT_HLL | B|IM_OPS , iINS , 0 , Df }, /* 6C */
|
|
{ strop, memImp, NOT_HLL | IM_OPS , iINS , 0 , Df }, /* 6D */
|
|
{ strop, memImp, NOT_HLL | IM_OPS , iINS , 0 , Df }, /* 6D */
|
|
{ strop, memImp, NOT_HLL | B|IM_OPS , iOUTS , 0 , Df }, /* 6E */
|
|
{ strop, memImp, NOT_HLL | B|IM_OPS , iOUTS , 0 , Df }, /* 6E */
|
|
{ strop, memImp, NOT_HLL | IM_OPS , iOUTS , 0 , Df }, /* 6F */
|
|
{ strop, memImp, NOT_HLL | IM_OPS , iOUTS , 0 , Df }, /* 6F */
|
|
- { dispS, none2, NOT_HLL , iJO , 0 , }, /* 70 */
|
|
|
|
- { dispS, none2, NOT_HLL , iJNO , 0 , }, /* 71 */
|
|
|
|
|
|
+ { dispS, none2, NOT_HLL , iJO , 0 , 0 }, /* 70 */
|
|
|
|
+ { dispS, none2, NOT_HLL , iJNO , 0 , 0 }, /* 71 */
|
|
{ dispS, none2, 0 , iJB , 0 , Cf }, /* 72 */
|
|
{ dispS, none2, 0 , iJB , 0 , Cf }, /* 72 */
|
|
{ dispS, none2, 0 , iJAE , 0 , Cf }, /* 73 */
|
|
{ dispS, none2, 0 , iJAE , 0 , Cf }, /* 73 */
|
|
{ dispS, none2, 0 , iJE , 0 , Zf }, /* 74 */
|
|
{ dispS, none2, 0 , iJE , 0 , Zf }, /* 74 */
|
|
@@ -142,140 +173,140 @@ static struct {
|
|
{ dispS, none2, 0 , iJA , 0 , Zf | Cf }, /* 77 */
|
|
{ dispS, none2, 0 , iJA , 0 , Zf | Cf }, /* 77 */
|
|
{ dispS, none2, 0 , iJS , 0 , Sf }, /* 78 */
|
|
{ dispS, none2, 0 , iJS , 0 , Sf }, /* 78 */
|
|
{ dispS, none2, 0 , iJNS , 0 , Sf }, /* 79 */
|
|
{ dispS, none2, 0 , iJNS , 0 , Sf }, /* 79 */
|
|
- { dispS, none2, NOT_HLL , iJP , 0 , }, /* 7A */
|
|
|
|
- { dispS, none2, NOT_HLL , iJNP , 0 , }, /* 7B */
|
|
|
|
|
|
+ { dispS, none2, NOT_HLL , iJP , 0 , 0 }, /* 7A */
|
|
|
|
+ { dispS, none2, NOT_HLL , iJNP , 0 , 0 }, /* 7B */
|
|
{ dispS, none2, 0 , iJL , 0 , Sf }, /* 7C */
|
|
{ dispS, none2, 0 , iJL , 0 , Sf }, /* 7C */
|
|
{ dispS, none2, 0 , iJGE , 0 , Sf }, /* 7D */
|
|
{ dispS, none2, 0 , iJGE , 0 , Sf }, /* 7D */
|
|
{ dispS, none2, 0 , iJLE , 0 , Sf | Zf }, /* 7E */
|
|
{ dispS, none2, 0 , iJLE , 0 , Sf | Zf }, /* 7E */
|
|
{ dispS, none2, 0 , iJG , 0 , Sf | Zf }, /* 7F */
|
|
{ dispS, none2, 0 , iJG , 0 , Sf | Zf }, /* 7F */
|
|
- { immed, data1, B , iZERO , 0 , }, /* 80 */
|
|
|
|
- { immed, data2, NSP , iZERO , 0 , }, /* 81 */
|
|
|
|
- { immed, data1, B , iZERO , 0 , }, /* 82 */ /* ?? */
|
|
|
|
- { immed, data1, NSP | S_EXT , iZERO , 0 , }, /* 83 */
|
|
|
|
- { modrm, none2, TO_REG | B , iTEST , Sf | Zf | Cf, }, /* 84 */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iTEST , Sf | Zf | Cf, }, /* 85 */
|
|
|
|
- { modrm, none2, TO_REG | B , iXCHG , 0 , }, /* 86 */
|
|
|
|
- { modrm, none2, TO_REG | NSP , iXCHG , 0 , }, /* 87 */
|
|
|
|
- { modrm, none2, B , iMOV , 0 , }, /* 88 */
|
|
|
|
- { modrm, none2, 0 , iMOV , 0 , }, /* 89 */
|
|
|
|
- { modrm, none2, TO_REG | B , iMOV , 0 , }, /* 8A */
|
|
|
|
- { modrm, none2, TO_REG , iMOV , 0 , }, /* 8B */
|
|
|
|
- { segrm, none2, NSP , iMOV , 0 , }, /* 8C */
|
|
|
|
- { memOnly, modrm, TO_REG | NSP , iLEA , 0 , }, /* 8D */
|
|
|
|
- { segrm, none2, TO_REG | NSP , iMOV , 0 , }, /* 8E */
|
|
|
|
- { memReg0, none2, NO_SRC , iPOP , 0 , }, /* 8F */
|
|
|
|
- { none1, none2, NO_OPS , iNOP , 0 , }, /* 90 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 91 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 92 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 93 */
|
|
|
|
- { regop, axImp, NOT_HLL , iXCHG , 0 , }, /* 94 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 95 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 96 */
|
|
|
|
- { regop, axImp, 0 , iXCHG , 0 , }, /* 97 */
|
|
|
|
- { alImp, axImp, SRC_B | S_EXT , iSIGNEX,0 , }, /* 98 */
|
|
|
|
- {axSrcIm, axImp, IM_DST | S_EXT , iSIGNEX,0 , }, /* 99 */
|
|
|
|
- { dispF, none2, 0 , iCALLF ,0 , }, /* 9A */
|
|
|
|
- { none1, none2, FLOAT_OP| NO_OPS , iWAIT , 0 , }, /* 9B */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iPUSHF, 0 , }, /* 9C */
|
|
|
|
|
|
+ { immed, data1, B , iZERO , 0 , 0 }, /* 80 */
|
|
|
|
+ { immed, data2, NSP , iZERO , 0 , 0 }, /* 81 */
|
|
|
|
+ { immed, data1, B , iZERO , 0 , 0 }, /* 82 */ /* ?? */
|
|
|
|
+ { immed, data1, NSP | S_EXT , iZERO , 0 , 0 }, /* 83 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iTEST , Sf | Zf | Cf, 0 }, /* 84 */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iTEST , Sf | Zf | Cf, 0 }, /* 85 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iXCHG , 0 , 0 }, /* 86 */
|
|
|
|
+ { modrm, none2, TO_REG | NSP , iXCHG , 0 , 0 }, /* 87 */
|
|
|
|
+ { modrm, none2, B , iMOV , 0 , 0 }, /* 88 */
|
|
|
|
+ { modrm, none2, 0 , iMOV , 0 , 0 }, /* 89 */
|
|
|
|
+ { modrm, none2, TO_REG | B , iMOV , 0 , 0 }, /* 8A */
|
|
|
|
+ { modrm, none2, TO_REG , iMOV , 0 , 0 }, /* 8B */
|
|
|
|
+ { segrm, none2, NSP , iMOV , 0 , 0 }, /* 8C */
|
|
|
|
+ { memOnly, modrm, TO_REG | NSP , iLEA , 0 , 0 }, /* 8D */
|
|
|
|
+ { segrm, none2, TO_REG | NSP , iMOV , 0 , 0 }, /* 8E */
|
|
|
|
+ { memReg0, none2, NO_SRC , iPOP , 0 , 0 }, /* 8F */
|
|
|
|
+ { none1, none2, NO_OPS , iNOP , 0 , 0 }, /* 90 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 91 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 92 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 93 */
|
|
|
|
+ { regop, axImp, NOT_HLL , iXCHG , 0 , 0 }, /* 94 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 95 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 96 */
|
|
|
|
+ { regop, axImp, 0 , iXCHG , 0 , 0 }, /* 97 */
|
|
|
|
+ { alImp, axImp, SRC_B | S_EXT , iSIGNEX,0 , 0 }, /* 98 */
|
|
|
|
+ {axSrcIm, axImp, IM_DST | S_EXT , iSIGNEX,0 , 0 }, /* 99 */
|
|
|
|
+ { dispF, none2, 0 , iCALLF ,0 , 0 }, /* 9A */
|
|
|
|
+ { none1, none2, FLOAT_OP| NO_OPS , iWAIT , 0 , 0 }, /* 9B */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iPUSHF, 0 , 0 }, /* 9C */
|
|
{ none1, none2, NOT_HLL | NO_OPS , iPOPF , Sf | Zf | Cf | Df,}, /* 9D */
|
|
{ none1, none2, NOT_HLL | NO_OPS , iPOPF , Sf | Zf | Cf | Df,}, /* 9D */
|
|
- { none1, none2, NOT_HLL | NO_OPS , iSAHF , Sf | Zf | Cf, }, /* 9E */
|
|
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iSAHF , Sf | Zf | Cf, 0 }, /* 9E */
|
|
{ none1, none2, NOT_HLL | NO_OPS , iLAHF , 0 , Sf | Zf | Cf }, /* 9F */
|
|
{ none1, none2, NOT_HLL | NO_OPS , iLAHF , 0 , Sf | Zf | Cf }, /* 9F */
|
|
- { dispM, axImp, B , iMOV , 0 , }, /* A0 */
|
|
|
|
- { dispM, axImp, 0 , iMOV , 0 , }, /* A1 */
|
|
|
|
- { dispM, axImp, TO_REG | B , iMOV , 0 , }, /* A2 */
|
|
|
|
- { dispM, axImp, TO_REG , iMOV , 0 , }, /* A3 */
|
|
|
|
|
|
+ { dispM, axImp, B , iMOV , 0 , 0 }, /* A0 */
|
|
|
|
+ { dispM, axImp, 0 , iMOV , 0 , 0 }, /* A1 */
|
|
|
|
+ { dispM, axImp, TO_REG | B , iMOV , 0 , 0 }, /* A2 */
|
|
|
|
+ { dispM, axImp, TO_REG , iMOV , 0 , 0 }, /* A3 */
|
|
{ strop, memImp, B | IM_OPS , iMOVS , 0 , Df }, /* A4 */
|
|
{ strop, memImp, B | IM_OPS , iMOVS , 0 , Df }, /* A4 */
|
|
{ strop, memImp, IM_OPS , iMOVS , 0 , Df }, /* A5 */
|
|
{ strop, memImp, IM_OPS , iMOVS , 0 , Df }, /* A5 */
|
|
{ strop, memImp, B | IM_OPS , iCMPS , Sf | Zf | Cf, Df }, /* A6 */
|
|
{ strop, memImp, B | IM_OPS , iCMPS , Sf | Zf | Cf, Df }, /* A6 */
|
|
{ strop, memImp, IM_OPS , iCMPS , Sf | Zf | Cf, Df }, /* A7 */
|
|
{ strop, memImp, IM_OPS , iCMPS , Sf | Zf | Cf, Df }, /* A7 */
|
|
- { data1, axImp, B , iTEST , Sf | Zf | Cf, }, /* A8 */
|
|
|
|
- { data2, axImp, 0 , iTEST , Sf | Zf | Cf, }, /* A9 */
|
|
|
|
|
|
+ { data1, axImp, B , iTEST , Sf | Zf | Cf, 0 }, /* A8 */
|
|
|
|
+ { data2, axImp, 0 , iTEST , Sf | Zf | Cf, 0 }, /* A9 */
|
|
{ strop, memImp, B | IM_OPS , iSTOS , 0 , Df }, /* AA */
|
|
{ strop, memImp, B | IM_OPS , iSTOS , 0 , Df }, /* AA */
|
|
{ strop, memImp, IM_OPS , iSTOS , 0 , Df }, /* AB */
|
|
{ strop, memImp, IM_OPS , iSTOS , 0 , Df }, /* AB */
|
|
{ strop, memImp, B | IM_OPS , iLODS , 0 , Df }, /* AC */
|
|
{ strop, memImp, B | IM_OPS , iLODS , 0 , Df }, /* AC */
|
|
{ strop, memImp, IM_OPS , iLODS , 0 , Df }, /* AD */
|
|
{ strop, memImp, IM_OPS , iLODS , 0 , Df }, /* AD */
|
|
{ strop, memImp, B | IM_OPS , iSCAS , Sf | Zf | Cf, Df }, /* AE */
|
|
{ strop, memImp, B | IM_OPS , iSCAS , Sf | Zf | Cf, Df }, /* AE */
|
|
{ strop, memImp, IM_OPS , iSCAS , Sf | Zf | Cf, Df }, /* AF */
|
|
{ strop, memImp, IM_OPS , iSCAS , Sf | Zf | Cf, Df }, /* AF */
|
|
- { regop, data1, B , iMOV , 0 , }, /* B0 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B1 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B2 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B3 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B4 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B5 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B6 */
|
|
|
|
- { regop, data1, B , iMOV , 0 , }, /* B7 */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* B8 */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* B9 */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* BA */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* BB */
|
|
|
|
- { regop, data2, NOT_HLL , iMOV , 0 , }, /* BC */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* BD */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* BE */
|
|
|
|
- { regop, data2, 0 , iMOV , 0 , }, /* BF */
|
|
|
|
- { shift, data1, B , iZERO , 0 , }, /* C0 */
|
|
|
|
- { shift, data1, NSP | SRC_B , iZERO , 0 , }, /* C1 */
|
|
|
|
- { data2, none2, 0 , iRET , 0 , }, /* C2 */
|
|
|
|
- { none1, none2, NO_OPS , iRET , 0 , }, /* C3 */
|
|
|
|
- { memOnly, modrm, TO_REG | NSP , iLES , 0 , }, /* C4 */
|
|
|
|
- { memOnly, modrm, TO_REG | NSP , iLDS , 0 , }, /* C5 */
|
|
|
|
- { memReg0, data1, B , iMOV , 0 , }, /* C6 */
|
|
|
|
- { memReg0, data2, 0 , iMOV , 0 , }, /* C7 */
|
|
|
|
- { data2, data1, 0 , iENTER, 0 , }, /* C8 */
|
|
|
|
- { none1, none2, NO_OPS , iLEAVE, 0 , }, /* C9 */
|
|
|
|
- { data2, none2, 0 , iRETF , 0 , }, /* CA */
|
|
|
|
- { none1, none2, NO_OPS , iRETF , 0 , }, /* CB */
|
|
|
|
- { const3, none2, NOT_HLL , iINT , 0 , }, /* CC */
|
|
|
|
- { data1,checkInt, NOT_HLL , iINT , 0 , }, /* CD */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iINTO , 0 , }, /* CE */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iIRET , 0 , }, /* Cf */
|
|
|
|
- { shift, const1, B , iZERO , 0 , }, /* D0 */
|
|
|
|
- { shift, const1, SRC_B , iZERO , 0 , }, /* D1 */
|
|
|
|
- { shift, none1, B , iZERO , 0 , }, /* D2 */
|
|
|
|
- { shift, none1, SRC_B , iZERO , 0 , }, /* D3 */
|
|
|
|
- { data1, axImp, NOT_HLL , iAAM , Sf | Zf | Cf, }, /* D4 */
|
|
|
|
- { data1, axImp, NOT_HLL , iAAD , Sf | Zf | Cf, }, /* D5 */
|
|
|
|
- { none1, none2, 0 , iZERO , 0 , }, /* D6 */
|
|
|
|
- { memImp, axImp, NOT_HLL | B| IM_OPS, iXLAT , 0 , }, /* D7 */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* D8 */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* D9 */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* DA */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* DB */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* DC */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* DD */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* DE */
|
|
|
|
- { escop, none2, FLOAT_OP , iESC , 0 , }, /* Df */
|
|
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B0 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B1 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B2 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B3 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B4 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B5 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B6 */
|
|
|
|
+ { regop, data1, B , iMOV , 0 , 0 }, /* B7 */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* B8 */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* B9 */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* BA */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* BB */
|
|
|
|
+ { regop, data2, NOT_HLL , iMOV , 0 , 0 }, /* BC */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* BD */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* BE */
|
|
|
|
+ { regop, data2, 0 , iMOV , 0 , 0 }, /* BF */
|
|
|
|
+ { shift, data1, B , iZERO , 0 , 0 }, /* C0 */
|
|
|
|
+ { shift, data1, NSP | SRC_B , iZERO , 0 , 0 }, /* C1 */
|
|
|
|
+ { data2, none2, 0 , iRET , 0 , 0 }, /* C2 */
|
|
|
|
+ { none1, none2, NO_OPS , iRET , 0 , 0 }, /* C3 */
|
|
|
|
+ { memOnly, modrm, TO_REG | NSP , iLES , 0 , 0 }, /* C4 */
|
|
|
|
+ { memOnly, modrm, TO_REG | NSP , iLDS , 0 , 0 }, /* C5 */
|
|
|
|
+ { memReg0, data1, B , iMOV , 0 , 0 }, /* C6 */
|
|
|
|
+ { memReg0, data2, 0 , iMOV , 0 , 0 }, /* C7 */
|
|
|
|
+ { data2, data1, 0 , iENTER, 0 , 0 }, /* C8 */
|
|
|
|
+ { none1, none2, NO_OPS , iLEAVE, 0 , 0 }, /* C9 */
|
|
|
|
+ { data2, none2, 0 , iRETF , 0 , 0 }, /* CA */
|
|
|
|
+ { none1, none2, NO_OPS , iRETF , 0 , 0 }, /* CB */
|
|
|
|
+ { const3, none2, NOT_HLL , iINT , 0 , 0 }, /* CC */
|
|
|
|
+ { data1,checkInt, NOT_HLL , iINT , 0 , 0 }, /* CD */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iINTO , 0 , 0 }, /* CE */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iIRET , 0 , 0 }, /* Cf */
|
|
|
|
+ { shift, const1, B , iZERO , 0 , 0 }, /* D0 */
|
|
|
|
+ { shift, const1, SRC_B , iZERO , 0 , 0 }, /* D1 */
|
|
|
|
+ { shift, none1, B , iZERO , 0 , 0 }, /* D2 */
|
|
|
|
+ { shift, none1, SRC_B , iZERO , 0 , 0 }, /* D3 */
|
|
|
|
+ { data1, axImp, NOT_HLL , iAAM , Sf | Zf | Cf, 0 }, /* D4 */
|
|
|
|
+ { data1, axImp, NOT_HLL , iAAD , Sf | Zf | Cf, 0 }, /* D5 */
|
|
|
|
+ { none1, none2, 0 , iZERO , 0 , 0 }, /* D6 */
|
|
|
|
+ { memImp, axImp, NOT_HLL | B| IM_OPS, iXLAT , 0 , 0 }, /* D7 */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* D8 */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* D9 */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* DA */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* DB */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* DC */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* DD */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* DE */
|
|
|
|
+ { escop, none2, FLOAT_OP , iESC , 0 , 0 }, /* Df */
|
|
{ dispS, none2, 0 , iLOOPNE,0 , Zf }, /* E0 */
|
|
{ dispS, none2, 0 , iLOOPNE,0 , Zf }, /* E0 */
|
|
{ dispS, none2, 0 , iLOOPE, 0 , Zf }, /* E1 */
|
|
{ dispS, none2, 0 , iLOOPE, 0 , Zf }, /* E1 */
|
|
- { dispS, none2, 0 , iLOOP , 0 , }, /* E2 */
|
|
|
|
- { dispS, none2, 0 , iJCXZ , 0 , }, /* E3 */
|
|
|
|
- { data1, axImp, NOT_HLL | B|NO_SRC , iIN , 0 , }, /* E4 */
|
|
|
|
- { data1, axImp, NOT_HLL | NO_SRC , iIN , 0 , }, /* E5 */
|
|
|
|
- { data1, axImp, NOT_HLL | B|NO_SRC , iOUT , 0 , }, /* E6 */
|
|
|
|
- { data1, axImp, NOT_HLL | NO_SRC , iOUT , 0 , }, /* E7 */
|
|
|
|
- { dispN, none2, 0 , iCALL , 0 , }, /* E8 */
|
|
|
|
- { dispN, none2, 0 , iJMP , 0 , }, /* E9 */
|
|
|
|
- { dispF, none2, 0 , iJMPF , 0 , }, /* EA */
|
|
|
|
- { dispS, none2, 0 , iJMP , 0 , }, /* EB */
|
|
|
|
- { none1, axImp, NOT_HLL | B|NO_SRC , iIN , 0 , }, /* EC */
|
|
|
|
- { none1, axImp, NOT_HLL | NO_SRC , iIN , 0 , }, /* ED */
|
|
|
|
- { none1, axImp, NOT_HLL | B|NO_SRC , iOUT , 0 , }, /* EE */
|
|
|
|
- { none1, axImp, NOT_HLL | NO_SRC , iOUT , 0 , }, /* EF */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iLOCK , 0 , }, /* F0 */
|
|
|
|
- { none1, none2, 0 , iZERO , 0 , }, /* F1 */
|
|
|
|
- { prefix, none2, 0 , iREPNE, 0 , }, /* F2 */
|
|
|
|
- { prefix, none2, 0 , iREPE , 0 , }, /* F3 */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iHLT , 0 , }, /* F4 */
|
|
|
|
|
|
+ { dispS, none2, 0 , iLOOP , 0 , 0 }, /* E2 */
|
|
|
|
+ { dispS, none2, 0 , iJCXZ , 0 , 0 }, /* E3 */
|
|
|
|
+ { data1, axImp, NOT_HLL | B|NO_SRC , iIN , 0 , 0 }, /* E4 */
|
|
|
|
+ { data1, axImp, NOT_HLL | NO_SRC , iIN , 0 , 0 }, /* E5 */
|
|
|
|
+ { data1, axImp, NOT_HLL | B|NO_SRC , iOUT , 0 , 0 }, /* E6 */
|
|
|
|
+ { data1, axImp, NOT_HLL | NO_SRC , iOUT , 0 , 0 }, /* E7 */
|
|
|
|
+ { dispN, none2, 0 , iCALL , 0 , 0 }, /* E8 */
|
|
|
|
+ { dispN, none2, 0 , iJMP , 0 , 0 }, /* E9 */
|
|
|
|
+ { dispF, none2, 0 , iJMPF , 0 , 0 }, /* EA */
|
|
|
|
+ { dispS, none2, 0 , iJMP , 0 , 0 }, /* EB */
|
|
|
|
+ { none1, axImp, NOT_HLL | B|NO_SRC , iIN , 0 , 0 }, /* EC */
|
|
|
|
+ { none1, axImp, NOT_HLL | NO_SRC , iIN , 0 , 0 }, /* ED */
|
|
|
|
+ { none1, axImp, NOT_HLL | B|NO_SRC , iOUT , 0 , 0 }, /* EE */
|
|
|
|
+ { none1, axImp, NOT_HLL | NO_SRC , iOUT , 0 , 0 }, /* EF */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iLOCK , 0 , 0 }, /* F0 */
|
|
|
|
+ { none1, none2, 0 , iZERO , 0 , 0 }, /* F1 */
|
|
|
|
+ { prefix, none2, 0 , iREPNE, 0 , 0 }, /* F2 */
|
|
|
|
+ { prefix, none2, 0 , iREPE , 0 , 0 }, /* F3 */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iHLT , 0 , 0 }, /* F4 */
|
|
{ none1, none2, NO_OPS , iCMC , Cf, Cf }, /* F5 */
|
|
{ none1, none2, NO_OPS , iCMC , Cf, Cf }, /* F5 */
|
|
- { arith, none1, B , iZERO , 0 , }, /* F6 */
|
|
|
|
- { arith, none1, NSP , iZERO , 0 , }, /* F7 */
|
|
|
|
- { none1, none2, NO_OPS , iCLC , Cf, }, /* F8 */
|
|
|
|
- { none1, none2, NO_OPS , iSTC , Cf, }, /* F9 */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iCLI , 0 , }, /* FA */
|
|
|
|
- { none1, none2, NOT_HLL | NO_OPS , iSTI , 0 , }, /* FB */
|
|
|
|
- { none1, none2, NO_OPS , iCLD , Df, }, /* FC */
|
|
|
|
- { none1, none2, NO_OPS , iSTD , Df, }, /* FD */
|
|
|
|
- { trans, none1, B , iZERO , 0 , }, /* FE */
|
|
|
|
- { trans, none1, NSP , iZERO , 0 , } /* FF */
|
|
|
|
|
|
+ { arith, none1, B , iZERO , 0 , 0 }, /* F6 */
|
|
|
|
+ { arith, none1, NSP , iZERO , 0 , 0 }, /* F7 */
|
|
|
|
+ { none1, none2, NO_OPS , iCLC , Cf, 0 }, /* F8 */
|
|
|
|
+ { none1, none2, NO_OPS , iSTC , Cf, 0 }, /* F9 */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iCLI , 0 , 0 }, /* FA */
|
|
|
|
+ { none1, none2, NOT_HLL | NO_OPS , iSTI , 0 , 0 }, /* FB */
|
|
|
|
+ { none1, none2, NO_OPS , iCLD , Df, 0 }, /* FC */
|
|
|
|
+ { none1, none2, NO_OPS , iSTD , Df, 0 }, /* FD */
|
|
|
|
+ { trans, none1, B , iZERO , 0 , 0 }, /* FE */
|
|
|
|
+ { trans, none1, NSP , iZERO , 0 , 0 } /* FF */
|
|
} ;
|
|
} ;
|
|
|
|
|
|
static word SegPrefix, RepPrefix;
|
|
static word SegPrefix, RepPrefix;
|
|
@@ -287,7 +318,7 @@ static ICODE * pIcode; /* Ptr to Icode record filled in by scan() */
|
|
Scans one machine instruction at offset ip in prog.Image and returns error.
|
|
Scans one machine instruction at offset ip in prog.Image and returns error.
|
|
At the same time, fill in low-level icode details for the scanned inst.
|
|
At the same time, fill in low-level icode details for the scanned inst.
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-Int scan(dword ip, ICODE *p)
|
|
|
|
|
|
+eErrorId scan(dword ip, ICODE *p)
|
|
{
|
|
{
|
|
Int op;
|
|
Int op;
|
|
|
|
|
|
@@ -321,7 +352,7 @@ Int scan(dword ip, ICODE *p)
|
|
/* Save bytes of image used */
|
|
/* Save bytes of image used */
|
|
p->ic.ll.numBytes = (byte)((pInst - prog.Image) - ip);
|
|
p->ic.ll.numBytes = (byte)((pInst - prog.Image) - ip);
|
|
return ((SegPrefix)? FUNNY_SEGOVR: /* Seg. Override invalid */
|
|
return ((SegPrefix)? FUNNY_SEGOVR: /* Seg. Override invalid */
|
|
- (RepPrefix ? FUNNY_REP: 0));/* REP prefix invalid */
|
|
|
|
|
|
+ (RepPrefix ? FUNNY_REP: NO_ERR));/* REP prefix invalid */
|
|
}
|
|
}
|
|
/* Else opcode error */
|
|
/* Else opcode error */
|
|
return ((stateTable[op].flg & OP386)? INVALID_386OP: INVALID_OPCODE);
|
|
return ((stateTable[op].flg & OP386)? INVALID_386OP: INVALID_OPCODE);
|
|
@@ -501,16 +532,14 @@ static void axImp(Int i)
|
|
setAddress(i, TRUE, 0, rAX, 0);
|
|
setAddress(i, TRUE, 0, rAX, 0);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-static void axSrcIm (Int i)
|
|
|
|
/* Implied AX source */
|
|
/* Implied AX source */
|
|
|
|
+static void axSrcIm (Int )
|
|
{
|
|
{
|
|
pIcode->ic.ll.src.regi = rAX;
|
|
pIcode->ic.ll.src.regi = rAX;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-static void alImp (Int i)
|
|
|
|
/* Implied AL source */
|
|
/* Implied AL source */
|
|
|
|
+static void alImp (Int )
|
|
{
|
|
{
|
|
pIcode->ic.ll.src.regi = rAL;
|
|
pIcode->ic.ll.src.regi = rAL;
|
|
}
|
|
}
|
|
@@ -528,7 +557,7 @@ static void memImp(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
memOnly - Instruction is not valid if modrm refers to register (i.e. mod == 3)
|
|
memOnly - Instruction is not valid if modrm refers to register (i.e. mod == 3)
|
|
***************************************************************************/
|
|
***************************************************************************/
|
|
-static void memOnly(Int i)
|
|
|
|
|
|
+static void memOnly(Int )
|
|
{
|
|
{
|
|
if ((*pInst & 0xC0) == 0xC0)
|
|
if ((*pInst & 0xC0) == 0xC0)
|
|
pIcode->ic.ll.opcode = (llIcode)0;
|
|
pIcode->ic.ll.opcode = (llIcode)0;
|
|
@@ -665,7 +694,7 @@ static void data1(Int i)
|
|
/*****************************************************************************
|
|
/*****************************************************************************
|
|
data2 - Sets up immed from 2 byte data
|
|
data2 - Sets up immed from 2 byte data
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void data2(Int i)
|
|
|
|
|
|
+static void data2(Int )
|
|
{
|
|
{
|
|
if (relocItem(pInst))
|
|
if (relocItem(pInst))
|
|
pIcode->ic.ll.flg |= SEG_IMMED;
|
|
pIcode->ic.ll.flg |= SEG_IMMED;
|
|
@@ -699,10 +728,10 @@ static void dispM(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
dispN - 2 byte disp as immed relative to ip
|
|
dispN - 2 byte disp as immed relative to ip
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void dispN(Int i)
|
|
|
|
|
|
+static void dispN(Int )
|
|
{
|
|
{
|
|
long off = (short)getWord(); /* Signed displacement */
|
|
long off = (short)getWord(); /* Signed displacement */
|
|
-
|
|
|
|
|
|
+
|
|
/* Note: the result of the subtraction could be between 32k and 64k, and
|
|
/* Note: the result of the subtraction could be between 32k and 64k, and
|
|
still be positive; it is an offset from prog.Image. So this must be
|
|
still be positive; it is an offset from prog.Image. So this must be
|
|
treated as unsigned */
|
|
treated as unsigned */
|
|
@@ -714,7 +743,7 @@ static void dispN(Int i)
|
|
/***************************************************************************
|
|
/***************************************************************************
|
|
dispS - 1 byte disp as immed relative to ip
|
|
dispS - 1 byte disp as immed relative to ip
|
|
***************************************************************************/
|
|
***************************************************************************/
|
|
-static void dispS(Int i)
|
|
|
|
|
|
+static void dispS(Int )
|
|
{
|
|
{
|
|
long off = signex(*pInst++); /* Signed displacement */
|
|
long off = signex(*pInst++); /* Signed displacement */
|
|
|
|
|
|
@@ -726,7 +755,7 @@ static void dispS(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
dispF - 4 byte disp as immed 20-bit target address
|
|
dispF - 4 byte disp as immed 20-bit target address
|
|
***************************************************************************/
|
|
***************************************************************************/
|
|
-static void dispF(Int i)
|
|
|
|
|
|
+static void dispF(Int )
|
|
{
|
|
{
|
|
dword off = (unsigned)getWord();
|
|
dword off = (unsigned)getWord();
|
|
dword seg = (unsigned)getWord();
|
|
dword seg = (unsigned)getWord();
|
|
@@ -740,7 +769,7 @@ static void dispF(Int i)
|
|
prefix - picks up prefix byte for following instruction (LOCK is ignored
|
|
prefix - picks up prefix byte for following instruction (LOCK is ignored
|
|
on purpose)
|
|
on purpose)
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void prefix(Int i)
|
|
|
|
|
|
+static void prefix(Int )
|
|
{
|
|
{
|
|
if (pIcode->ic.ll.opcode == iREPE || pIcode->ic.ll.opcode == iREPNE)
|
|
if (pIcode->ic.ll.opcode == iREPE || pIcode->ic.ll.opcode == iREPNE)
|
|
RepPrefix = pIcode->ic.ll.opcode;
|
|
RepPrefix = pIcode->ic.ll.opcode;
|
|
@@ -756,7 +785,7 @@ inline void BumpOpcode(llIcode& ic)
|
|
/*****************************************************************************
|
|
/*****************************************************************************
|
|
strop - checks RepPrefix and converts string instructions accordingly
|
|
strop - checks RepPrefix and converts string instructions accordingly
|
|
*****************************************************************************/
|
|
*****************************************************************************/
|
|
-static void strop(Int i)
|
|
|
|
|
|
+static void strop(Int )
|
|
{
|
|
{
|
|
if (RepPrefix)
|
|
if (RepPrefix)
|
|
{
|
|
{
|
|
@@ -788,7 +817,7 @@ static void escop(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
const1
|
|
const1
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void const1(Int i)
|
|
|
|
|
|
+static void const1(Int )
|
|
{
|
|
{
|
|
pIcode->ic.ll.immed.op = 1;
|
|
pIcode->ic.ll.immed.op = 1;
|
|
pIcode->ic.ll.flg |= I;
|
|
pIcode->ic.ll.flg |= I;
|
|
@@ -798,7 +827,7 @@ static void const1(Int i)
|
|
/*****************************************************************************
|
|
/*****************************************************************************
|
|
const3
|
|
const3
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void const3(Int i)
|
|
|
|
|
|
+static void const3(Int )
|
|
{
|
|
{
|
|
pIcode->ic.ll.immed.op = 3;
|
|
pIcode->ic.ll.immed.op = 3;
|
|
pIcode->ic.ll.flg |= I;
|
|
pIcode->ic.ll.flg |= I;
|
|
@@ -808,7 +837,7 @@ static void const3(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
none1
|
|
none1
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void none1(Int i)
|
|
|
|
|
|
+static void none1(Int )
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
@@ -816,7 +845,7 @@ static void none1(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
none2 - Sets the NO_OPS flag if the operand is immediate
|
|
none2 - Sets the NO_OPS flag if the operand is immediate
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void none2(Int i)
|
|
|
|
|
|
+static void none2(Int )
|
|
{
|
|
{
|
|
if (pIcode->ic.ll.flg & I)
|
|
if (pIcode->ic.ll.flg & I)
|
|
pIcode->ic.ll.flg |= NO_OPS;
|
|
pIcode->ic.ll.flg |= NO_OPS;
|
|
@@ -825,7 +854,7 @@ static void none2(Int i)
|
|
/****************************************************************************
|
|
/****************************************************************************
|
|
Checks for int 34 to int 3B - if so, converts to ESC nn instruction
|
|
Checks for int 34 to int 3B - if so, converts to ESC nn instruction
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-static void checkInt(Int i)
|
|
|
|
|
|
+static void checkInt(Int )
|
|
{
|
|
{
|
|
word wOp = (word) pIcode->ic.ll.immed.op;
|
|
word wOp = (word) pIcode->ic.ll.immed.op;
|
|
if ((wOp >= 0x34) && (wOp <= 0x3B))
|
|
if ((wOp >= 0x34) && (wOp <= 0x3B))
|