VirtualBox

Changeset 41690 in vbox


Ignore:
Timestamp:
Jun 13, 2012 6:12:25 PM (12 years ago)
Author:
vboxsync
Message:

DIS: More cleanups.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dis.h

    r41678 r41690  
    442442
    443443
    444 /** Pointer to opcode. */
    445 typedef struct OPCODE *POPCODE;
    446444/** Pointer to const opcode. */
    447 typedef const struct OPCODE *PCOPCODE;
     445typedef const struct DISOPCODE *PCDISOPCODE;
    448446
    449447/**
     
    464462/** Parser callback.
    465463 * @remark no DECLCALLBACK() here because it's considered to be internal (really, I'm too lazy to update all the functions). */
    466 typedef unsigned FNDISPARSE(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
     464typedef unsigned FNDISPARSE(RTUINTPTR pu8CodeBlock, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
    467465typedef FNDISPARSE *PFNDISPARSE;
    468466
     
    538536
    539537    /** Pointer to the current instruction. */
    540     PCOPCODE        pCurInstr;
     538    PCDISOPCODE     pCurInstr;
    541539#ifndef DIS_CORE_ONLY
    542540    /** Opcode format string for current instruction. */
     
    558556/** Opcode. */
    559557#pragma pack(4)
    560 typedef struct OPCODE
     558typedef struct DISOPCODE
    561559{
    562560#ifndef DIS_CORE_ONLY
     
    571569    uint16_t    param3;
    572570
    573     unsigned    optype;
    574 } OPCODE;
     571    uint32_t    optype;
     572} DISOPCODE;
    575573#pragma pack()
    576574
  • trunk/src/VBox/Disassembler/Disasm.cpp

    r41676 r41690  
    2727#include <iprt/string.h>
    2828#include "DisasmInternal.h"
    29 #include "DisasmTables.h"
    3029
    3130
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r41678 r41690  
    2929#include <iprt/stdarg.h>
    3030#include "DisasmInternal.h"
    31 #include "DisasmTables.h"
    3231
    3332
     
    3534*   Internal Functions                                                         *
    3635*******************************************************************************/
    37 static int disCoreParseInstr(PDISCPUSTATE pCpu, RTUINTPTR uInstrAddr, const OPCODE *paOneByteMap, uint32_t *pcbInstr);
    38 
    39 static unsigned QueryModRM(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc = NULL);
    40 static unsigned QueryModRM_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc = NULL);
    41 static void     UseSIB(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
    42 static unsigned ParseSIB_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
    43 
    44 static void disasmModRMReg(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam, int fRegAddr);
    45 static void disasmModRMReg16(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam);
    46 static void disasmModRMSReg(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam);
     36static int      disInstrWorker(PDISCPUSTATE pCpu, RTUINTPTR uInstrAddr, PCDISOPCODE paOneByteMap, uint32_t *pcbInstr);
     37static unsigned disParseInstruction(RTUINTPTR uCodePtr, PCDISOPCODE pOp, PDISCPUSTATE pCpu);
     38
     39static unsigned QueryModRM(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc = NULL);
     40static unsigned QueryModRM_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc = NULL);
     41static void     UseSIB(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
     42static unsigned ParseSIB_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
     43
     44static void     disasmModRMReg(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam, int fRegAddr);
     45static void     disasmModRMReg16(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam);
     46static void     disasmModRMSReg(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam);
     47
     48static void     disValidateLockSequence(PDISCPUSTATE pCpu);
     49
     50/* Read functions */
     51static uint8_t  disReadByte(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
     52static uint16_t disReadWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
     53static uint32_t disReadDWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
     54static uint64_t disReadQWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
     55static DECLCALLBACK(int) disReadBytesDefault(PDISCPUSTATE pCpu, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead);
    4756
    4857
     
    105114static FNDISPARSE ParseXb;
    106115
    107 /* Floating point parsing */
     116/** Floating point parsing */
    108117static FNDISPARSE ParseEscFP;
    109118/** @}  */
     
    114123*******************************************************************************/
    115124/** Parser opcode table for full disassembly. */
    116 PFNDISPARSE  g_apfnFullDisasm[IDX_ParseMax] =
     125static PFNDISPARSE  g_apfnFullDisasm[IDX_ParseMax] =
    117126{
    118127    ParseIllegal,
     
    160169
    161170/** Parser opcode table for only calculating instruction size. */
    162 PFNDISPARSE  g_apfnCalcSize[IDX_ParseMax] =
     171static PFNDISPARSE  g_apfnCalcSize[IDX_ParseMax] =
    163172{
    164173    ParseIllegal,
     
    275284                       PDISCPUSTATE pCpu, uint32_t *pcbInstr)
    276285{
    277     const OPCODE *paOneByteMap;
     286    PCDISOPCODE paOneByteMap;
    278287
    279288    /*
     
    305314    pCpu->apvUserData[0]    = pvUser;
    306315
    307     return disCoreParseInstr(pCpu, uInstrAddr, paOneByteMap, pcbInstr);
     316    return disInstrWorker(pCpu, uInstrAddr, paOneByteMap, pcbInstr);
    308317}
    309318
    310319
    311320/**
    312  * Internal worker for DISCoreOne and DISCoreOneEx.
     321 * Internal worker for DISInstEx.
    313322 *
    314323 * @returns VBox status code.
     
    318327 * @param   pcbInstr        Where to store the instruction size. Can be NULL.
    319328 */
    320 static int disCoreParseInstr(PDISCPUSTATE pCpu, RTUINTPTR uInstrAddr, const OPCODE *paOneByteMap, uint32_t *pcbInstr)
     329static int disInstrWorker(PDISCPUSTATE pCpu, RTUINTPTR uInstrAddr, PCDISOPCODE paOneByteMap, uint32_t *pcbInstr)
    321330{
    322331    /*
     
    327336    for (;;)
    328337    {
    329         uint8_t codebyte = DISReadByte(pCpu, uInstrAddr+iByte);
     338        uint8_t codebyte = disReadByte(pCpu, uInstrAddr+iByte);
    330339        uint8_t opcode   = paOneByteMap[codebyte].opcode;
    331340
     
    420429        pCpu->opcode = codebyte;
    421430
    422         cbInc = ParseInstruction(uInstrAddr + iByte, &paOneByteMap[pCpu->opcode], pCpu);
     431        cbInc = disParseInstruction(uInstrAddr + iByte, &paOneByteMap[pCpu->opcode], pCpu);
    423432        iByte += cbInc;
    424433        break;
     
    437446//*****************************************************************************
    438447//*****************************************************************************
    439 unsigned ParseInstruction(RTUINTPTR uCodePtr, PCOPCODE pOp, PDISCPUSTATE pCpu)
     448static unsigned disParseInstruction(RTUINTPTR uCodePtr, PCDISOPCODE pOp, PDISCPUSTATE pCpu)
    440449{
    441450    int  size = 0;
     
    512521/* Floating point opcode parsing */
    513522//*****************************************************************************
    514 unsigned ParseEscFP(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     523unsigned ParseEscFP(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    515524{
    516525    int index;
    517     const OPCODE *fpop;
     526    PCDISOPCODE fpop;
    518527    unsigned size = 0;
    519528    unsigned ModRM;
    520529    NOREF(pOp);
    521530
    522     ModRM = DISReadByte(pCpu, uCodePtr);
     531    ModRM = disReadByte(pCpu, uCodePtr);
    523532
    524533    index = pCpu->opcode - 0xD8;
     
    526535    {
    527536        fpop            = &(g_paMapX86_FP_Low[index])[MODRM_REG(ModRM)];
    528         pCpu->pCurInstr = (PCOPCODE)fpop;
     537        pCpu->pCurInstr = (PCDISOPCODE)fpop;
    529538
    530539        // Should contain the parameter type on input
     
    535544    {
    536545        fpop            = &(g_paMapX86_FP_High[index])[ModRM - 0xC0];
    537         pCpu->pCurInstr = (PCOPCODE)fpop;
     546        pCpu->pCurInstr = (PCDISOPCODE)fpop;
    538547    }
    539548
     
    565574
    566575    if (fpop->idxParse1 != IDX_ParseNop)
    567         size += pCpu->pfnDisasmFnTable[fpop->idxParse1](uCodePtr+size, (PCOPCODE)fpop, pParam, pCpu);
     576        size += pCpu->pfnDisasmFnTable[fpop->idxParse1](uCodePtr+size, (PCDISOPCODE)fpop, pParam, pCpu);
    568577
    569578    if (fpop->idxParse2 != IDX_ParseNop)
    570         size += pCpu->pfnDisasmFnTable[fpop->idxParse2](uCodePtr+size, (PCOPCODE)fpop, pParam, pCpu);
     579        size += pCpu->pfnDisasmFnTable[fpop->idxParse2](uCodePtr+size, (PCDISOPCODE)fpop, pParam, pCpu);
    571580
    572581    // Store the opcode format string for disasmPrintf
     
    590599#endif
    591600//*****************************************************************************
    592 void UseSIB(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     601void UseSIB(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    593602{
    594603    unsigned scale, base, index, regtype;
     
    649658//*****************************************************************************
    650659//*****************************************************************************
    651 unsigned ParseSIB(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     660unsigned ParseSIB(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    652661{
    653662    unsigned size = sizeof(uint8_t);
     
    655664    NOREF(pOp); NOREF(pParam);
    656665
    657     SIB = DISReadByte(pCpu, uCodePtr);
     666    SIB = disReadByte(pCpu, uCodePtr);
    658667    uCodePtr += size;
    659668
     
    675684    {
    676685        /* Additional 32 bits displacement. No change in long mode. */
    677         pCpu->i32SibDisp = DISReadDWord(pCpu, uCodePtr);
     686        pCpu->i32SibDisp = disReadDWord(pCpu, uCodePtr);
    678687        size += sizeof(int32_t);
    679688    }
     
    682691//*****************************************************************************
    683692//*****************************************************************************
    684 unsigned ParseSIB_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     693unsigned ParseSIB_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    685694{
    686695    unsigned size = sizeof(uint8_t);
     
    688697    NOREF(pOp); NOREF(pParam);
    689698
    690     SIB = DISReadByte(pCpu, uCodePtr);
     699    SIB = disReadByte(pCpu, uCodePtr);
    691700    uCodePtr += size;
    692701
     
    716725// Mod    Reg/Opcode  R/M
    717726//*****************************************************************************
    718 unsigned UseModRM(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     727unsigned UseModRM(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    719728{
    720729    int      vtype = OP_PARM_VTYPE(pParam->param);
     
    893902// Query the size of the ModRM parameters and fetch the immediate data (if any)
    894903//*****************************************************************************
    895 unsigned QueryModRM(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
     904unsigned QueryModRM(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
    896905{
    897906    unsigned sibinc;
     
    924933        case 0: /* Effective address */
    925934            if (rm == 5) {  /* 32 bits displacement */
    926                 pCpu->i32SibDisp = DISReadDWord(pCpu, uCodePtr);
     935                pCpu->i32SibDisp = disReadDWord(pCpu, uCodePtr);
    927936                size += sizeof(int32_t);
    928937            }
     
    931940
    932941        case 1: /* Effective address + 8 bits displacement */
    933             pCpu->i32SibDisp = (int8_t)DISReadByte(pCpu, uCodePtr);
     942            pCpu->i32SibDisp = (int8_t)disReadByte(pCpu, uCodePtr);
    934943            size += sizeof(char);
    935944            break;
    936945
    937946        case 2: /* Effective address + 32 bits displacement */
    938             pCpu->i32SibDisp = DISReadDWord(pCpu, uCodePtr);
     947            pCpu->i32SibDisp = disReadDWord(pCpu, uCodePtr);
    939948            size += sizeof(int32_t);
    940949            break;
     
    951960        case 0: /* Effective address */
    952961            if (rm == 6) {
    953                 pCpu->i32SibDisp = DISReadWord(pCpu, uCodePtr);
     962                pCpu->i32SibDisp = disReadWord(pCpu, uCodePtr);
    954963                size += sizeof(uint16_t);
    955964            }
     
    958967
    959968        case 1: /* Effective address + 8 bits displacement */
    960             pCpu->i32SibDisp = (int8_t)DISReadByte(pCpu, uCodePtr);
     969            pCpu->i32SibDisp = (int8_t)disReadByte(pCpu, uCodePtr);
    961970            size += sizeof(char);
    962971            break;
    963972
    964973        case 2: /* Effective address + 32 bits displacement */
    965             pCpu->i32SibDisp = (int16_t)DISReadWord(pCpu, uCodePtr);
     974            pCpu->i32SibDisp = (int16_t)disReadWord(pCpu, uCodePtr);
    966975            size += sizeof(uint16_t);
    967976            break;
     
    976985// Query the size of the ModRM parameters and fetch the immediate data (if any)
    977986//*****************************************************************************
    978 unsigned QueryModRM_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
     987unsigned QueryModRM_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
    979988{
    980989    unsigned sibinc;
     
    10511060//*****************************************************************************
    10521061//*****************************************************************************
    1053 unsigned ParseIllegal(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1062unsigned ParseIllegal(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    10541063{
    10551064    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    10591068//*****************************************************************************
    10601069//*****************************************************************************
    1061 unsigned ParseModRM(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1070unsigned ParseModRM(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    10621071{
    10631072    unsigned size = sizeof(uint8_t);   //ModRM byte
    10641073    unsigned sibinc, ModRM;
    10651074
    1066     ModRM = DISReadByte(pCpu, uCodePtr);
     1075    ModRM = disReadByte(pCpu, uCodePtr);
    10671076    uCodePtr += sizeof(uint8_t);
    10681077
     
    11051114//*****************************************************************************
    11061115//*****************************************************************************
    1107 unsigned ParseModRM_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1116unsigned ParseModRM_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11081117{
    11091118    unsigned size = sizeof(uint8_t);   //ModRM byte
    11101119    unsigned sibinc, ModRM;
    11111120
    1112     ModRM = DISReadByte(pCpu, uCodePtr);
     1121    ModRM = disReadByte(pCpu, uCodePtr);
    11131122    uCodePtr += sizeof(uint8_t);
    11141123
     
    11521161//*****************************************************************************
    11531162//*****************************************************************************
    1154 unsigned ParseModFence(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1163unsigned ParseModFence(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11551164{
    11561165    ////AssertMsgFailed(("??\n"));
     
    11611170//*****************************************************************************
    11621171//*****************************************************************************
    1163 unsigned ParseImmByte(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1172unsigned ParseImmByte(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11641173{
    11651174    NOREF(pOp);
    1166     pParam->parval = DISReadByte(pCpu, uCodePtr);
     1175    pParam->parval = disReadByte(pCpu, uCodePtr);
    11671176    pParam->fUse  |= DISUSE_IMMEDIATE8;
    11681177    pParam->cb     = sizeof(uint8_t);
     
    11711180//*****************************************************************************
    11721181//*****************************************************************************
    1173 unsigned ParseImmByte_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1182unsigned ParseImmByte_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11741183{
    11751184    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    11781187//*****************************************************************************
    11791188//*****************************************************************************
    1180 unsigned ParseImmByteSX(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1189unsigned ParseImmByteSX(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11811190{
    11821191    NOREF(pOp);
    11831192    if (pCpu->opmode == DISCPUMODE_32BIT)
    11841193    {
    1185         pParam->parval = (uint32_t)(int8_t)DISReadByte(pCpu, uCodePtr);
     1194        pParam->parval = (uint32_t)(int8_t)disReadByte(pCpu, uCodePtr);
    11861195        pParam->fUse  |= DISUSE_IMMEDIATE32_SX8;
    11871196        pParam->cb     = sizeof(uint32_t);
     
    11901199    if (pCpu->opmode == DISCPUMODE_64BIT)
    11911200    {
    1192         pParam->parval = (uint64_t)(int8_t)DISReadByte(pCpu, uCodePtr);
     1201        pParam->parval = (uint64_t)(int8_t)disReadByte(pCpu, uCodePtr);
    11931202        pParam->fUse  |= DISUSE_IMMEDIATE64_SX8;
    11941203        pParam->cb     = sizeof(uint64_t);
     
    11961205    else
    11971206    {
    1198         pParam->parval = (uint16_t)(int8_t)DISReadByte(pCpu, uCodePtr);
     1207        pParam->parval = (uint16_t)(int8_t)disReadByte(pCpu, uCodePtr);
    11991208        pParam->fUse  |= DISUSE_IMMEDIATE16_SX8;
    12001209        pParam->cb     = sizeof(uint16_t);
     
    12041213//*****************************************************************************
    12051214//*****************************************************************************
    1206 unsigned ParseImmByteSX_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1215unsigned ParseImmByteSX_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12071216{
    12081217    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    12111220//*****************************************************************************
    12121221//*****************************************************************************
    1213 unsigned ParseImmUshort(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1222unsigned ParseImmUshort(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12141223{
    12151224    NOREF(pOp);
    1216     pParam->parval = DISReadWord(pCpu, uCodePtr);
     1225    pParam->parval = disReadWord(pCpu, uCodePtr);
    12171226    pParam->fUse  |= DISUSE_IMMEDIATE16;
    12181227    pParam->cb     = sizeof(uint16_t);
     
    12211230//*****************************************************************************
    12221231//*****************************************************************************
    1223 unsigned ParseImmUshort_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1232unsigned ParseImmUshort_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12241233{
    12251234    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    12281237//*****************************************************************************
    12291238//*****************************************************************************
    1230 unsigned ParseImmUlong(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1239unsigned ParseImmUlong(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12311240{
    12321241    NOREF(pOp);
    1233     pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1242    pParam->parval = disReadDWord(pCpu, uCodePtr);
    12341243    pParam->fUse  |= DISUSE_IMMEDIATE32;
    12351244    pParam->cb     = sizeof(uint32_t);
     
    12381247//*****************************************************************************
    12391248//*****************************************************************************
    1240 unsigned ParseImmUlong_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1249unsigned ParseImmUlong_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12411250{
    12421251    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    12451254//*****************************************************************************
    12461255//*****************************************************************************
    1247 unsigned ParseImmQword(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1256unsigned ParseImmQword(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12481257{
    12491258    NOREF(pOp);
    1250     pParam->parval = DISReadQWord(pCpu, uCodePtr);
     1259    pParam->parval = disReadQWord(pCpu, uCodePtr);
    12511260    pParam->fUse  |= DISUSE_IMMEDIATE64;
    12521261    pParam->cb     = sizeof(uint64_t);
     
    12551264//*****************************************************************************
    12561265//*****************************************************************************
    1257 unsigned ParseImmQword_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1266unsigned ParseImmQword_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12581267{
    12591268    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    12621271//*****************************************************************************
    12631272//*****************************************************************************
    1264 unsigned ParseImmV(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1273unsigned ParseImmV(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12651274{
    12661275    NOREF(pOp);
    12671276    if (pCpu->opmode == DISCPUMODE_32BIT)
    12681277    {
    1269         pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1278        pParam->parval = disReadDWord(pCpu, uCodePtr);
    12701279        pParam->fUse  |= DISUSE_IMMEDIATE32;
    12711280        pParam->cb     = sizeof(uint32_t);
     
    12751284    if (pCpu->opmode == DISCPUMODE_64BIT)
    12761285    {
    1277         pParam->parval = DISReadQWord(pCpu, uCodePtr);
     1286        pParam->parval = disReadQWord(pCpu, uCodePtr);
    12781287        pParam->fUse  |= DISUSE_IMMEDIATE64;
    12791288        pParam->cb     = sizeof(uint64_t);
     
    12811290    }
    12821291
    1283     pParam->parval = DISReadWord(pCpu, uCodePtr);
     1292    pParam->parval = disReadWord(pCpu, uCodePtr);
    12841293    pParam->fUse  |= DISUSE_IMMEDIATE16;
    12851294    pParam->cb     = sizeof(uint16_t);
     
    12881297//*****************************************************************************
    12891298//*****************************************************************************
    1290 unsigned ParseImmV_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1299unsigned ParseImmV_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    12911300{
    12921301    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam);
     
    12991308//*****************************************************************************
    13001309//*****************************************************************************
    1301 unsigned ParseImmZ(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1310unsigned ParseImmZ(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13021311{
    13031312    NOREF(pOp);
     
    13051314    if (pCpu->opmode == DISCPUMODE_16BIT)
    13061315    {
    1307         pParam->parval = DISReadWord(pCpu, uCodePtr);
     1316        pParam->parval = disReadWord(pCpu, uCodePtr);
    13081317        pParam->fUse  |= DISUSE_IMMEDIATE16;
    13091318        pParam->cb     = sizeof(uint16_t);
     
    13141323    if (pCpu->opmode == DISCPUMODE_64BIT)
    13151324    {
    1316         pParam->parval = (uint64_t)(int32_t)DISReadDWord(pCpu, uCodePtr);
     1325        pParam->parval = (uint64_t)(int32_t)disReadDWord(pCpu, uCodePtr);
    13171326        pParam->fUse  |= DISUSE_IMMEDIATE64;
    13181327        pParam->cb     = sizeof(uint64_t);
     
    13201329    else
    13211330    {
    1322         pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1331        pParam->parval = disReadDWord(pCpu, uCodePtr);
    13231332        pParam->fUse  |= DISUSE_IMMEDIATE32;
    13241333        pParam->cb     = sizeof(uint32_t);
     
    13281337//*****************************************************************************
    13291338//*****************************************************************************
    1330 unsigned ParseImmZ_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1339unsigned ParseImmZ_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13311340{
    13321341    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam);
     
    13401349// Relative displacement for branches (rel. to next instruction)
    13411350//*****************************************************************************
    1342 unsigned ParseImmBRel(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1351unsigned ParseImmBRel(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13431352{
    13441353    NOREF(pOp);
    1345     pParam->parval = DISReadByte(pCpu, uCodePtr);
     1354    pParam->parval = disReadByte(pCpu, uCodePtr);
    13461355    pParam->fUse  |= DISUSE_IMMEDIATE8_REL;
    13471356    pParam->cb     = sizeof(uint8_t);
     
    13511360// Relative displacement for branches (rel. to next instruction)
    13521361//*****************************************************************************
    1353 unsigned ParseImmBRel_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1362unsigned ParseImmBRel_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13541363{
    13551364    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam); NOREF(pCpu);
     
    13591368// Relative displacement for branches (rel. to next instruction)
    13601369//*****************************************************************************
    1361 unsigned ParseImmVRel(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1370unsigned ParseImmVRel(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13621371{
    13631372    NOREF(pOp);
    13641373    if (pCpu->opmode == DISCPUMODE_32BIT)
    13651374    {
    1366         pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1375        pParam->parval = disReadDWord(pCpu, uCodePtr);
    13671376        pParam->fUse  |= DISUSE_IMMEDIATE32_REL;
    13681377        pParam->cb     = sizeof(int32_t);
     
    13731382    {
    13741383        /* 32 bits relative immediate sign extended to 64 bits. */
    1375         pParam->parval = (uint64_t)(int32_t)DISReadDWord(pCpu, uCodePtr);
     1384        pParam->parval = (uint64_t)(int32_t)disReadDWord(pCpu, uCodePtr);
    13761385        pParam->fUse  |= DISUSE_IMMEDIATE64_REL;
    13771386        pParam->cb     = sizeof(int64_t);
     
    13791388    }
    13801389
    1381     pParam->parval = DISReadWord(pCpu, uCodePtr);
     1390    pParam->parval = disReadWord(pCpu, uCodePtr);
    13821391    pParam->fUse  |= DISUSE_IMMEDIATE16_REL;
    13831392    pParam->cb     = sizeof(int16_t);
     
    13871396// Relative displacement for branches (rel. to next instruction)
    13881397//*****************************************************************************
    1389 unsigned ParseImmVRel_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1398unsigned ParseImmVRel_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    13901399{
    13911400    NOREF(uCodePtr); NOREF(pOp); NOREF(pParam);
     
    13971406//*****************************************************************************
    13981407//*****************************************************************************
    1399 unsigned ParseImmAddr(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1408unsigned ParseImmAddr(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    14001409{
    14011410    if (pCpu->addrmode == DISCPUMODE_32BIT)
     
    14041413        {
    14051414            /* far 16:32 pointer */
    1406             pParam->parval = DISReadDWord(pCpu, uCodePtr);
    1407             *((uint32_t*)&pParam->parval+1) = DISReadWord(pCpu, uCodePtr+sizeof(uint32_t));
     1415            pParam->parval = disReadDWord(pCpu, uCodePtr);
     1416            *((uint32_t*)&pParam->parval+1) = disReadWord(pCpu, uCodePtr+sizeof(uint32_t));
    14081417            pParam->fUse   |= DISUSE_IMMEDIATE_ADDR_16_32;
    14091418            pParam->cb     = sizeof(uint16_t) + sizeof(uint32_t);
     
    14171426         * so we treat it like displacement.
    14181427         */
    1419         pParam->uDisp.i32 = DISReadDWord(pCpu, uCodePtr);
     1428        pParam->uDisp.i32 = disReadDWord(pCpu, uCodePtr);
    14201429        pParam->fUse  |= DISUSE_DISPLACEMENT32;
    14211430        pParam->cb     = sizeof(uint32_t);
     
    14321441         * so we treat it like displacement.
    14331442         */
    1434         pParam->uDisp.i64 = DISReadQWord(pCpu, uCodePtr);
     1443        pParam->uDisp.i64 = disReadQWord(pCpu, uCodePtr);
    14351444        pParam->fUse  |= DISUSE_DISPLACEMENT64;
    14361445        pParam->cb     = sizeof(uint64_t);
     
    14401449    {
    14411450        /* far 16:16 pointer */
    1442         pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1451        pParam->parval = disReadDWord(pCpu, uCodePtr);
    14431452        pParam->fUse  |= DISUSE_IMMEDIATE_ADDR_16_16;
    14441453        pParam->cb     = 2*sizeof(uint16_t);
     
    14521461     * so we treat it like displacement.
    14531462     */
    1454     pParam->uDisp.i16 = DISReadWord(pCpu, uCodePtr);
     1463    pParam->uDisp.i16 = disReadWord(pCpu, uCodePtr);
    14551464    pParam->fUse  |= DISUSE_DISPLACEMENT16;
    14561465    pParam->cb     = sizeof(uint16_t);
     
    14591468//*****************************************************************************
    14601469//*****************************************************************************
    1461 unsigned ParseImmAddr_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1470unsigned ParseImmAddr_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    14621471{
    14631472    NOREF(uCodePtr); NOREF(pOp);
     
    14921501//*****************************************************************************
    14931502//*****************************************************************************
    1494 unsigned ParseImmAddrF(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1503unsigned ParseImmAddrF(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    14951504{
    14961505    // immediate far pointers - only 16:16 or 16:32; determined by operand, *not* address size!
     
    15001509    {
    15011510        // far 16:32 pointer
    1502         pParam->parval = DISReadDWord(pCpu, uCodePtr);
    1503         *((uint32_t*)&pParam->parval+1) = DISReadWord(pCpu, uCodePtr+sizeof(uint32_t));
     1511        pParam->parval = disReadDWord(pCpu, uCodePtr);
     1512        *((uint32_t*)&pParam->parval+1) = disReadWord(pCpu, uCodePtr+sizeof(uint32_t));
    15041513        pParam->fUse   |= DISUSE_IMMEDIATE_ADDR_16_32;
    15051514        pParam->cb     = sizeof(uint16_t) + sizeof(uint32_t);
     
    15081517
    15091518    // far 16:16 pointer
    1510     pParam->parval = DISReadDWord(pCpu, uCodePtr);
     1519    pParam->parval = disReadDWord(pCpu, uCodePtr);
    15111520    pParam->fUse  |= DISUSE_IMMEDIATE_ADDR_16_16;
    15121521    pParam->cb     = 2*sizeof(uint16_t);
     
    15151524//*****************************************************************************
    15161525//*****************************************************************************
    1517 unsigned ParseImmAddrF_SizeOnly(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1526unsigned ParseImmAddrF_SizeOnly(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    15181527{
    15191528    NOREF(uCodePtr); NOREF(pOp);
     
    15341543//*****************************************************************************
    15351544//*****************************************************************************
    1536 unsigned ParseFixedReg(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1545unsigned ParseFixedReg(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    15371546{
    15381547    NOREF(uCodePtr);
     
    16351644//*****************************************************************************
    16361645//*****************************************************************************
    1637 unsigned ParseXv(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1646unsigned ParseXv(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    16381647{
    16391648    NOREF(uCodePtr);
     
    16601669//*****************************************************************************
    16611670//*****************************************************************************
    1662 unsigned ParseXb(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1671unsigned ParseXb(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    16631672{
    16641673    NOREF(uCodePtr); NOREF(pOp);
     
    16851694//*****************************************************************************
    16861695//*****************************************************************************
    1687 unsigned ParseYv(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1696unsigned ParseYv(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    16881697{
    16891698    NOREF(uCodePtr);
     
    17101719//*****************************************************************************
    17111720//*****************************************************************************
    1712 unsigned ParseYb(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1721unsigned ParseYb(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    17131722{
    17141723    NOREF(uCodePtr); NOREF(pOp);
     
    17351744//*****************************************************************************
    17361745//*****************************************************************************
    1737 unsigned ParseTwoByteEsc(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    1738 {
    1739     const OPCODE *pOpcode;
     1746unsigned ParseTwoByteEsc(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1747{
     1748    PCDISOPCODE   pOpcode;
    17401749    int           size    = sizeof(uint8_t);
    17411750    NOREF(pOp); NOREF(pParam);
    17421751
    17431752    /* 2nd byte */
    1744     pCpu->opcode = DISReadByte(pCpu, uCodePtr);
     1753    pCpu->opcode = disReadByte(pCpu, uCodePtr);
    17451754
    17461755    /* default to the non-prefixed table. */
     
    17891798    }
    17901799
    1791     size += ParseInstruction(uCodePtr+size, pOpcode, pCpu);
    1792     return size;
    1793 }
    1794 //*****************************************************************************
    1795 //*****************************************************************************
    1796 unsigned ParseThreeByteEsc4(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    1797 {
    1798     const OPCODE *pOpcode;
     1800    size += disParseInstruction(uCodePtr+size, pOpcode, pCpu);
     1801    return size;
     1802}
     1803//*****************************************************************************
     1804//*****************************************************************************
     1805unsigned ParseThreeByteEsc4(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1806{
     1807    PCDISOPCODE   pOpcode;
    17991808    int           size    = sizeof(uint8_t);
    18001809    NOREF(pOp); NOREF(pParam);
    18011810
    18021811    /* 3rd byte */
    1803     pCpu->opcode = DISReadByte(pCpu, uCodePtr);
     1812    pCpu->opcode = disReadByte(pCpu, uCodePtr);
    18041813
    18051814    /* default to the non-prefixed table. */
     
    18501859    }
    18511860
    1852     size += ParseInstruction(uCodePtr+size, pOpcode, pCpu);
    1853     return size;
    1854 }
    1855 //*****************************************************************************
    1856 //*****************************************************************************
    1857 unsigned ParseThreeByteEsc5(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    1858 {
    1859     const OPCODE *pOpcode;
     1861    size += disParseInstruction(uCodePtr+size, pOpcode, pCpu);
     1862    return size;
     1863}
     1864//*****************************************************************************
     1865//*****************************************************************************
     1866unsigned ParseThreeByteEsc5(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1867{
     1868    PCDISOPCODE   pOpcode;
    18601869    int           size    = sizeof(uint8_t);
    18611870    NOREF(pOp); NOREF(pParam);
    18621871
    18631872    /* 3rd byte */
    1864     pCpu->opcode = DISReadByte(pCpu, uCodePtr);
     1873    pCpu->opcode = disReadByte(pCpu, uCodePtr);
    18651874
    18661875    /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */
     
    18851894        pOpcode = &g_InvalidOpcode[0];
    18861895
    1887     size += ParseInstruction(uCodePtr+size, pOpcode, pCpu);
    1888     return size;
    1889 }
    1890 //*****************************************************************************
    1891 //*****************************************************************************
    1892 unsigned ParseNopPause(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1896    size += disParseInstruction(uCodePtr+size, pOpcode, pCpu);
     1897    return size;
     1898}
     1899//*****************************************************************************
     1900//*****************************************************************************
     1901unsigned ParseNopPause(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    18931902{
    18941903    unsigned size = 0;
     
    19031912        pOp = &g_aMapX86_NopPause[0]; /* NOP */
    19041913
    1905     size += ParseInstruction(uCodePtr, pOp, pCpu);
    1906     return size;
    1907 }
    1908 //*****************************************************************************
    1909 //*****************************************************************************
    1910 unsigned ParseImmGrpl(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1914    size += disParseInstruction(uCodePtr, pOp, pCpu);
     1915    return size;
     1916}
     1917//*****************************************************************************
     1918//*****************************************************************************
     1919unsigned ParseImmGrpl(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    19111920{
    19121921    int idx = (pCpu->opcode - 0x80) * 8;
     
    19141923    NOREF(pParam);
    19151924
    1916     modrm = DISReadByte(pCpu, uCodePtr);
     1925    modrm = disReadByte(pCpu, uCodePtr);
    19171926    reg   = MODRM_REG(modrm);
    19181927
    1919     pOp = (PCOPCODE)&g_aMapX86_Group1[idx+reg];
     1928    pOp = (PCDISOPCODE)&g_aMapX86_Group1[idx+reg];
    19201929    //little hack to make sure the ModRM byte is included in the returned size
    19211930    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
    19221931        size = sizeof(uint8_t); //ModRM byte
    19231932
    1924     size += ParseInstruction(uCodePtr, pOp, pCpu);
    1925 
    1926     return size;
    1927 }
    1928 //*****************************************************************************
    1929 //*****************************************************************************
    1930 unsigned ParseShiftGrp2(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1933    size += disParseInstruction(uCodePtr, pOp, pCpu);
     1934
     1935    return size;
     1936}
     1937//*****************************************************************************
     1938//*****************************************************************************
     1939unsigned ParseShiftGrp2(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    19311940{
    19321941    int idx;
     
    19531962    }
    19541963
    1955     modrm = DISReadByte(pCpu, uCodePtr);
     1964    modrm = disReadByte(pCpu, uCodePtr);
    19561965    reg   = MODRM_REG(modrm);
    19571966
    1958     pOp = (PCOPCODE)&g_aMapX86_Group2[idx+reg];
     1967    pOp = (PCDISOPCODE)&g_aMapX86_Group2[idx+reg];
    19591968
    19601969    //little hack to make sure the ModRM byte is included in the returned size
     
    19621971        size = sizeof(uint8_t); //ModRM byte
    19631972
    1964     size += ParseInstruction(uCodePtr, pOp, pCpu);
    1965 
    1966     return size;
    1967 }
    1968 //*****************************************************************************
    1969 //*****************************************************************************
    1970 unsigned ParseGrp3(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1973    size += disParseInstruction(uCodePtr, pOp, pCpu);
     1974
     1975    return size;
     1976}
     1977//*****************************************************************************
     1978//*****************************************************************************
     1979unsigned ParseGrp3(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    19711980{
    19721981    int idx = (pCpu->opcode - 0xF6) * 8;
     
    19741983    NOREF(pParam);
    19751984
    1976     modrm = DISReadByte(pCpu, uCodePtr);
     1985    modrm = disReadByte(pCpu, uCodePtr);
    19771986    reg   = MODRM_REG(modrm);
    19781987
    1979     pOp = (PCOPCODE)&g_aMapX86_Group3[idx+reg];
     1988    pOp = (PCDISOPCODE)&g_aMapX86_Group3[idx+reg];
    19801989
    19811990    //little hack to make sure the ModRM byte is included in the returned size
     
    19831992        size = sizeof(uint8_t); //ModRM byte
    19841993
    1985     size += ParseInstruction(uCodePtr, pOp, pCpu);
    1986 
    1987     return size;
    1988 }
    1989 //*****************************************************************************
    1990 //*****************************************************************************
    1991 unsigned ParseGrp4(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     1994    size += disParseInstruction(uCodePtr, pOp, pCpu);
     1995
     1996    return size;
     1997}
     1998//*****************************************************************************
     1999//*****************************************************************************
     2000unsigned ParseGrp4(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    19922001{
    19932002    unsigned size = 0, modrm, reg;
    19942003    NOREF(pParam);
    19952004
    1996     modrm = DISReadByte(pCpu, uCodePtr);
     2005    modrm = disReadByte(pCpu, uCodePtr);
    19972006    reg   = MODRM_REG(modrm);
    19982007
    1999     pOp = (PCOPCODE)&g_aMapX86_Group4[reg];
     2008    pOp = (PCDISOPCODE)&g_aMapX86_Group4[reg];
    20002009
    20012010    //little hack to make sure the ModRM byte is included in the returned size
     
    20032012        size = sizeof(uint8_t); //ModRM byte
    20042013
    2005     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2006 
    2007     return size;
    2008 }
    2009 //*****************************************************************************
    2010 //*****************************************************************************
    2011 unsigned ParseGrp5(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2014    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2015
     2016    return size;
     2017}
     2018//*****************************************************************************
     2019//*****************************************************************************
     2020unsigned ParseGrp5(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    20122021{
    20132022    unsigned size = 0, modrm, reg;
    20142023    NOREF(pParam);
    20152024
    2016     modrm = DISReadByte(pCpu, uCodePtr);
     2025    modrm = disReadByte(pCpu, uCodePtr);
    20172026    reg   = MODRM_REG(modrm);
    20182027
    2019     pOp = (PCOPCODE)&g_aMapX86_Group5[reg];
     2028    pOp = (PCDISOPCODE)&g_aMapX86_Group5[reg];
    20202029
    20212030    //little hack to make sure the ModRM byte is included in the returned size
     
    20232032        size = sizeof(uint8_t); //ModRM byte
    20242033
    2025     size += ParseInstruction(uCodePtr, pOp, pCpu);
     2034    size += disParseInstruction(uCodePtr, pOp, pCpu);
    20262035
    20272036    return size;
     
    20332042//
    20342043//*****************************************************************************
    2035 unsigned Parse3DNow(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2044unsigned Parse3DNow(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    20362045{
    20372046    unsigned size = 0, modrmsize;
     
    20422051#endif
    20432052
    2044     unsigned ModRM = DISReadByte(pCpu, uCodePtr);
     2053    unsigned ModRM = disReadByte(pCpu, uCodePtr);
    20452054    pCpu->ModRM.Bits.Rm  = MODRM_RM(ModRM);
    20462055    pCpu->ModRM.Bits.Mod = MODRM_MOD(ModRM);
     
    20492058    modrmsize = QueryModRM(uCodePtr+sizeof(uint8_t), pOp, pParam, pCpu);
    20502059
    2051     uint8_t opcode = DISReadByte(pCpu, uCodePtr+sizeof(uint8_t)+modrmsize);
    2052 
    2053     pOp = (PCOPCODE)&g_aTwoByteMapX86_3DNow[opcode];
     2060    uint8_t opcode = disReadByte(pCpu, uCodePtr+sizeof(uint8_t)+modrmsize);
     2061
     2062    pOp = (PCDISOPCODE)&g_aTwoByteMapX86_3DNow[opcode];
    20542063
    20552064    //little hack to make sure the ModRM byte is included in the returned size
     
    20622071    }
    20632072
    2064     size += ParseInstruction(uCodePtr, pOp, pCpu);
     2073    size += disParseInstruction(uCodePtr, pOp, pCpu);
    20652074    size += sizeof(uint8_t);   //imm8_opcode uint8_t
    20662075
     
    20692078//*****************************************************************************
    20702079//*****************************************************************************
    2071 unsigned ParseGrp6(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2080unsigned ParseGrp6(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    20722081{
    20732082    unsigned size = 0, modrm, reg;
    20742083    NOREF(pParam);
    20752084
    2076     modrm = DISReadByte(pCpu, uCodePtr);
     2085    modrm = disReadByte(pCpu, uCodePtr);
    20772086    reg   = MODRM_REG(modrm);
    20782087
    2079     pOp = (PCOPCODE)&g_aMapX86_Group6[reg];
     2088    pOp = (PCDISOPCODE)&g_aMapX86_Group6[reg];
    20802089
    20812090    //little hack to make sure the ModRM byte is included in the returned size
     
    20832092        size = sizeof(uint8_t); //ModRM byte
    20842093
    2085     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2086 
    2087     return size;
    2088 }
    2089 //*****************************************************************************
    2090 //*****************************************************************************
    2091 unsigned ParseGrp7(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2094    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2095
     2096    return size;
     2097}
     2098//*****************************************************************************
     2099//*****************************************************************************
     2100unsigned ParseGrp7(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    20922101{
    20932102    unsigned size = 0, modrm, reg, rm, mod;
    20942103    NOREF(pParam);
    20952104
    2096     modrm = DISReadByte(pCpu, uCodePtr);
     2105    modrm = disReadByte(pCpu, uCodePtr);
    20972106    mod   = MODRM_MOD(modrm);
    20982107    reg   = MODRM_REG(modrm);
     
    21002109
    21012110    if (mod == 3 && rm == 0)
    2102         pOp = (PCOPCODE)&g_aMapX86_Group7_mod11_rm000[reg];
     2111        pOp = (PCDISOPCODE)&g_aMapX86_Group7_mod11_rm000[reg];
    21032112    else
    21042113    if (mod == 3 && rm == 1)
    2105         pOp = (PCOPCODE)&g_aMapX86_Group7_mod11_rm001[reg];
    2106     else
    2107         pOp = (PCOPCODE)&g_aMapX86_Group7_mem[reg];
     2114        pOp = (PCDISOPCODE)&g_aMapX86_Group7_mod11_rm001[reg];
     2115    else
     2116        pOp = (PCDISOPCODE)&g_aMapX86_Group7_mem[reg];
    21082117
    21092118    //little hack to make sure the ModRM byte is included in the returned size
     
    21112120        size = sizeof(uint8_t); //ModRM byte
    21122121
    2113     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2114 
    2115     return size;
    2116 }
    2117 //*****************************************************************************
    2118 //*****************************************************************************
    2119 unsigned ParseGrp8(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2122    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2123
     2124    return size;
     2125}
     2126//*****************************************************************************
     2127//*****************************************************************************
     2128unsigned ParseGrp8(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    21202129{
    21212130    unsigned size = 0, modrm, reg;
    21222131    NOREF(pParam);
    21232132
    2124     modrm = DISReadByte(pCpu, uCodePtr);
     2133    modrm = disReadByte(pCpu, uCodePtr);
    21252134    reg   = MODRM_REG(modrm);
    21262135
    2127     pOp = (PCOPCODE)&g_aMapX86_Group8[reg];
     2136    pOp = (PCDISOPCODE)&g_aMapX86_Group8[reg];
    21282137
    21292138    //little hack to make sure the ModRM byte is included in the returned size
     
    21312140        size = sizeof(uint8_t); //ModRM byte
    21322141
    2133     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2134 
    2135     return size;
    2136 }
    2137 //*****************************************************************************
    2138 //*****************************************************************************
    2139 unsigned ParseGrp9(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2142    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2143
     2144    return size;
     2145}
     2146//*****************************************************************************
     2147//*****************************************************************************
     2148unsigned ParseGrp9(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    21402149{
    21412150    unsigned size = 0, modrm, reg;
    21422151    NOREF(pParam);
    21432152
    2144     modrm = DISReadByte(pCpu, uCodePtr);
     2153    modrm = disReadByte(pCpu, uCodePtr);
    21452154    reg   = MODRM_REG(modrm);
    21462155
    2147     pOp = (PCOPCODE)&g_aMapX86_Group9[reg];
     2156    pOp = (PCDISOPCODE)&g_aMapX86_Group9[reg];
    21482157
    21492158    //little hack to make sure the ModRM byte is included in the returned size
     
    21512160        size = sizeof(uint8_t); //ModRM byte
    21522161
    2153     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2154 
    2155     return size;
    2156 }
    2157 //*****************************************************************************
    2158 //*****************************************************************************
    2159 unsigned ParseGrp10(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2162    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2163
     2164    return size;
     2165}
     2166//*****************************************************************************
     2167//*****************************************************************************
     2168unsigned ParseGrp10(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    21602169{
    21612170    unsigned size = 0, modrm, reg;
    21622171    NOREF(pParam);
    21632172
    2164     modrm = DISReadByte(pCpu, uCodePtr);
     2173    modrm = disReadByte(pCpu, uCodePtr);
    21652174    reg   = MODRM_REG(modrm);
    21662175
    2167     pOp = (PCOPCODE)&g_aMapX86_Group10[reg];
     2176    pOp = (PCDISOPCODE)&g_aMapX86_Group10[reg];
    21682177
    21692178    //little hack to make sure the ModRM byte is included in the returned size
     
    21712180        size = sizeof(uint8_t); //ModRM byte
    21722181
    2173     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2174 
    2175     return size;
    2176 }
    2177 //*****************************************************************************
    2178 //*****************************************************************************
    2179 unsigned ParseGrp12(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2182    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2183
     2184    return size;
     2185}
     2186//*****************************************************************************
     2187//*****************************************************************************
     2188unsigned ParseGrp12(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    21802189{
    21812190    unsigned size = 0, modrm, reg;
    21822191    NOREF(pParam);
    21832192
    2184     modrm = DISReadByte(pCpu, uCodePtr);
     2193    modrm = disReadByte(pCpu, uCodePtr);
    21852194    reg   = MODRM_REG(modrm);
    21862195
     
    21882197        reg += 8;   //2nd table
    21892198
    2190     pOp = (PCOPCODE)&g_aMapX86_Group12[reg];
     2199    pOp = (PCDISOPCODE)&g_aMapX86_Group12[reg];
    21912200
    21922201    //little hack to make sure the ModRM byte is included in the returned size
     
    21942203        size = sizeof(uint8_t); //ModRM byte
    21952204
    2196     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2197     return size;
    2198 }
    2199 //*****************************************************************************
    2200 //*****************************************************************************
    2201 unsigned ParseGrp13(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2205    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2206    return size;
     2207}
     2208//*****************************************************************************
     2209//*****************************************************************************
     2210unsigned ParseGrp13(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    22022211{
    22032212    unsigned size = 0, modrm, reg;
    22042213    NOREF(pParam);
    22052214
    2206     modrm = DISReadByte(pCpu, uCodePtr);
     2215    modrm = disReadByte(pCpu, uCodePtr);
    22072216    reg   = MODRM_REG(modrm);
    22082217    if (pCpu->prefix & DISPREFIX_OPSIZE)
    22092218        reg += 8;   //2nd table
    22102219
    2211     pOp = (PCOPCODE)&g_aMapX86_Group13[reg];
     2220    pOp = (PCDISOPCODE)&g_aMapX86_Group13[reg];
    22122221
    22132222    //little hack to make sure the ModRM byte is included in the returned size
     
    22152224        size = sizeof(uint8_t); //ModRM byte
    22162225
    2217     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2218 
    2219     return size;
    2220 }
    2221 //*****************************************************************************
    2222 //*****************************************************************************
    2223 unsigned ParseGrp14(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2226    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2227
     2228    return size;
     2229}
     2230//*****************************************************************************
     2231//*****************************************************************************
     2232unsigned ParseGrp14(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    22242233{
    22252234    unsigned size = 0, modrm, reg;
    22262235    NOREF(pParam);
    22272236
    2228     modrm = DISReadByte(pCpu, uCodePtr);
     2237    modrm = disReadByte(pCpu, uCodePtr);
    22292238    reg   = MODRM_REG(modrm);
    22302239    if (pCpu->prefix & DISPREFIX_OPSIZE)
    22312240        reg += 8;   //2nd table
    22322241
    2233     pOp = (PCOPCODE)&g_aMapX86_Group14[reg];
     2242    pOp = (PCDISOPCODE)&g_aMapX86_Group14[reg];
    22342243
    22352244    //little hack to make sure the ModRM byte is included in the returned size
     
    22372246        size = sizeof(uint8_t); //ModRM byte
    22382247
    2239     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2240 
    2241     return size;
    2242 }
    2243 //*****************************************************************************
    2244 //*****************************************************************************
    2245 unsigned ParseGrp15(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2248    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2249
     2250    return size;
     2251}
     2252//*****************************************************************************
     2253//*****************************************************************************
     2254unsigned ParseGrp15(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    22462255{
    22472256    unsigned size = 0, modrm, reg, mod, rm;
    22482257    NOREF(pParam);
    22492258
    2250     modrm = DISReadByte(pCpu, uCodePtr);
     2259    modrm = disReadByte(pCpu, uCodePtr);
    22512260    mod   = MODRM_MOD(modrm);
    22522261    reg   = MODRM_REG(modrm);
     
    22542263
    22552264    if (mod == 3 && rm == 0)
    2256         pOp = (PCOPCODE)&g_aMapX86_Group15_mod11_rm000[reg];
    2257     else
    2258         pOp = (PCOPCODE)&g_aMapX86_Group15_mem[reg];
     2265        pOp = (PCDISOPCODE)&g_aMapX86_Group15_mod11_rm000[reg];
     2266    else
     2267        pOp = (PCDISOPCODE)&g_aMapX86_Group15_mem[reg];
    22592268
    22602269    //little hack to make sure the ModRM byte is included in the returned size
     
    22622271        size = sizeof(uint8_t); //ModRM byte
    22632272
    2264     size += ParseInstruction(uCodePtr, pOp, pCpu);
    2265     return size;
    2266 }
    2267 //*****************************************************************************
    2268 //*****************************************************************************
    2269 unsigned ParseGrp16(RTUINTPTR uCodePtr, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
     2273    size += disParseInstruction(uCodePtr, pOp, pCpu);
     2274    return size;
     2275}
     2276//*****************************************************************************
     2277//*****************************************************************************
     2278unsigned ParseGrp16(RTUINTPTR uCodePtr, PCDISOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    22702279{
    22712280    unsigned size = 0, modrm, reg;
    22722281    NOREF(pParam);
    22732282
    2274     modrm = DISReadByte(pCpu, uCodePtr);
     2283    modrm = disReadByte(pCpu, uCodePtr);
    22752284    reg   = MODRM_REG(modrm);
    22762285
    2277     pOp = (PCOPCODE)&g_aMapX86_Group16[reg];
     2286    pOp = (PCDISOPCODE)&g_aMapX86_Group16[reg];
    22782287
    22792288    //little hack to make sure the ModRM byte is included in the returned size
     
    22812290        size = sizeof(uint8_t); //ModRM byte
    22822291
    2283     size += ParseInstruction(uCodePtr, pOp, pCpu);
     2292    size += disParseInstruction(uCodePtr, pOp, pCpu);
    22842293    return size;
    22852294}
     
    22962305static const int   IndexModRMReg16[4] = { USE_REG_SI, USE_REG_DI, USE_REG_SI, USE_REG_DI};
    22972306//*****************************************************************************
    2298 static void disasmModRMReg(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam, int fRegAddr)
     2307static void disasmModRMReg(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam, int fRegAddr)
    22992308{
    23002309    int subtype, type, mod;
     
    23722381//*****************************************************************************
    23732382//*****************************************************************************
    2374 static void disasmModRMReg16(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam)
     2383static void disasmModRMReg16(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam)
    23752384{
    23762385    NOREF(pCpu); NOREF(pOp);
     
    23852394//*****************************************************************************
    23862395//*****************************************************************************
    2387 static void disasmModRMSReg(PDISCPUSTATE pCpu, PCOPCODE pOp, unsigned idx, POP_PARAMETER pParam)
     2396static void disasmModRMSReg(PDISCPUSTATE pCpu, PCDISOPCODE pOp, unsigned idx, POP_PARAMETER pParam)
    23882397{
    23892398    NOREF(pOp);
     
    24732482{
    24742483#ifdef IN_RING0
    2475     AssertMsgFailed(("DISReadWord with no read callback in ring 0!!\n"));
     2484    AssertMsgFailed(("disReadWord with no read callback in ring 0!!\n"));
    24762485    RT_BZERO(pbDst, cbToRead);
    24772486    return VERR_DIS_NO_READ_CALLBACK;
     
    24852494/* Read functions for getting the opcode bytes */
    24862495//*****************************************************************************
    2487 uint8_t DISReadByte(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
     2496uint8_t disReadByte(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
    24882497{
    24892498    uint8_t bTemp = 0;
     
    24912500    if (RT_FAILURE(rc))
    24922501    {
    2493         Log(("DISReadByte failed!!\n"));
     2502        Log(("disReadByte failed!!\n"));
    24942503        pCpu->rc = VERR_DIS_MEM_READ;
    24952504    }
     
    25072516//*****************************************************************************
    25082517//*****************************************************************************
    2509 uint16_t DISReadWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
     2518uint16_t disReadWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
    25102519{
    25112520    RTUINT16U uTemp;
     
    25142523    if (RT_FAILURE(rc))
    25152524    {
    2516         Log(("DISReadWord failed!!\n"));
     2525        Log(("disReadWord failed!!\n"));
    25172526        pCpu->rc = VERR_DIS_MEM_READ;
    25182527    }
     
    25322541//*****************************************************************************
    25332542//*****************************************************************************
    2534 uint32_t DISReadDWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
     2543uint32_t disReadDWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
    25352544{
    25362545    RTUINT32U uTemp;
     
    25392548    if (RT_FAILURE(rc))
    25402549    {
    2541         Log(("DISReadDWord failed!!\n"));
     2550        Log(("disReadDWord failed!!\n"));
    25422551        pCpu->rc = VERR_DIS_MEM_READ;
    25432552    }
     
    25592568//*****************************************************************************
    25602569//*****************************************************************************
    2561 uint64_t DISReadQWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
     2570uint64_t disReadQWord(PDISCPUSTATE pCpu, RTUINTPTR uAddress)
    25622571{
    25632572    RTUINT64U uTemp;
     
    25662575    if (RT_FAILURE(rc))
    25672576    {
    2568         Log(("DISReadQWord %x failed!!\n", uAddress));
     2577        Log(("disReadQWord %x failed!!\n", uAddress));
    25692578        pCpu->rc = VERR_DIS_MEM_READ;
    25702579    }
     
    26162625 * @param   pCpu    Fully disassembled instruction.
    26172626 */
    2618 void disValidateLockSequence(PDISCPUSTATE pCpu)
     2627static void disValidateLockSequence(PDISCPUSTATE pCpu)
    26192628{
    26202629    Assert(pCpu->prefix & DISPREFIX_LOCK);
  • trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp

    r41678 r41690  
    267267        fFlags = (fFlags & ~DIS_FMT_FLAGS_BYTES_LEFT) | DIS_FMT_FLAGS_BYTES_RIGHT;
    268268
    269     PCOPCODE const pOp = pCpu->pCurInstr;
     269    PCDISOPCODE const pOp = pCpu->pCurInstr;
    270270
    271271    /*
  • trunk/src/VBox/Disassembler/DisasmInternal.h

    r41668 r41690  
    2222#include <VBox/dis.h>
    2323
    24 #define ExceptionMemRead          0x666
    25 #define ExceptionInvalidModRM     0x667
    26 #define ExceptionInvalidParameter 0x668
    2724
     25/** @defgroup grp_dis_int Internals.
     26 * @ingroup grp_dis
     27 * @{
     28 */
     29
     30/** @name Index into g_apfnCalcSize and g_apfnFullDisasm.
     31 * @{ */
    2832#define IDX_ParseNop                0
    2933#define IDX_ParseModRM              1
     
    6872#define IDX_ParseImmAddrF           40
    6973#define IDX_ParseMax                (IDX_ParseImmAddrF+1)
     74/** @}  */
    7075
    7176
    72 extern PFNDISPARSE  g_apfnFullDisasm[IDX_ParseMax];
    73 extern PFNDISPARSE  g_apfnCalcSize[IDX_ParseMax];
     77/** @name Opcode maps.
     78 * @{ */
     79extern const DISOPCODE g_InvalidOpcode[1];
    7480
    75 unsigned ParseInstruction(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu);
    76 void disValidateLockSequence(PDISCPUSTATE pCpu);
     81extern const DISOPCODE g_aOneByteMapX86[256];
     82extern const DISOPCODE g_aOneByteMapX64[256];
     83extern const DISOPCODE g_aTwoByteMapX86[256];
    7784
    78 /* Read functions */
    79 DECLCALLBACK(int) disReadBytesDefault(PDISCPUSTATE pCpu, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead);
    80 uint8_t  DISReadByte(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
    81 uint16_t DISReadWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
    82 uint32_t DISReadDWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
    83 uint64_t DISReadQWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
     85/** Two byte opcode map with prefix 0x66 */
     86extern const DISOPCODE g_aTwoByteMapX86_PF66[256];
     87
     88/** Two byte opcode map with prefix 0xF2 */
     89extern const DISOPCODE g_aTwoByteMapX86_PFF2[256];
     90
     91/** Two byte opcode map with prefix 0xF3 */
     92extern const DISOPCODE g_aTwoByteMapX86_PFF3[256];
     93
     94/** Three byte opcode map (0xF 0x38) */
     95extern PCDISOPCODE const g_apThreeByteMapX86_0F38[16];
     96
     97/** Three byte opcode map with prefix 0x66 (0xF 0x38) */
     98extern PCDISOPCODE const g_apThreeByteMapX86_660F38[16];
     99
     100/** Three byte opcode map with prefix 0xF2 (0xF 0x38) */
     101extern PCDISOPCODE const g_apThreeByteMapX86_F20F38[16];
     102
     103/** Three byte opcode map with prefix 0x66 (0xF 0x3A) */
     104extern PCDISOPCODE const g_apThreeByteMapX86_660F3A[16];
     105/** @} */
     106
     107/** @name Opcode extensions (Group tables)
     108 * @{ */
     109extern const DISOPCODE g_aMapX86_Group1[8*4];
     110extern const DISOPCODE g_aMapX86_Group2[8*6];
     111extern const DISOPCODE g_aMapX86_Group3[8*2];
     112extern const DISOPCODE g_aMapX86_Group4[8];
     113extern const DISOPCODE g_aMapX86_Group5[8];
     114extern const DISOPCODE g_aMapX86_Group6[8];
     115extern const DISOPCODE g_aMapX86_Group7_mem[8];
     116extern const DISOPCODE g_aMapX86_Group7_mod11_rm000[8];
     117extern const DISOPCODE g_aMapX86_Group7_mod11_rm001[8];
     118extern const DISOPCODE g_aMapX86_Group8[8];
     119extern const DISOPCODE g_aMapX86_Group9[8];
     120extern const DISOPCODE g_aMapX86_Group10[8];
     121extern const DISOPCODE g_aMapX86_Group11[8*2];
     122extern const DISOPCODE g_aMapX86_Group12[8*2];
     123extern const DISOPCODE g_aMapX86_Group13[8*2];
     124extern const DISOPCODE g_aMapX86_Group14[8*2];
     125extern const DISOPCODE g_aMapX86_Group15_mem[8];
     126extern const DISOPCODE g_aMapX86_Group15_mod11_rm000[8];
     127extern const DISOPCODE g_aMapX86_Group16[8];
     128extern const DISOPCODE g_aMapX86_NopPause[2];
     129/** @} */
     130
     131/** 3DNow! map (0x0F 0x0F prefix) */
     132extern const DISOPCODE g_aTwoByteMapX86_3DNow[256];
     133
     134/** Floating point opcodes starting with escape byte 0xDF
     135 * @{ */
     136extern const DISOPCODE g_aMapX86_EscF0_Low[8];
     137extern const DISOPCODE g_aMapX86_EscF0_High[16*4];
     138extern const DISOPCODE g_aMapX86_EscF1_Low[8];
     139extern const DISOPCODE g_aMapX86_EscF1_High[16*4];
     140extern const DISOPCODE g_aMapX86_EscF2_Low[8];
     141extern const DISOPCODE g_aMapX86_EscF2_High[16*4];
     142extern const DISOPCODE g_aMapX86_EscF3_Low[8];
     143extern const DISOPCODE g_aMapX86_EscF3_High[16*4];
     144extern const DISOPCODE g_aMapX86_EscF4_Low[8];
     145extern const DISOPCODE g_aMapX86_EscF4_High[16*4];
     146extern const DISOPCODE g_aMapX86_EscF5_Low[8];
     147extern const DISOPCODE g_aMapX86_EscF5_High[16*4];
     148extern const DISOPCODE g_aMapX86_EscF6_Low[8];
     149extern const DISOPCODE g_aMapX86_EscF6_High[16*4];
     150extern const DISOPCODE g_aMapX86_EscF7_Low[8];
     151extern const DISOPCODE g_aMapX86_EscF7_High[16*4];
     152
     153extern PCDISOPCODE     g_paMapX86_FP_Low[8];
     154extern PCDISOPCODE     g_paMapX86_FP_High[8];
     155/** @} */
     156
     157/** @def OP
     158 * Wrapper which initializes an OPCODE.
     159 * We must use this so that we can exclude unused fields in order
     160 * to save precious bytes in the GC version.
     161 *
     162 * @internal
     163 */
     164#ifndef DIS_CORE_ONLY
     165# define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
     166    { pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
     167#else
     168# define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
     169    { idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
     170#endif
     171
    84172
    85173size_t disFormatBytes(PCDISCPUSTATE pCpu, char *pszDst, size_t cchDst, uint32_t fFlags);
    86174
     175/** @} */
    87176#endif
    88177
  • trunk/src/VBox/Disassembler/DisasmReg.cpp

    r41678 r41690  
    3030#include <iprt/stdarg.h>
    3131#include "DisasmInternal.h"
    32 #include "DisasmTables.h"
    3332
    3433
  • trunk/src/VBox/Disassembler/DisasmTables.cpp

    r41676 r41690  
    5757
    5858/* Invalid opcode */
    59 const OPCODE g_InvalidOpcode[1] =
     59const DISOPCODE g_InvalidOpcode[1] =
    6060{
    6161    INVALID_OPCODE
     
    6363
    6464/* Tables for the elegant Intel X86 instruction set */
    65 const OPCODE g_aOneByteMapX86[256] =
     65const DISOPCODE g_aOneByteMapX86[256] =
    6666{
    6767    /* 0 */
     
    365365
    366366
    367 const OPCODE g_aTwoByteMapX86[256] =
     367const DISOPCODE g_aTwoByteMapX86[256] =
    368368{
    369369    /* 0 */
     
    665665
    666666/* Two byte opcode map with prefix 0x66 */
    667 const OPCODE g_aTwoByteMapX86_PF66[256] =
     667const DISOPCODE g_aTwoByteMapX86_PF66[256] =
    668668{
    669669    /* 0 */
     
    867867
    868868/* Two byte opcode map with prefix 0xF2 */
    869 const OPCODE g_aTwoByteMapX86_PFF2[256] =
     869const DISOPCODE g_aTwoByteMapX86_PFF2[256] =
    870870{
    871871    /* 0 */
     
    10401040
    10411041/* Two byte opcode map with prefix 0xF3 */
    1042 const OPCODE g_aTwoByteMapX86_PFF3[256] =
     1042const DISOPCODE g_aTwoByteMapX86_PFF3[256] =
    10431043{
    10441044    /* 0 */
     
    12131213
    12141214/** Three byte opcode map (0xF 0x38 0x0x) */
    1215 const OPCODE g_aThreeByteMapX86_0F38_0[16] =
     1215const DISOPCODE g_aThreeByteMapX86_0F38_0[16] =
    12161216{
    12171217    /* 0 */
     
    12351235
    12361236/** Three byte opcode map (0x0F 0x38 0x1x) */
    1237 const OPCODE g_aThreeByteMapX86_0F38_1[16] =
     1237const DISOPCODE g_aThreeByteMapX86_0F38_1[16] =
    12381238{
    12391239    /* 1 */
     
    12561256};
    12571257
    1258 /* These tables are mostly sparse, so use another level of indirection to save space. */
    1259 const OPCODE *g_apThreeByteMapX86_0F38[16] =
     1258/** These tables are mostly sparse, so use another level of indirection to save space. */
     1259PCDISOPCODE const g_apThreeByteMapX86_0F38[16] =
    12601260{
    12611261    /* 0 */
     
    13091309
    13101310/** Three byte opcode map (0x66 0x0F 0x38 0x0x) */
    1311 const OPCODE g_aThreeByteMapX86_660F38_0[16] =
     1311const DISOPCODE g_aThreeByteMapX86_660F38_0[16] =
    13121312{
    13131313    /* 0 */
     
    13311331
    13321332/** Three byte opcode map (0x66 0x0F 0x38 0x1x) */
    1333 const OPCODE g_aThreeByteMapX86_660F38_1[16] =
     1333const DISOPCODE g_aThreeByteMapX86_660F38_1[16] =
    13341334{
    13351335    /* 1 */
     
    13551355
    13561356/** Three byte opcode map (0x66 0x0F 0x38 0x8x) */
    1357 const OPCODE g_aThreeByteMapX86_660F38_8[16] =
     1357const DISOPCODE g_aThreeByteMapX86_660F38_8[16] =
    13581358{
    13591359    /* 8 */
     
    13771377
    13781378/** Three byte opcode map with prefix 0x66 (0xF 0x38) */
    1379 const OPCODE *g_apThreeByteMapX86_660F38[16] =
     1379PCDISOPCODE const g_apThreeByteMapX86_660F38[16] =
    13801380{
    13811381    /* 0 */
     
    14301430/** Three byte opcode map with prefix 0xF2 (0xF 0x38) */
    14311431/** @todo remainder missing (too lazy now) */
    1432 const OPCODE *g_apThreeByteMapX86_F20F38[16] =
     1432PCDISOPCODE const g_apThreeByteMapX86_F20F38[16] =
    14331433{
    14341434    /* 0 */
     
    14831483/** Three byte opcode map with prefix 0x66 (0xF 0x3A) */
    14841484/** @todo remainder missing (too lazy now) */
    1485 const OPCODE *g_apThreeByteMapX86_660F3A[16] =
     1485PCDISOPCODE const g_apThreeByteMapX86_660F3A[16] =
    14861486{
    14871487    /* 0 */
     
    15351535
    15361536/* 3DNow! map (0x0F 0x0F prefix) */
    1537 const OPCODE g_aTwoByteMapX86_3DNow[256] =
     1537const DISOPCODE g_aTwoByteMapX86_3DNow[256] =
    15381538{
    15391539    /* 0 */
     
    16771677
    16781678/* Floating point opcode starting with escape byte 0xD8 (values 0-0xBF)*/
    1679 const OPCODE g_aMapX86_EscF0_Low[8] =
     1679const DISOPCODE g_aMapX86_EscF0_Low[8] =
    16801680{
    16811681    /* 0 */
     
    16911691
    16921692/* Floating point opcode starting with escape byte 0xD8 (outside 0-0xBF)*/
    1693 const OPCODE g_aMapX86_EscF0_High[16*4] =
     1693const DISOPCODE g_aMapX86_EscF0_High[16*4] =
    16941694{
    16951695    /* c */
     
    17681768
    17691769/* Floating point opcode starting with escape byte 0xD9 (values 0-0xBF)*/
    1770 const OPCODE g_aMapX86_EscF1_Low[8] =
     1770const DISOPCODE g_aMapX86_EscF1_Low[8] =
    17711771{
    17721772    /* 0 */
     
    17851785
    17861786/* Floating point opcode starting with escape byte 0xD9 (outside 0-0xBF)*/
    1787 const OPCODE g_aMapX86_EscF1_High[16*4] =
     1787const DISOPCODE g_aMapX86_EscF1_High[16*4] =
    17881788{
    17891789    /* c */
     
    18631863
    18641864/* Floating point opcode starting with escape byte 0xDA (values 0-0xBF)*/
    1865 const OPCODE g_aMapX86_EscF2_Low[8] =
     1865const DISOPCODE g_aMapX86_EscF2_Low[8] =
    18661866{
    18671867    /* 0 */
     
    18781878
    18791879/* Floating point opcode starting with escape byte 0xD9 (outside 0-0xBF)*/
    1880 const OPCODE g_aMapX86_EscF2_High[16*4] =
     1880const DISOPCODE g_aMapX86_EscF2_High[16*4] =
    18811881{
    18821882    /* c */
     
    19401940
    19411941/* Floating point opcode starting with escape byte 0xDB (values 0-0xBF)*/
    1942 const OPCODE g_aMapX86_EscF3_Low[8] =
     1942const DISOPCODE g_aMapX86_EscF3_Low[8] =
    19431943{
    19441944    /* 0 */
     
    19551955
    19561956/* Floating point opcode starting with escape byte 0xDB (outside 0-0xBF)*/
    1957 const OPCODE g_aMapX86_EscF3_High[16*4] =
     1957const DISOPCODE g_aMapX86_EscF3_High[16*4] =
    19581958{
    19591959    /* c */
     
    20332033
    20342034/* Floating point opcode starting with escape byte 0xDC (values 0-0xBF)*/
    2035 const OPCODE g_aMapX86_EscF4_Low[8] =
     2035const DISOPCODE g_aMapX86_EscF4_Low[8] =
    20362036{
    20372037    /* 0 */
     
    20482048
    20492049/* Floating point opcode starting with escape byte 0xDC (outside 0-0xBF)*/
    2050 const OPCODE g_aMapX86_EscF4_High[16*4] =
     2050const DISOPCODE g_aMapX86_EscF4_High[16*4] =
    20512051{
    20522052    /* c */
     
    21112111
    21122112/* Floating point opcode starting with escape byte 0xDD (values 0-0xBF)*/
    2113 const OPCODE g_aMapX86_EscF5_Low[8] =
     2113const DISOPCODE g_aMapX86_EscF5_Low[8] =
    21142114{
    21152115    /* 0 */
     
    21262126
    21272127/* Floating point opcode starting with escape byte 0xDD (outside 0-0xBF)*/
    2128 const OPCODE g_aMapX86_EscF5_High[16*4] =
     2128const DISOPCODE g_aMapX86_EscF5_High[16*4] =
    21292129{
    21302130    /* c */
     
    21902190
    21912191/* Floating point opcode starting with escape byte 0xDE (values 0-0xBF)*/
    2192 const OPCODE g_aMapX86_EscF6_Low[8] =
     2192const DISOPCODE g_aMapX86_EscF6_Low[8] =
    21932193{
    21942194    /* 0 */
     
    22052205
    22062206/* Floating point opcode starting with escape byte 0xDE (outside 0-0xBF)*/
    2207 const OPCODE g_aMapX86_EscF6_High[16*4] =
     2207const DISOPCODE g_aMapX86_EscF6_High[16*4] =
    22082208{
    22092209    /* c */
     
    22822282
    22832283/* Floating point opcode starting with escape byte 0xDF (values 0-0xBF)*/
    2284 const OPCODE g_aMapX86_EscF7_Low[8] =
     2284const DISOPCODE g_aMapX86_EscF7_Low[8] =
    22852285{
    22862286    /* 0 */
     
    22972297
    22982298/* Floating point opcode starting with escape byte 0xDF (outside 0-0xBF)*/
    2299 const OPCODE g_aMapX86_EscF7_High[16*4] =
     2299const DISOPCODE g_aMapX86_EscF7_High[16*4] =
    23002300{
    23012301    /* c */
     
    23432343
    23442344
    2345 PCOPCODE g_paMapX86_FP_Low[8] =
     2345PCDISOPCODE g_paMapX86_FP_Low[8] =
    23462346{
    23472347    g_aMapX86_EscF0_Low,
     
    23552355};
    23562356
    2357 PCOPCODE g_paMapX86_FP_High[8] =
     2357PCDISOPCODE g_paMapX86_FP_High[8] =
    23582358{
    23592359    g_aMapX86_EscF0_High,
     
    23682368
    23692369/* Opcode extensions (Group tables) */
    2370 const OPCODE g_aMapX86_Group1[8*4] =
     2370const DISOPCODE g_aMapX86_Group1[8*4] =
    23712371{
    23722372    /* 80 */
     
    24112411};
    24122412
    2413 const OPCODE g_aMapX86_Group2[8*6] =
     2413const DISOPCODE g_aMapX86_Group2[8*6] =
    24142414{
    24152415    /* C0 */
     
    24762476
    24772477
    2478 const OPCODE g_aMapX86_Group3[8*2] =
     2478const DISOPCODE g_aMapX86_Group3[8*2] =
    24792479{
    24802480    /* F6 */
     
    25012501};
    25022502
    2503 const OPCODE g_aMapX86_Group4[8] =
     2503const DISOPCODE g_aMapX86_Group4[8] =
    25042504{
    25052505    /* FE */
     
    25142514};
    25152515
    2516 const OPCODE g_aMapX86_Group5[8] =
     2516const DISOPCODE g_aMapX86_Group5[8] =
    25172517{
    25182518    /* FF */
     
    25282528
    25292529
    2530 const OPCODE g_aMapX86_Group6[8] =
     2530const DISOPCODE g_aMapX86_Group6[8] =
    25312531{
    25322532    /* 0F 00 */
     
    25412541};
    25422542
    2543 const OPCODE g_aMapX86_Group7_mem[8] =
     2543const DISOPCODE g_aMapX86_Group7_mem[8] =
    25442544{
    25452545    /* 0F 01 */
     
    25542554};
    25552555
    2556 const OPCODE g_aMapX86_Group7_mod11_rm000[8] =
     2556const DISOPCODE g_aMapX86_Group7_mod11_rm000[8] =
    25572557{
    25582558    /* 0F 01 MOD=11b */
     
    25672567};
    25682568
    2569 const OPCODE g_aMapX86_Group7_mod11_rm001[8] =
     2569const DISOPCODE g_aMapX86_Group7_mod11_rm001[8] =
    25702570{
    25712571    /* 0F 01 MOD=11b */
     
    25802580};
    25812581
    2582 const OPCODE g_aMapX86_Group8[8] =
     2582const DISOPCODE g_aMapX86_Group8[8] =
    25832583{
    25842584    /* 0F BA */
     
    25932593};
    25942594
    2595 const OPCODE g_aMapX86_Group9[8] =
     2595const DISOPCODE g_aMapX86_Group9[8] =
    25962596{
    25972597    /* 0F C7 */
     
    26062606};
    26072607
    2608 const OPCODE g_aMapX86_Group10[8] =
     2608const DISOPCODE g_aMapX86_Group10[8] =
    26092609{
    26102610    /* 0F B9 */
     
    26202620
    26212621
    2622 const OPCODE g_aMapX86_Group11[8*2] =
     2622const DISOPCODE g_aMapX86_Group11[8*2] =
    26232623{
    26242624    /* 0F C6 */
     
    26442644
    26452645/* 0xF 0x71 */
    2646 const OPCODE g_aMapX86_Group12[8*2] =
     2646const DISOPCODE g_aMapX86_Group12[8*2] =
    26472647{
    26482648    INVALID_OPCODE,
     
    26672667
    26682668/* 0xF 0x72 */
    2669 const OPCODE g_aMapX86_Group13[8*2] =
     2669const DISOPCODE g_aMapX86_Group13[8*2] =
    26702670{
    26712671    INVALID_OPCODE,
     
    26902690
    26912691/* 0xF 0x73 */
    2692 const OPCODE g_aMapX86_Group14[8*2] =
     2692const DISOPCODE g_aMapX86_Group14[8*2] =
    26932693{
    26942694    INVALID_OPCODE,
     
    27142714
    27152715/* 0xF 0xAE */
    2716 const OPCODE g_aMapX86_Group15_mem[8] =
     2716const DISOPCODE g_aMapX86_Group15_mem[8] =
    27172717{
    27182718    OP("fxsave %M",          IDX_ParseModRM,     0,          0,          OP_FXSAVE,  OP_PARM_M,          OP_PARM_NONE,   OP_PARM_NONE,   DISOPTYPE_HARMLESS),
     
    27272727
    27282728/* 0xF 0xAE */
    2729 const OPCODE g_aMapX86_Group15_mod11_rm000[8] =
     2729const DISOPCODE g_aMapX86_Group15_mod11_rm000[8] =
    27302730{
    27312731    INVALID_OPCODE,
     
    27402740
    27412741/* 0xF 0x18 */
    2742 const OPCODE g_aMapX86_Group16[8] =
     2742const DISOPCODE g_aMapX86_Group16[8] =
    27432743{
    27442744    OP("prefetchnta %Mb",  IDX_ParseModRM, 0,          0,          OP_PREFETCH,OP_PARM_Mb,        OP_PARM_NONE,   OP_PARM_NONE,   DISOPTYPE_HARMLESS),
     
    27532753
    27542754/* 0x90 or 0xF3 0x90 */
    2755 const OPCODE g_aMapX86_NopPause[2] =
     2755const DISOPCODE g_aMapX86_NopPause[2] =
    27562756{
    27572757    OP("nop",                0,              0,          0,       OP_NOP,     OP_PARM_NONE,       OP_PARM_NONE,   OP_PARM_NONE,   DISOPTYPE_HARMLESS),
  • trunk/src/VBox/Disassembler/DisasmTables.h

    r41668 r41690  
    1 /* $Id$ */
    2 /** @file
    3  * VBox disassembler - Tables Header.
    4  */
    51
    6 /*
    7  * Copyright (C) 2006-2012 Oracle Corporation
    8  *
    9  * This file is part of VirtualBox Open Source Edition (OSE), as
    10  * available from http://www.virtualbox.org. This file is free software;
    11  * you can redistribute it and/or modify it under the terms of the GNU
    12  * General Public License (GPL) as published by the Free Software
    13  * Foundation, in version 2 as it comes in the "COPYING" file of the
    14  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16  */
    17 
    18 #ifndef ___disasmtable_h___
    19 #define ___disasmtable_h___
    20 
    21 #include <VBox/dis.h>
    22 
    23 extern const OPCODE g_InvalidOpcode[1];
    24 
    25 extern const OPCODE g_aOneByteMapX86[256];
    26 extern const OPCODE g_aOneByteMapX64[256];
    27 extern const OPCODE g_aTwoByteMapX86[256];
    28 
    29 /** Two byte opcode map with prefix 0x66 */
    30 extern const OPCODE g_aTwoByteMapX86_PF66[256];
    31 
    32 /** Two byte opcode map with prefix 0xF2 */
    33 extern const OPCODE g_aTwoByteMapX86_PFF2[256];
    34 
    35 /** Two byte opcode map with prefix 0xF3 */
    36 extern const OPCODE g_aTwoByteMapX86_PFF3[256];
    37 
    38 /** Three byte opcode map (0xF 0x38) */
    39 extern const OPCODE *g_apThreeByteMapX86_0F38[16];
    40 
    41 /** Three byte opcode map with prefix 0x66 (0xF 0x38) */
    42 extern const OPCODE *g_apThreeByteMapX86_660F38[16];
    43 
    44 /** Three byte opcode map with prefix 0xF2 (0xF 0x38) */
    45 extern const OPCODE *g_apThreeByteMapX86_F20F38[16];
    46 
    47 /** Three byte opcode map with prefix 0x66 (0xF 0x3A) */
    48 extern const OPCODE *g_apThreeByteMapX86_660F3A[16];
    49 
    50 /** Opcode extensions (Group tables)
    51  * @{ */
    52 extern const OPCODE g_aMapX86_Group1[8*4];
    53 extern const OPCODE g_aMapX86_Group2[8*6];
    54 extern const OPCODE g_aMapX86_Group3[8*2];
    55 extern const OPCODE g_aMapX86_Group4[8];
    56 extern const OPCODE g_aMapX86_Group5[8];
    57 extern const OPCODE g_aMapX86_Group6[8];
    58 extern const OPCODE g_aMapX86_Group7_mem[8];
    59 extern const OPCODE g_aMapX86_Group7_mod11_rm000[8];
    60 extern const OPCODE g_aMapX86_Group7_mod11_rm001[8];
    61 extern const OPCODE g_aMapX86_Group8[8];
    62 extern const OPCODE g_aMapX86_Group9[8];
    63 extern const OPCODE g_aMapX86_Group10[8];
    64 extern const OPCODE g_aMapX86_Group11[8*2];
    65 extern const OPCODE g_aMapX86_Group12[8*2];
    66 extern const OPCODE g_aMapX86_Group13[8*2];
    67 extern const OPCODE g_aMapX86_Group14[8*2];
    68 extern const OPCODE g_aMapX86_Group15_mem[8];
    69 extern const OPCODE g_aMapX86_Group15_mod11_rm000[8];
    70 extern const OPCODE g_aMapX86_Group16[8];
    71 extern const OPCODE g_aMapX86_NopPause[2];
    72 /** @} */
    73 
    74 /** 3DNow! map (0x0F 0x0F prefix) */
    75 extern const OPCODE g_aTwoByteMapX86_3DNow[256];
    76 
    77 /** Floating point opcodes starting with escape byte 0xDF
    78  * @{ */
    79 extern const OPCODE g_aMapX86_EscF0_Low[8];
    80 extern const OPCODE g_aMapX86_EscF0_High[16*4];
    81 extern const OPCODE g_aMapX86_EscF1_Low[8];
    82 extern const OPCODE g_aMapX86_EscF1_High[16*4];
    83 extern const OPCODE g_aMapX86_EscF2_Low[8];
    84 extern const OPCODE g_aMapX86_EscF2_High[16*4];
    85 extern const OPCODE g_aMapX86_EscF3_Low[8];
    86 extern const OPCODE g_aMapX86_EscF3_High[16*4];
    87 extern const OPCODE g_aMapX86_EscF4_Low[8];
    88 extern const OPCODE g_aMapX86_EscF4_High[16*4];
    89 extern const OPCODE g_aMapX86_EscF5_Low[8];
    90 extern const OPCODE g_aMapX86_EscF5_High[16*4];
    91 extern const OPCODE g_aMapX86_EscF6_Low[8];
    92 extern const OPCODE g_aMapX86_EscF6_High[16*4];
    93 extern const OPCODE g_aMapX86_EscF7_Low[8];
    94 extern const OPCODE g_aMapX86_EscF7_High[16*4];
    95 
    96 extern PCOPCODE     g_paMapX86_FP_Low[8];
    97 extern PCOPCODE     g_paMapX86_FP_High[8];
    98 /** @} */
    99 
    100 /** @def OP
    101  * Wrapper which initializes an OPCODE.
    102  * We must use this so that we can exclude unused fields in order
    103  * to save precious bytes in the GC version.
    104  *
    105  * @internal
    106  */
    107 #ifndef DIS_CORE_ONLY
    108 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
    109     { pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
    110 #else
    111 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \
    112     { idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype }
    113 #endif
    114 
    115 #endif
    116 
  • trunk/src/VBox/Disassembler/DisasmTablesX64.cpp

    r41676 r41690  
    2222#include <VBox/dis.h>
    2323#include <VBox/disopcode.h>
    24 #include "DisasmTables.h"
    2524#include "DisasmInternal.h"
    2625
     
    3231
    3332#ifndef DIS_CORE_ONLY
    34 static char SZINVALID_OPCODE[] = "Invalid Opcode";
     33static char g_szInvalidOpcode[] = "Invalid Opcode";
    3534#endif
    3635
    3736#define INVALID_OPCODE  \
    38     OP(SZINVALID_OPCODE,     0,              0,          0,          OP_INVALID, OP_PARM_NONE,       OP_PARM_NONE,   OP_PARM_NONE,   DISOPTYPE_INVALID)
     37    OP(g_szInvalidOpcode,    0,              0,          0,          OP_INVALID, OP_PARM_NONE,       OP_PARM_NONE,   OP_PARM_NONE,   DISOPTYPE_INVALID)
    3938
    4039#define INVALID_OPCODE_BLOCK \
     
    5857/* Tables for the elegant Intel X64 instruction set */
    5958
    60 const OPCODE g_aOneByteMapX64[256] =
     59const DISOPCODE g_aOneByteMapX64[256] =
    6160{
    6261    /* 0 */
  • trunk/src/VBox/Disassembler/DisasmTest.cpp

    r41675 r41690  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VBox disassembler:
    4  * Test application
     3 * VBox disassembler - Test application
    54 */
    65
    76/*
    8  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    98 *
    109 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Disassembler/DisasmTestCore.cpp

    r41675 r41690  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VBox disassembler:
    4  * Test application for core.
     3 * VBox disassembler - Test application for core.
    54 */
    65
    76/*
    8  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    98 *
    109 * This file is part of VirtualBox Open Source Edition (OSE), as
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette