VirtualBox

Changeset 101539 in vbox


Ignore:
Timestamp:
Oct 22, 2023 2:43:09 AM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159616
Message:

DIS,VMM,DBGC,IPRT,++: Some disassembler tweaks and TB disassembly work. bugref:10371 bugref:9898

Location:
trunk
Files:
29 edited

Legend:

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

    r99319 r101539  
    5353 * Opcode parameter (operand) details.
    5454 */
    55 typedef struct DISOPPARAMARMV8
     55typedef struct
    5656{
    5757    /** The register operand. */
     
    6060        /** General register index (DISGREG_XXX), applicable if DISUSE_REG_GEN32
    6161         * or DISUSE_REG_GEN64 is set in fUse. */
    62         uint8_t     idxGenReg;
     62        uint8_t         idxGenReg;
    6363    } Reg;
    6464    /** Scale factor. */
    65     uint8_t           uScale;
     65    uint8_t         uScale;
    6666    /** Parameter size. */
    67     uint8_t           cb;
    68     /** Copy of the corresponding DISOPCODE::fParam1 / DISOPCODE::fParam2 /
    69      * DISOPCODE::fParam3. */
    70     uint32_t          fParam;
    71 } DISOPPARAMARMV8;
    72 //AssertCompileSize(DISOPPARAMARMV8, 16);
     67    uint8_t         cb;
     68    uint8_t         bPadding;
     69    /** Copy of the corresponding DISOPCODE::fParam1 / DISOPCODE::fParam2 / DISOPCODE::fParam3. */
     70    uint32_t        fParam;
     71} DIS_OP_PARAM_ARMV8_T;
     72AssertCompile(sizeof(DIS_OP_PARAM_ARMV8_T) <= 16);
    7373/** Pointer to opcode parameter. */
    74 typedef DISOPPARAMARMV8 *PDISOPPARAMARMV8;
     74typedef DIS_OP_PARAM_ARMV8_T *PDIS_OP_PARAM_ARMV8_T;
    7575/** Pointer to opcode parameter. */
    76 typedef const DISOPPARAMARMV8 *PCDISOPPARAMARMV8;
     76typedef const DIS_OP_PARAM_ARMV8_T *PCDIS_OP_PARAM_ARMV8_T;
    7777
    7878
     
    8080 * The armv8 specific disassembler state and result.
    8181 */
    82 typedef struct DISSTATEARMV8
     82typedef struct
    8383{
    84     uint8_t bDummy;
    85 } DISSTATEARMV8;
    86 //AssertCompileSize(DISSTATEARMV8, 32);
     84    uint8_t         bDummy;
     85} DIS_STATE_ARMV8_T;
     86AssertCompile(sizeof(DIS_STATE_ARMV8_T) <= 32);
    8787
    8888
  • trunk/include/VBox/dis-x86-amd64.h

    r99225 r101539  
    304304
    305305/**
    306  * Opcode parameter (operand) details.
    307  */
    308 typedef struct DISOPPARAMX86
     306 * Opcode parameter (operand) details for x86/AMD64.
     307 */
     308typedef struct
    309309{
    310     /** Disposition.  */
     310    /** Disposition. */
    311311    union
    312312    {
     
    372372    } Index;
    373373    /** 2, 4 or 8, if DISUSE_SCALE is set in fUse. */
    374     uint8_t           uScale;
     374    uint8_t         uScale;
    375375    /** Parameter size. */
    376     uint8_t           cb;
     376    uint8_t         cb;
    377377    /** Copy of the corresponding DISOPCODE::fParam1 / DISOPCODE::fParam2 /
    378378     * DISOPCODE::fParam3. */
    379     uint32_t          fParam;
    380 } DISOPPARAMX86;
    381 AssertCompileSize(DISOPPARAMX86, 16);
     379    uint32_t        fParam;
     380} DIS_OP_PARAM_X86_T;
     381AssertCompileSize(DIS_OP_PARAM_X86_T, 16);
    382382/** Pointer to opcode parameter. */
    383 typedef DISOPPARAMX86 *PDISOPPARAMX86;
     383typedef DIS_OP_PARAM_X86_T *PDIS_OP_PARAM_X86_T;
    384384/** Pointer to opcode parameter. */
    385 typedef const DISOPPARAMX86 *PCDISOPPARAMX86;
     385typedef const DIS_OP_PARAM_X86_T *PCDIS_OP_PARAM_X86_T;
    386386
    387387
     
    396396
    397397/**
    398  * The x86/amd64 specific disassembler state and result.
    399  */
    400 typedef struct DISSTATEX86
     398 * The x86/AMD64 specific disassembler state and result.
     399 */
     400typedef struct
    401401{
    402402    /** SIB fields. */
     
    452452    uint32_t        uPtrPadding1;
    453453#endif
    454 
    455 } DISSTATEX86;
    456 AssertCompileSize(DISSTATEX86, 32);
     454} DIS_STATE_X86_T;
     455AssertCompileSize(DIS_STATE_X86_T, 32);
    457456
    458457
  • trunk/include/VBox/dis.h

    r99319 r101539  
    108108    /** Parameter \#4 parser index.  */
    109109    uint8_t     idxParse4;
    110     /** The opcode identifier. This DIS specific, @see grp_dis_opcodes and
    111      * VBox/disopcode-x86-amd64.h. */
     110    /** The opcode identifier (enum OPCODESX86) - this is DIS specific.
     111     * @see grp_dis_opcodes, VBox/disopcode-x86-amd64.h */
    112112    uint16_t    uOpcode;
    113113    /** Parameter \#1 info, @see grp_dis_opparam. */
     
    246246    union
    247247    {
    248         /** x86/amd64 specific state. */
    249         DISOPPARAMX86   x86;
     248        /** x86/AMD64 specific state. */
     249        DIS_OP_PARAM_X86_T      x86;
    250250#if defined(VBOX_DIS_WITH_ARMV8)
    251251        /** ARMv8 specific state. */
    252         DISOPPARAMARMV8 armv8;
    253 #endif
    254     } arch;
    255 
     252        DIS_OP_PARAM_ARMV8_T    armv8;
     253#endif
     254    };
    256255} DISOPPARAM;
    257256AssertCompileSize(DISOPPARAM, 32);
     
    263262 * Callback for reading instruction bytes.
    264263 *
    265  * @returns VBox status code, bytes in DISSTATE::u::abInstr and byte count in
     264 * @returns VBox status code, bytes in DISSTATE::Instr::ab and byte count in
    266265 *          DISSTATE::cbCachedInstr.
    267266 * @param   pDis            Pointer to the disassembler state.  The user
     
    273272 *
    274273 *                          To calculate the destination buffer address, use it
    275  *                          as an index into DISSTATE::abInstr.
     274 *                          as an index into DISSTATE::Instr::ab.
    276275 *
    277276 * @param   cbMinRead       The minimum number of bytes to read.
     
    288287typedef struct DISSTATE
    289288{
    290     /** The instruction as different views. */
     289    /** The different instruction views.
     290     * @sa cbCachedInstr, FNDISREADBYTES */
    291291    union
    292292    {
    293         /** The instruction bytes. */
    294         uint8_t         abInstr[16];
     293        /** Byte (8-bit) view.
     294         * This is the one referred to by FNDISREADBYTES and cbCached. */
     295        uint8_t         ab[16];
    295296        /** Single 16-bit view. */
    296297        uint16_t        u16;
     
    298299        uint32_t        u32;
    299300        /** 16-bit view. */
    300         uint16_t        au16Instr[8];
     301        uint16_t        au16[8];
    301302        /** 32-bit view. */
    302         uint32_t        au32Instr[4];
     303        uint32_t        au32[4];
    303304        /** 64-bit view. */
    304         uint64_t        au64Instr[2];
    305     } u;
     305        uint64_t        au64[2];
     306    } Instr;
    306307
    307308    /** Pointer to the current instruction. */
     
    316317    DISOPPARAM          Param4;
    317318
    318     /** The number of valid bytes in abInstr. */
     319    /** The number of valid bytes in DISSTATE::Instr. */
    319320    uint8_t             cbCachedInstr;
    320321    /** The CPU mode (DISCPUMODE). */
     
    335336#endif
    336337    /** User data supplied as an argument to the APIs. */
    337     void                *pvUser;
     338    void               *pvUser;
    338339#if ARCH_BITS == 32
    339340    uint32_t            uPadding4;
     
    343344    union
    344345    {
    345         /** x86/amd64 specific state. */
    346         DISSTATEX86     x86;
     346        /** x86/AMD64 specific state. */
     347        DIS_STATE_X86_T     x86;
    347348#if defined(VBOX_DIS_WITH_ARMV8)
    348349        /** ARMv8 specific state. */
    349         DISSTATEARMV8   armv8;
    350 #endif
    351     } arch;
    352 
     350        DIS_STATE_ARMV8_T   armv8;
     351#endif
     352    };
    353353} DISSTATE;
    354 AssertCompileMemberAlignment(DISSTATE, arch, 8);
     354AssertCompileMemberAlignment(DISSTATE, x86, 8);
    355355AssertCompileSize(DISSTATE, 0xd8);
    356356
  • trunk/src/VBox/Debugger/DBGPlugInLinux.cpp

    r99739 r101539  
    438438                                    || (    (DisState.Param1.fUse & (DISUSE_BASE | DISUSE_REG_GEN64))
    439439                                         && cbVal == sizeof(uint64_t)))
    440                                 && DisState.Param1.arch.x86.Base.idxGenReg == DISGREG_RAX)
     440                                && DisState.Param1.x86.Base.idxGenReg == DISGREG_RAX)
    441441                            {
    442442                                /* Parse the source. */
     
    448448
    449449                                    if (DisState.Param2.fUse & DISUSE_RIPDISPLACEMENT32)
    450                                         GCPtrVal = GCPtrCur + DisState.Param2.arch.x86.uDisp.i32 + cbInstr;
     450                                        GCPtrVal = GCPtrCur + DisState.Param2.x86.uDisp.i32 + cbInstr;
    451451                                    else if (DisState.Param2.fUse & DISUSE_DISPLACEMENT32)
    452                                         GCPtrVal = (RTGCPTR)DisState.Param2.arch.x86.uDisp.u32;
     452                                        GCPtrVal = (RTGCPTR)DisState.Param2.x86.uDisp.u32;
    453453                                    else if (DisState.Param2.fUse & DISUSE_DISPLACEMENT64)
    454                                         GCPtrVal = (RTGCPTR)DisState.Param2.arch.x86.uDisp.u64;
     454                                        GCPtrVal = (RTGCPTR)DisState.Param2.x86.uDisp.u64;
    455455                                    else
    456456                                        AssertMsgFailedBreakStmt(("Invalid displacement\n"), rc = VERR_INVALID_STATE);
     
    571571                             */
    572572                            if (   (DisState.Param2.fUse & DISUSE_REG_GEN8)
    573                                 && (   (DisState.Param2.arch.x86.Base.idxGenReg == DISGREG_AL && !pThis->f64Bit)
    574                                     || (DisState.Param2.arch.x86.Base.idxGenReg == DISGREG_DIL && pThis->f64Bit))
     573                                && (   (DisState.Param2.x86.Base.idxGenReg == DISGREG_AL && !pThis->f64Bit)
     574                                    || (DisState.Param2.x86.Base.idxGenReg == DISGREG_DIL && pThis->f64Bit))
    575575                                && DISUSE_IS_EFFECTIVE_ADDR(DisState.Param1.fUse))
    576576                            {
     
    657657                                 */
    658658                                if (   (DisState.Param1.fUse & (DISUSE_BASE | DISUSE_REG_GEN32 | DISUSE_REG_GEN64))
    659                                     && (DisState.Param2.arch.x86.cb == sizeof(uint32_t) || DisState.Param2.arch.x86.cb == sizeof(uint64_t))
     659                                    && (DisState.Param2.x86.cb == sizeof(uint32_t) || DisState.Param2.x86.cb == sizeof(uint64_t))
    660660                                    && (DisState.Param2.fUse & (DISUSE_RIPDISPLACEMENT32|DISUSE_DISPLACEMENT32|DISUSE_DISPLACEMENT64)))
    661661                                {
     
    663663
    664664                                    if (DisState.Param2.fUse & DISUSE_RIPDISPLACEMENT32)
    665                                         GCPtrVal = GCPtrCur + DisState.Param2.arch.x86.uDisp.i32 + cbInstr;
     665                                        GCPtrVal = GCPtrCur + DisState.Param2.x86.uDisp.i32 + cbInstr;
    666666                                    else if (DisState.Param2.fUse & DISUSE_DISPLACEMENT32)
    667                                         GCPtrVal = (RTGCPTR)DisState.Param2.arch.x86.uDisp.u32;
     667                                        GCPtrVal = (RTGCPTR)DisState.Param2.x86.uDisp.u32;
    668668                                    else if (DisState.Param2.fUse & DISUSE_DISPLACEMENT64)
    669                                         GCPtrVal = (RTGCPTR)DisState.Param2.arch.x86.uDisp.u64;
     669                                        GCPtrVal = (RTGCPTR)DisState.Param2.x86.uDisp.u64;
    670670                                    else
    671671                                        AssertMsgFailedBreakStmt(("Invalid displacement\n"), rc = VERR_INVALID_STATE);
     
    677677                                            aAddresses[cAddressesUsed].cb = sizeof(uint32_t);
    678678                                        else
    679                                             aAddresses[cAddressesUsed].cb = DisState.Param2.arch.x86.cb;
     679                                            aAddresses[cAddressesUsed].cb = DisState.Param2.x86.cb;
    680680                                        aAddresses[cAddressesUsed].GCPtrOrigSrc = GCPtrVal;
    681681                                        cAddressesUsed++;
  • trunk/src/VBox/Devices/BiosCommonCode/MakeAlternativeSource.cpp

    r99220 r101539  
    935935     *        modrm.reg != 0. Those encodings should be invalid AFAICT. */
    936936
    937     if (   (   pDis->arch.x86.bOpCode  == 0x8f            /* group 1a */
    938             || pDis->arch.x86.bOpCode  == 0xc7            /* group 11 */
    939             || pDis->arch.x86.bOpCode  == 0xc6            /* group 11 - not verified */
     937    if (   (   pDis->x86.bOpCode  == 0x8f       /* group 1a */
     938            || pDis->x86.bOpCode  == 0xc7       /* group 11 */
     939            || pDis->x86.bOpCode  == 0xc6       /* group 11 - not verified */
    940940           )
    941         && pDis->arch.x86.ModRM.Bits.Reg != 0)
     941        && pDis->x86.ModRM.Bits.Reg != 0)
    942942        fDifferent = true;
    943943    /*
     
    999999            cbToRead = g_cbImg - offBios;
    10001000    }
    1001     memcpy(&pDis->u.abInstr[offInstr], &g_pbImg[offBios], cbToRead);
     1001    memcpy(&pDis->Instr.ab[offInstr], &g_pbImg[offBios], cbToRead);
    10021002    pDis->cbCachedInstr = (uint8_t)(offInstr + cbToRead);
    10031003    return VINF_SUCCESS;
     
    11381138            unsigned cbInstr;
    11391139            DISSTATE Dis;
    1140             Dis.arch.x86.ModRM.Bits.Mod = 3;
     1140            Dis.x86.ModRM.Bits.Mod = 3;
    11411141            int rc = DISInstrWithReader(uFlatAddr, fIs16Bit ? DISCPUMODE_16BIT : DISCPUMODE_32BIT,
    11421142                                        disReadOpcodeBytes, NULL, &Dis, &cbInstr);
     
    11461146                && Dis.pCurInstr->uOpcode != OP_INVALID
    11471147                && Dis.pCurInstr->uOpcode != OP_ILLUD2
    1148                 && (   !(Dis.arch.x86.fPrefix & DISPREFIX_ADDRSIZE)
     1148                && (   !(Dis.x86.fPrefix & DISPREFIX_ADDRSIZE)
    11491149                    || disAccessesMemory(&Dis)))
    11501150            {
  • trunk/src/VBox/Disassembler/Disasm.cpp

    r99319 r101539  
    5555    RT_NOREF_PV(cbMinRead);
    5656    AssertMsgFailed(("disReadWord with no read callback in ring 0!!\n"));
    57     RT_BZERO(&pDis->u.abInstr[offInstr], cbMaxRead);
     57    RT_BZERO(&pDis->Instr.ab[offInstr], cbMaxRead);
    5858    pDis->cbCachedInstr = offInstr + cbMaxRead;
    5959    return VERR_DIS_NO_READ_CALLBACK;
     
    6666                                 ? cbMinRead
    6767                                 : (uint8_t)cbLeftOnPage;
    68     memcpy(&pDis->u.abInstr[offInstr], pbSrc, cbToRead);
     68    memcpy(&pDis->Instr.ab[offInstr], pbSrc, cbToRead);
    6969    pDis->cbCachedInstr = offInstr + cbToRead;
    7070    return VINF_SUCCESS;
     
    7474
    7575/**
    76  * Read more bytes into the DISSTATE::u.abInstr buffer, advance
     76 * Read more bytes into the DISSTATE::Instr.ab buffer, advance
    7777 * DISSTATE::cbCachedInstr.
    7878 *
    7979 * Will set DISSTATE::rc on failure, but still advance cbCachedInstr.
    8080 *
    81  * The caller shall fend off reads beyond the DISSTATE::u.abInstr buffer.
     81 * The caller shall fend off reads beyond the DISSTATE::Instr.ab buffer.
    8282 *
    8383 * @param   pDis                The disassembler state.
     
    8888DECLHIDDEN(void) disReadMore(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMin)
    8989{
    90     Assert(cbMin + offInstr <= sizeof(pDis->u.abInstr));
     90    Assert(cbMin + offInstr <= sizeof(pDis->Instr.ab));
    9191
    9292    /*
     
    108108    /*
    109109     * Do the read.
    110      * (No need to zero anything on failure as u.abInstr is already zeroed by the
     110     * (No need to zero anything on failure as Instr.ab is already zeroed by the
    111111     * DISInstrEx API.)
    112112     */
    113     int rc = pDis->pfnReadBytes(pDis, offInstr, cbMin, sizeof(pDis->u.abInstr) - offInstr);
     113    int rc = pDis->pfnReadBytes(pDis, offInstr, cbMin, sizeof(pDis->Instr.ab) - offInstr);
    114114    if (RT_SUCCESS(rc))
    115115    {
    116116        Assert(pDis->cbCachedInstr >= offInstr + cbMin);
    117         Assert(pDis->cbCachedInstr <= sizeof(pDis->u.abInstr));
     117        Assert(pDis->cbCachedInstr <= sizeof(pDis->Instr.ab));
    118118    }
    119119    else
     
    138138    {
    139139        disReadMore(pDis, (uint8_t)offInstr, 1);
    140         return pDis->u.abInstr[offInstr];
     140        return pDis->Instr.ab[offInstr];
    141141    }
    142142
    143143    Log(("disReadByte: too long instruction...\n"));
    144144    pDis->rc = VERR_DIS_TOO_LONG_INSTR;
    145     ssize_t cbLeft = (ssize_t)(sizeof(pDis->u.abInstr) - offInstr);
     145    ssize_t cbLeft = (ssize_t)(sizeof(pDis->Instr.ab) - offInstr);
    146146    if (cbLeft > 0)
    147         return pDis->u.abInstr[offInstr];
     147        return pDis->Instr.ab[offInstr];
    148148    return 0;
    149149}
     
    164164        disReadMore(pDis, (uint8_t)offInstr, 2);
    165165#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    166         return *(uint16_t const *)&pDis->u.abInstr[offInstr];
    167 #else
    168         return RT_MAKE_U16(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1]);
     166        return *(uint16_t const *)&pDis->Instr.ab[offInstr];
     167#else
     168        return RT_MAKE_U16(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1]);
    169169#endif
    170170    }
     
    172172    Log(("disReadWord: too long instruction...\n"));
    173173    pDis->rc = VERR_DIS_TOO_LONG_INSTR;
    174     ssize_t cbLeft = (ssize_t)(sizeof(pDis->u.abInstr) - offInstr);
     174    ssize_t cbLeft = (ssize_t)(sizeof(pDis->Instr.ab) - offInstr);
    175175    switch (cbLeft)
    176176    {
    177177        case 1:
    178             return pDis->u.abInstr[offInstr];
     178            return pDis->Instr.ab[offInstr];
    179179        default:
    180180            if (cbLeft >= 2)
    181                 return RT_MAKE_U16(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1]);
     181                return RT_MAKE_U16(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1]);
    182182            return 0;
    183183    }
     
    199199        disReadMore(pDis, (uint8_t)offInstr, 4);
    200200#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    201         return *(uint32_t const *)&pDis->u.abInstr[offInstr];
    202 #else
    203         return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    204                                    pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3]);
     201        return *(uint32_t const *)&pDis->Instr.ab[offInstr];
     202#else
     203        return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     204                                   pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3]);
    205205#endif
    206206    }
     
    208208    Log(("disReadDWord: too long instruction...\n"));
    209209    pDis->rc = VERR_DIS_TOO_LONG_INSTR;
    210     ssize_t cbLeft = (ssize_t)(sizeof(pDis->u.abInstr) - offInstr);
     210    ssize_t cbLeft = (ssize_t)(sizeof(pDis->Instr.ab) - offInstr);
    211211    switch (cbLeft)
    212212    {
    213213        case 1:
    214             return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr], 0, 0, 0);
     214            return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr], 0, 0, 0);
    215215        case 2:
    216             return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1], 0, 0);
     216            return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1], 0, 0);
    217217        case 3:
    218             return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1], pDis->u.abInstr[offInstr + 2], 0);
     218            return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1], pDis->Instr.ab[offInstr + 2], 0);
    219219        default:
    220220            if (cbLeft >= 4)
    221                 return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    222                                            pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3]);
     221                return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     222                                           pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3]);
    223223            return 0;
    224224    }
     
    240240        disReadMore(pDis, (uint8_t)offInstr, 8);
    241241#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    242         return *(uint64_t const *)&pDis->u.abInstr[offInstr];
    243 #else
    244         return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    245                                    pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    246                                    pDis->u.abInstr[offInstr + 4], pDis->u.abInstr[offInstr + 5],
    247                                    pDis->u.abInstr[offInstr + 6], pDis->u.abInstr[offInstr + 7]);
     242        return *(uint64_t const *)&pDis->Instr.ab[offInstr];
     243#else
     244        return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     245                                   pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     246                                   pDis->Instr.ab[offInstr + 4], pDis->Instr.ab[offInstr + 5],
     247                                   pDis->Instr.ab[offInstr + 6], pDis->Instr.ab[offInstr + 7]);
    248248#endif
    249249    }
     
    251251    Log(("disReadQWord: too long instruction...\n"));
    252252    pDis->rc = VERR_DIS_TOO_LONG_INSTR;
    253     ssize_t cbLeft = (ssize_t)(sizeof(pDis->u.abInstr) - offInstr);
     253    ssize_t cbLeft = (ssize_t)(sizeof(pDis->Instr.ab) - offInstr);
    254254    switch (cbLeft)
    255255    {
    256256        case 1:
    257             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr], 0, 0, 0,   0, 0, 0, 0);
     257            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr], 0, 0, 0,   0, 0, 0, 0);
    258258        case 2:
    259             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1], 0, 0,   0, 0, 0, 0);
     259            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1], 0, 0,   0, 0, 0, 0);
    260260        case 3:
    261             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    262                                        pDis->u.abInstr[offInstr + 2], 0,   0, 0, 0, 0);
     261            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     262                                       pDis->Instr.ab[offInstr + 2], 0,   0, 0, 0, 0);
    263263        case 4:
    264             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    265                                        pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
     264            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     265                                       pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
    266266                                       0, 0, 0, 0);
    267267        case 5:
    268             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    269                                        pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    270                                        pDis->u.abInstr[offInstr + 4], 0, 0, 0);
     268            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     269                                       pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     270                                       pDis->Instr.ab[offInstr + 4], 0, 0, 0);
    271271        case 6:
    272             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    273                                        pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    274                                        pDis->u.abInstr[offInstr + 4], pDis->u.abInstr[offInstr + 5],
     272            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     273                                       pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     274                                       pDis->Instr.ab[offInstr + 4], pDis->Instr.ab[offInstr + 5],
    275275                                       0, 0);
    276276        case 7:
    277             return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    278                                        pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    279                                        pDis->u.abInstr[offInstr + 4], pDis->u.abInstr[offInstr + 5],
    280                                        pDis->u.abInstr[offInstr + 6], 0);
     277            return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     278                                       pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     279                                       pDis->Instr.ab[offInstr + 4], pDis->Instr.ab[offInstr + 5],
     280                                       pDis->Instr.ab[offInstr + 6], 0);
    281281        default:
    282282            if (cbLeft >= 8)
    283                 return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    284                                            pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    285                                            pDis->u.abInstr[offInstr + 4], pDis->u.abInstr[offInstr + 5],
    286                                            pDis->u.abInstr[offInstr + 6], pDis->u.abInstr[offInstr + 7]);
     283                return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     284                                           pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     285                                           pDis->Instr.ab[offInstr + 4], pDis->Instr.ab[offInstr + 5],
     286                                           pDis->Instr.ab[offInstr + 6], pDis->Instr.ab[offInstr + 7]);
    287287            return 0;
    288288    }
     
    424424    else
    425425    {
    426         if (cbPretched >= sizeof(pDis->u.abInstr))
     426        if (cbPretched >= sizeof(pDis->Instr.ab))
    427427        {
    428             memcpy(pDis->u.abInstr, pvPrefetched, sizeof(pDis->u.abInstr));
    429             pDis->cbCachedInstr = (uint8_t)sizeof(pDis->u.abInstr);
     428            memcpy(pDis->Instr.ab, pvPrefetched, sizeof(pDis->Instr.ab));
     429            pDis->cbCachedInstr = (uint8_t)sizeof(pDis->Instr.ab);
    430430        }
    431431        else
    432432        {
    433             memcpy(pDis->u.abInstr, pvPrefetched, cbPretched);
     433            memcpy(pDis->Instr.ab, pvPrefetched, cbPretched);
    434434            pDis->cbCachedInstr = (uint8_t)cbPretched;
    435435        }
  • trunk/src/VBox/Disassembler/DisasmCore-armv8.cpp

    r99334 r101539  
    152152    if (pInsnParm->cBits <= 8)
    153153    {
    154         pParam->arch.armv8.cb = sizeof(uint8_t);
     154        pParam->armv8.cb = sizeof(uint8_t);
    155155        pParam->fUse |= DISUSE_IMMEDIATE8;
    156156    }
    157157    else if (pInsnParm->cBits <= 16)
    158158    {
    159         pParam->arch.armv8.cb = sizeof(uint16_t);
     159        pParam->armv8.cb = sizeof(uint16_t);
    160160        pParam->fUse |= DISUSE_IMMEDIATE16;
    161161    }
    162162    else if (pInsnParm->cBits <= 32)
    163163    {
    164         pParam->arch.armv8.cb = sizeof(uint32_t);
     164        pParam->armv8.cb = sizeof(uint32_t);
    165165        pParam->fUse |= DISUSE_IMMEDIATE32;
    166166    }
     
    181181    if (pInsnParm->cBits <= 8)
    182182    {
    183         pParam->arch.armv8.cb = sizeof(int8_t);
     183        pParam->armv8.cb = sizeof(int8_t);
    184184        pParam->fUse |= DISUSE_IMMEDIATE8_REL;
    185185    }
    186186    else if (pInsnParm->cBits <= 16)
    187187    {
    188         pParam->arch.armv8.cb = sizeof(int16_t);
     188        pParam->armv8.cb = sizeof(int16_t);
    189189        pParam->fUse |= DISUSE_IMMEDIATE16_REL;
    190190    }
    191191    else if (pInsnParm->cBits <= 32)
    192192    {
    193         pParam->arch.armv8.cb = sizeof(int32_t);
     193        pParam->armv8.cb = sizeof(int32_t);
    194194        pParam->fUse |= DISUSE_IMMEDIATE32_REL;
    195195    }
     
    215215{
    216216    RT_NOREF(pDis, pInsnClass);
    217     pParam->arch.armv8.Reg.idxGenReg = disArmV8ExtractBitVecFromInsn(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits);
    218     pParam->arch.armv8.cb            = f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
     217    pParam->armv8.Reg.idxGenReg = disArmV8ExtractBitVecFromInsn(u32Insn, pInsnParm->idxBitStart, pInsnParm->cBits);
     218    pParam->armv8.cb            = f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
    219219    pParam->fUse |= f64Bit ? DISUSE_REG_GEN64 : DISUSE_REG_GEN32;
    220220    return VINF_SUCCESS;
     
    238238    /** @todo Decode according to spec. */
    239239    pParam->uValue        = u32ImmRaw;
    240     pParam->arch.armv8.cb = sizeof(uint32_t);
     240    pParam->armv8.cb = sizeof(uint32_t);
    241241    pParam->fUse         |= DISUSE_IMMEDIATE32;
    242242    return VINF_SUCCESS;
     
    301301
    302302    /* Should contain the parameter type on input. */
    303     pDis->Param1.arch.armv8.fParam = pOp->Opc.fParam1;
    304     pDis->Param2.arch.armv8.fParam = pOp->Opc.fParam2;
    305     pDis->Param3.arch.armv8.fParam = pOp->Opc.fParam3;
    306     pDis->Param4.arch.armv8.fParam = pOp->Opc.fParam4;
     303    pDis->Param1.armv8.fParam = pOp->Opc.fParam1;
     304    pDis->Param2.armv8.fParam = pOp->Opc.fParam2;
     305    pDis->Param3.armv8.fParam = pOp->Opc.fParam3;
     306    pDis->Param4.armv8.fParam = pOp->Opc.fParam4;
    307307
    308308    pDis->pCurInstr = &pOp->Opc;
     
    337337        pDis->pCurInstr = &g_ArmV8A64InvalidOpcode[0];
    338338
    339         pDis->Param1.arch.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam1;
    340         pDis->Param2.arch.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam2;
    341         pDis->Param3.arch.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam3;
    342         pDis->Param4.arch.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam4;
     339        pDis->Param1.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam1;
     340        pDis->Param2.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam2;
     341        pDis->Param3.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam3;
     342        pDis->Param4.armv8.fParam = g_ArmV8A64InvalidOpcode[0].fParam4;
    343343    }
    344344    pDis->rc = rc;
     
    438438            return pDis->rc;
    439439
    440         pDis->u.u32   = RT_LE2H_U32(u32Insn);
    441         pDis->cbInstr = sizeof(u32Insn);
     440        /** @todo r=bird: This is a waste of time if the host is little endian... */
     441        pDis->Instr.u32 = RT_LE2H_U32(u32Insn);
     442        pDis->cbInstr   = sizeof(u32Insn);
    442443
    443444        return disInstrArmV8DecodeWorker(pDis, u32Insn, &g_ArmV8A64DecodeL0.Hdr);
  • trunk/src/VBox/Disassembler/DisasmCore-x86-amd64.cpp

    r99240 r101539  
    238238     */
    239239    bool fFiltered;
    240     if ((pOp->fOpType & pDis->arch.x86.fFilter) == 0)
     240    if ((pOp->fOpType & pDis->x86.fFilter) == 0)
    241241    {
    242242        fFiltered = true;
    243         pDis->arch.x86.pfnDisasmFnTable = g_apfnCalcSize;
     243        pDis->x86.pfnDisasmFnTable = g_apfnCalcSize;
    244244    }
    245245    else
     
    247247        /* Not filtered out -> full disassembly */
    248248        fFiltered = false;
    249         pDis->arch.x86.pfnDisasmFnTable = g_apfnFullDisasm;
     249        pDis->x86.pfnDisasmFnTable = g_apfnFullDisasm;
    250250    }
    251251
    252252    // Should contain the parameter type on input
    253     pDis->Param1.arch.x86.fParam = pOp->fParam1;
    254     pDis->Param2.arch.x86.fParam = pOp->fParam2;
    255     pDis->Param3.arch.x86.fParam = pOp->fParam3;
    256     pDis->Param4.arch.x86.fParam = pOp->fParam4;
     253    pDis->Param1.x86.fParam = pOp->fParam1;
     254    pDis->Param2.x86.fParam = pOp->fParam2;
     255    pDis->Param3.x86.fParam = pOp->fParam3;
     256    pDis->Param4.x86.fParam = pOp->fParam4;
    257257
    258258    /* Correct the operand size if the instruction is marked as forced or default 64 bits */
     
    264264        {
    265265            if (pOp->fOpType & DISOPTYPE_X86_FORCED_64_OP_SIZE)
    266                 pDis->arch.x86.uOpMode = DISCPUMODE_64BIT;
     266                pDis->x86.uOpMode = DISCPUMODE_64BIT;
    267267            else if (   (pOp->fOpType & DISOPTYPE_X86_DEFAULT_64_OP_SIZE)
    268                      && !(pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE))
    269                 pDis->arch.x86.uOpMode = DISCPUMODE_64BIT;
     268                     && !(pDis->x86.fPrefix & DISPREFIX_OPSIZE))
     269                pDis->x86.uOpMode = DISCPUMODE_64BIT;
    270270        }
    271271        else if (pOp->fOpType & DISOPTYPE_X86_FORCED_32_OP_SIZE_X86)
     
    273273            /* Forced 32 bits operand size for certain instructions (mov crx, mov drx). */
    274274            Assert(pDis->uCpuMode != DISCPUMODE_64BIT);
    275             pDis->arch.x86.uOpMode = DISCPUMODE_32BIT;
     275            pDis->x86.uOpMode = DISCPUMODE_32BIT;
    276276        }
    277277    }
     
    279279    if (pOp->idxParse1 != IDX_ParseNop)
    280280    {
    281         offInstr = pDis->arch.x86.pfnDisasmFnTable[pOp->idxParse1](offInstr, pOp, pDis, &pDis->Param1);
    282         if (fFiltered == false) pDis->Param1.arch.x86.cb = DISGetParamSize(pDis, &pDis->Param1);
     281        offInstr = pDis->x86.pfnDisasmFnTable[pOp->idxParse1](offInstr, pOp, pDis, &pDis->Param1);
     282        if (fFiltered == false) pDis->Param1.x86.cb = DISGetParamSize(pDis, &pDis->Param1);
    283283    }
    284284
    285285    if (pOp->idxParse2 != IDX_ParseNop)
    286286    {
    287         offInstr = pDis->arch.x86.pfnDisasmFnTable[pOp->idxParse2](offInstr, pOp, pDis, &pDis->Param2);
    288         if (fFiltered == false) pDis->Param2.arch.x86.cb = DISGetParamSize(pDis, &pDis->Param2);
     287        offInstr = pDis->x86.pfnDisasmFnTable[pOp->idxParse2](offInstr, pOp, pDis, &pDis->Param2);
     288        if (fFiltered == false) pDis->Param2.x86.cb = DISGetParamSize(pDis, &pDis->Param2);
    289289    }
    290290
    291291    if (pOp->idxParse3 != IDX_ParseNop)
    292292    {
    293         offInstr = pDis->arch.x86.pfnDisasmFnTable[pOp->idxParse3](offInstr, pOp, pDis, &pDis->Param3);
    294         if (fFiltered == false) pDis->Param3.arch.x86.cb = DISGetParamSize(pDis, &pDis->Param3);
     293        offInstr = pDis->x86.pfnDisasmFnTable[pOp->idxParse3](offInstr, pOp, pDis, &pDis->Param3);
     294        if (fFiltered == false) pDis->Param3.x86.cb = DISGetParamSize(pDis, &pDis->Param3);
    295295    }
    296296
    297297    if (pOp->idxParse4 != IDX_ParseNop)
    298298    {
    299         offInstr = pDis->arch.x86.pfnDisasmFnTable[pOp->idxParse4](offInstr, pOp, pDis, &pDis->Param4);
    300         if (fFiltered == false) pDis->Param4.arch.x86.cb = DISGetParamSize(pDis, &pDis->Param4);
     299        offInstr = pDis->x86.pfnDisasmFnTable[pOp->idxParse4](offInstr, pOp, pDis, &pDis->Param4);
     300        if (fFiltered == false) pDis->Param4.x86.cb = DISGetParamSize(pDis, &pDis->Param4);
    301301    }
    302302    // else simple one byte instruction
     
    313313
    314314    uint8_t    ModRM = disReadByte(pDis, offInstr);
    315     uint8_t    index = pDis->arch.x86.bOpCode - 0xD8;
     315    uint8_t    index = pDis->x86.bOpCode - 0xD8;
    316316    if (ModRM <= 0xBF)
    317317    {
     
    320320
    321321        // Should contain the parameter type on input
    322         pDis->Param1.arch.x86.fParam = fpop->fParam1;
    323         pDis->Param2.arch.x86.fParam = fpop->fParam2;
     322        pDis->Param1.x86.fParam = fpop->fParam1;
     323        pDis->Param2.x86.fParam = fpop->fParam2;
    324324    }
    325325    else
     
    333333     * @note Multibyte opcodes are always marked harmless until the final byte.
    334334     */
    335     if ((fpop->fOpType & pDis->arch.x86.fFilter) == 0)
    336         pDis->arch.x86.pfnDisasmFnTable = g_apfnCalcSize;
     335    if ((fpop->fOpType & pDis->x86.fFilter) == 0)
     336        pDis->x86.pfnDisasmFnTable = g_apfnCalcSize;
    337337    else
    338338        /* Not filtered out -> full disassembly */
    339         pDis->arch.x86.pfnDisasmFnTable = g_apfnFullDisasm;
     339        pDis->x86.pfnDisasmFnTable = g_apfnFullDisasm;
    340340
    341341    /* Correct the operand size if the instruction is marked as forced or default 64 bits */
     
    347347        /* Note: redundant, but just in case this ever changes */
    348348        if (fpop->fOpType & DISOPTYPE_X86_FORCED_64_OP_SIZE)
    349             pDis->arch.x86.uOpMode = DISCPUMODE_64BIT;
     349            pDis->x86.uOpMode = DISCPUMODE_64BIT;
    350350        else if (    (fpop->fOpType & DISOPTYPE_X86_DEFAULT_64_OP_SIZE)
    351                  &&  !(pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE))
    352             pDis->arch.x86.uOpMode = DISCPUMODE_64BIT;
     351                 &&  !(pDis->x86.fPrefix & DISPREFIX_OPSIZE))
     352            pDis->x86.uOpMode = DISCPUMODE_64BIT;
    353353    }
    354354
     
    358358
    359359    if (fpop->idxParse1 != IDX_ParseNop)
    360         offInstr = pDis->arch.x86.pfnDisasmFnTable[fpop->idxParse1](offInstr, fpop, pDis, pParam);
     360        offInstr = pDis->x86.pfnDisasmFnTable[fpop->idxParse1](offInstr, fpop, pDis, pParam);
    361361
    362362    if (fpop->idxParse2 != IDX_ParseNop)
    363         offInstr = pDis->arch.x86.pfnDisasmFnTable[fpop->idxParse2](offInstr, fpop, pDis, pParam);
     363        offInstr = pDis->x86.pfnDisasmFnTable[fpop->idxParse2](offInstr, fpop, pDis, pParam);
    364364
    365365    return offInstr;
     
    378378static void UseSIB(PDISSTATE pDis, PDISOPPARAM pParam)
    379379{
    380     unsigned scale = pDis->arch.x86.SIB.Bits.Scale;
    381     uint8_t  base  = pDis->arch.x86.SIB.Bits.Base;
    382     uint8_t  index = pDis->arch.x86.SIB.Bits.Index;
     380    unsigned scale = pDis->x86.SIB.Bits.Scale;
     381    uint8_t  base  = pDis->x86.SIB.Bits.Base;
     382    uint8_t  index = pDis->x86.SIB.Bits.Index;
    383383
    384384    unsigned regtype, vregtype;
     
    387387     * is not an options since only one instruction (gather)
    388388     * supports it currently. May be changed in the future. */
    389         if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
     389        if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
    390390            regtype    = DISUSE_REG_GEN32;
    391391        else
    392392            regtype    = DISUSE_REG_GEN64;
    393393    if (pDis->pCurInstr->uOpcode == OP_GATHER)
    394         vregtype = (VEXREG_IS256B(pDis->arch.x86.bVexDestReg) ? DISUSE_REG_YMM : DISUSE_REG_XMM);
     394        vregtype = (VEXREG_IS256B(pDis->x86.bVexDestReg) ? DISUSE_REG_YMM : DISUSE_REG_XMM);
    395395    else
    396396        vregtype = regtype;
     
    399399    {
    400400        pParam->fUse |= DISUSE_INDEX | vregtype;
    401         pParam->arch.x86.Index.idxGenReg = index;
     401        pParam->x86.Index.idxGenReg = index;
    402402
    403403        if (scale != 0)
    404404        {
    405405            pParam->fUse  |= DISUSE_SCALE;
    406             pParam->arch.x86.uScale = (uint8_t)(1 << scale);
    407         }
    408     }
    409 
    410     if (base == 5 && pDis->arch.x86.ModRM.Bits.Mod == 0)
     406            pParam->x86.uScale = (uint8_t)(1 << scale);
     407        }
     408    }
     409
     410    if (base == 5 && pDis->x86.ModRM.Bits.Mod == 0)
    411411    {
    412412        // [scaled index] + disp32
    413         if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
     413        if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
    414414        {
    415415            pParam->fUse |= DISUSE_DISPLACEMENT32;
    416             pParam->arch.x86.uDisp.i32 = pDis->arch.x86.i32SibDisp;
     416            pParam->x86.uDisp.i32 = pDis->x86.i32SibDisp;
    417417        }
    418418        else
    419419        {   /* sign-extend to 64 bits */
    420420            pParam->fUse |= DISUSE_DISPLACEMENT64;
    421             pParam->arch.x86.uDisp.i64 = pDis->arch.x86.i32SibDisp;
     421            pParam->x86.uDisp.i64 = pDis->x86.i32SibDisp;
    422422        }
    423423    }
     
    425425    {
    426426        pParam->fUse |= DISUSE_BASE | regtype;
    427         pParam->arch.x86.Base.idxGenReg = base;
     427        pParam->x86.Base.idxGenReg = base;
    428428    }
    429429    return;   /* Already fetched everything in ParseSIB; no size returned */
     
    438438    offInstr++;
    439439
    440     pDis->arch.x86.SIB.Bits.Base  = SIB_BASE(SIB);
    441     pDis->arch.x86.SIB.Bits.Index = SIB_INDEX(SIB);
    442     pDis->arch.x86.SIB.Bits.Scale = SIB_SCALE(SIB);
    443 
    444     if (pDis->arch.x86.fPrefix & DISPREFIX_REX)
     440    pDis->x86.SIB.Bits.Base  = SIB_BASE(SIB);
     441    pDis->x86.SIB.Bits.Index = SIB_INDEX(SIB);
     442    pDis->x86.SIB.Bits.Scale = SIB_SCALE(SIB);
     443
     444    if (pDis->x86.fPrefix & DISPREFIX_REX)
    445445    {
    446446        /* REX.B extends the Base field if not scaled index + disp32 */
    447         if (!(pDis->arch.x86.SIB.Bits.Base == 5 && pDis->arch.x86.ModRM.Bits.Mod == 0))
    448             pDis->arch.x86.SIB.Bits.Base  |= (!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3;
    449 
    450         pDis->arch.x86.SIB.Bits.Index |= (!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_X)) << 3;
    451     }
    452 
    453     if (    pDis->arch.x86.SIB.Bits.Base == 5
    454         &&  pDis->arch.x86.ModRM.Bits.Mod == 0)
     447        if (!(pDis->x86.SIB.Bits.Base == 5 && pDis->x86.ModRM.Bits.Mod == 0))
     448            pDis->x86.SIB.Bits.Base  |= (!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3;
     449
     450        pDis->x86.SIB.Bits.Index |= (!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_X)) << 3;
     451    }
     452
     453    if (    pDis->x86.SIB.Bits.Base == 5
     454        &&  pDis->x86.ModRM.Bits.Mod == 0)
    455455    {
    456456        /* Additional 32 bits displacement. No change in long mode. */
    457         pDis->arch.x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
     457        pDis->x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
    458458        offInstr += 4;
    459459    }
     
    469469    offInstr++;
    470470
    471     pDis->arch.x86.SIB.Bits.Base  = SIB_BASE(SIB);
    472     pDis->arch.x86.SIB.Bits.Index = SIB_INDEX(SIB);
    473     pDis->arch.x86.SIB.Bits.Scale = SIB_SCALE(SIB);
    474 
    475     if (pDis->arch.x86.fPrefix & DISPREFIX_REX)
     471    pDis->x86.SIB.Bits.Base  = SIB_BASE(SIB);
     472    pDis->x86.SIB.Bits.Index = SIB_INDEX(SIB);
     473    pDis->x86.SIB.Bits.Scale = SIB_SCALE(SIB);
     474
     475    if (pDis->x86.fPrefix & DISPREFIX_REX)
    476476    {
    477477        /* REX.B extends the Base field. */
    478         pDis->arch.x86.SIB.Bits.Base  |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
     478        pDis->x86.SIB.Bits.Base  |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
    479479        /* REX.X extends the Index field. */
    480         pDis->arch.x86.SIB.Bits.Index |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_X)) << 3);
    481     }
    482 
    483     if (    pDis->arch.x86.SIB.Bits.Base == 5
    484         &&  pDis->arch.x86.ModRM.Bits.Mod == 0)
     480        pDis->x86.SIB.Bits.Index |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_X)) << 3);
     481    }
     482
     483    if (    pDis->x86.SIB.Bits.Base == 5
     484        &&  pDis->x86.ModRM.Bits.Mod == 0)
    485485    {
    486486        /* Additional 32 bits displacement. No change in long mode. */
     
    506506
    507507#ifdef LOG_ENABLED
    508     unsigned type    = OP_PARM_VTYPE(pParam->arch.x86.fParam);
     508    unsigned type    = OP_PARM_VTYPE(pParam->x86.fParam);
    509509#endif
    510     unsigned subtype = OP_PARM_VSUBTYPE(pParam->arch.x86.fParam);
     510    unsigned subtype = OP_PARM_VSUBTYPE(pParam->x86.fParam);
    511511    if (fRegAddr)
    512         subtype = (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT) ? OP_PARM_q : OP_PARM_d;
     512        subtype = (pDis->x86.uAddrMode == DISCPUMODE_64BIT) ? OP_PARM_q : OP_PARM_d;
    513513    else if (subtype == OP_PARM_v || subtype == OP_PARM_NONE || subtype == OP_PARM_y)
    514514    {
    515         switch (pDis->arch.x86.uOpMode)
     515        switch (pDis->x86.uOpMode)
    516516        {
    517517        case DISCPUMODE_32BIT:
     
    534534    {
    535535    case OP_PARM_b:
    536         Assert(idx < (pDis->arch.x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
     536        Assert(idx < (pDis->x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
    537537
    538538        /* AH, BH, CH & DH map to DIL, SIL, EBL & SPL when a rex prefix is present. */
    539539        /* Intel 64 and IA-32 Architectures Software Developer's Manual: 3.4.1.1 */
    540         if (    (pDis->arch.x86.fPrefix & DISPREFIX_REX)
     540        if (    (pDis->x86.fPrefix & DISPREFIX_REX)
    541541            &&  idx >= DISGREG_AH
    542542            &&  idx <= DISGREG_BH)
     
    546546
    547547        pParam->fUse |= DISUSE_REG_GEN8;
    548         pParam->arch.x86.Base.idxGenReg = (uint8_t)idx;
     548        pParam->x86.Base.idxGenReg = (uint8_t)idx;
    549549        break;
    550550
    551551    case OP_PARM_w:
    552         Assert(idx < (pDis->arch.x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
     552        Assert(idx < (pDis->x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
    553553
    554554        pParam->fUse |= DISUSE_REG_GEN16;
    555         pParam->arch.x86.Base.idxGenReg = (uint8_t)idx;
     555        pParam->x86.Base.idxGenReg = (uint8_t)idx;
    556556        break;
    557557
    558558    case OP_PARM_d:
    559         Assert(idx < (pDis->arch.x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
     559        Assert(idx < (pDis->x86.fPrefix & DISPREFIX_REX ? 16U : 8U));
    560560
    561561        if (   !(pOp->fOpType & DISOPTYPE_X86_DEFAULT_64_OP_SIZE) /* Tweak for vpmovmskb & pmovmskb. */
    562             || pDis->arch.x86.uOpMode != DISCPUMODE_64BIT)
     562            || pDis->x86.uOpMode != DISCPUMODE_64BIT)
    563563            pParam->fUse |= DISUSE_REG_GEN32;
    564564        else
    565565            pParam->fUse |= DISUSE_REG_GEN64;
    566         pParam->arch.x86.Base.idxGenReg = (uint8_t)idx;
     566        pParam->x86.Base.idxGenReg = (uint8_t)idx;
    567567        break;
    568568
    569569    case OP_PARM_q:
    570570        pParam->fUse |= DISUSE_REG_GEN64;
    571         pParam->arch.x86.Base.idxGenReg = (uint8_t)idx;
     571        pParam->x86.Base.idxGenReg = (uint8_t)idx;
    572572        break;
    573573
     
    587587    RT_NOREF_PV(pDis); RT_NOREF_PV(pOp);
    588588    pParam->fUse |= DISUSE_REG_GEN16;
    589     pParam->arch.x86.Base.idxGenReg = s_auBaseModRMReg16[idx];
     589    pParam->x86.Base.idxGenReg = s_auBaseModRMReg16[idx];
    590590    if (idx < 4)
    591591    {
    592592        static const uint8_t s_auIndexModRMReg16[4] = { DISGREG_SI, DISGREG_DI, DISGREG_SI, DISGREG_DI };
    593593        pParam->fUse |= DISUSE_INDEX;
    594         pParam->arch.x86.Index.idxGenReg = s_auIndexModRMReg16[idx];
     594        pParam->x86.Index.idxGenReg = s_auIndexModRMReg16[idx];
    595595    }
    596596}
     
    608608
    609609    pParam->fUse |= DISUSE_REG_SEG;
    610     pParam->arch.x86.Base.idxSegReg = (uint8_t)idx;
     610    pParam->x86.Base.idxSegReg = (uint8_t)idx;
    611611}
    612612
     
    614614static size_t UseModRM(size_t const offInstr, PCDISOPCODE pOp, PDISSTATE pDis, PDISOPPARAM pParam)
    615615{
    616     unsigned vtype = OP_PARM_VTYPE(pParam->arch.x86.fParam);
    617     uint8_t  reg = pDis->arch.x86.ModRM.Bits.Reg;
    618     uint8_t  mod = pDis->arch.x86.ModRM.Bits.Mod;
    619     uint8_t  rm  = pDis->arch.x86.ModRM.Bits.Rm;
     616    unsigned vtype = OP_PARM_VTYPE(pParam->x86.fParam);
     617    uint8_t  reg = pDis->x86.ModRM.Bits.Reg;
     618    uint8_t  mod = pDis->x86.ModRM.Bits.Mod;
     619    uint8_t  rm  = pDis->x86.ModRM.Bits.Rm;
    620620
    621621    switch (vtype)
     
    634634
    635635                if (    pDis->pCurInstr->uOpcode == OP_MOV_CR
    636                     &&  pDis->arch.x86.uOpMode == DISCPUMODE_32BIT
    637                     &&  (pDis->arch.x86.fPrefix & DISPREFIX_LOCK))
     636                    &&  pDis->x86.uOpMode == DISCPUMODE_32BIT
     637                    &&  (pDis->x86.fPrefix & DISPREFIX_LOCK))
    638638                {
    639                     pDis->arch.x86.fPrefix &= ~DISPREFIX_LOCK;
    640                     pParam->arch.x86.Base.idxCtrlReg = DISCREG_CR8;
     639                    pDis->x86.fPrefix &= ~DISPREFIX_LOCK;
     640                    pParam->x86.Base.idxCtrlReg = DISCREG_CR8;
    641641                }
    642642                else
    643                     pParam->arch.x86.Base.idxCtrlReg = reg;
     643                    pParam->x86.Base.idxCtrlReg = reg;
    644644                return offInstr;
    645645
    646646            case OP_PARM_D: //debug register
    647647                pParam->fUse |= DISUSE_REG_DBG;
    648                 pParam->arch.x86.Base.idxDbgReg = reg;
     648                pParam->x86.Base.idxDbgReg = reg;
    649649                return offInstr;
    650650
     
    658658                reg &= 7;   /* REX.R has no effect here */
    659659                pParam->fUse |= DISUSE_REG_MMX;
    660                 pParam->arch.x86.Base.idxMmxReg = reg;
     660                pParam->x86.Base.idxMmxReg = reg;
    661661                return offInstr;
    662662
     
    670670                reg &= 7;   /* REX.R has no effect here */
    671671                pParam->fUse |= DISUSE_REG_TEST;
    672                 pParam->arch.x86.Base.idxTestReg = reg;
     672                pParam->x86.Base.idxTestReg = reg;
    673673                return offInstr;
    674674
     
    683683
    684684            case OP_PARM_V: //XMM register
    685                 if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg)
    686                     && OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_dq
    687                     && OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_q
    688                     && OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_d
    689                     && OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_w)
     685                if (VEXREG_IS256B(pDis->x86.bVexDestReg)
     686                    && OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_dq
     687                    && OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_q
     688                    && OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_d
     689                    && OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_w)
    690690                {
    691691                    // Use YMM register if VEX.L is set.
    692692                    pParam->fUse |= DISUSE_REG_YMM;
    693                     pParam->arch.x86.Base.idxYmmReg = reg;
     693                    pParam->x86.Base.idxYmmReg = reg;
    694694                }
    695695                else
    696696                {
    697697                    pParam->fUse |= DISUSE_REG_XMM;
    698                     pParam->arch.x86.Base.idxXmmReg = reg;
     698                    pParam->x86.Base.idxXmmReg = reg;
    699699                }
    700700                return offInstr;
     
    705705    /** @todo bound */
    706706
    707     if (pDis->arch.x86.uAddrMode != DISCPUMODE_16BIT)
    708     {
    709         Assert(pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT || pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT);
     707    if (pDis->x86.uAddrMode != DISCPUMODE_16BIT)
     708    {
     709        Assert(pDis->x86.uAddrMode == DISCPUMODE_32BIT || pDis->x86.uAddrMode == DISCPUMODE_64BIT);
    710710
    711711        /*
     
    724724                {
    725725                    pParam->fUse |= DISUSE_DISPLACEMENT32;
    726                     pParam->arch.x86.uDisp.i32 = pDis->arch.x86.i32SibDisp;
     726                    pParam->x86.uDisp.i32 = pDis->x86.i32SibDisp;
    727727                }
    728728                else
    729729                {
    730730                    pParam->fUse |= DISUSE_RIPDISPLACEMENT32;
    731                     pParam->arch.x86.uDisp.i32 = pDis->arch.x86.i32SibDisp;
     731                    pParam->x86.uDisp.i32 = pDis->x86.i32SibDisp;
    732732                }
    733733            }
     
    747747                disasmModRMReg(rm, pOp, pDis, pParam, 1);
    748748            }
    749             pParam->arch.x86.uDisp.i8 = pDis->arch.x86.i32SibDisp;
     749            pParam->x86.uDisp.i8 = pDis->x86.i32SibDisp;
    750750            pParam->fUse |= DISUSE_DISPLACEMENT8;
    751751            break;
     
    759759                disasmModRMReg(rm, pOp, pDis, pParam, 1);
    760760            }
    761             pParam->arch.x86.uDisp.i32 = pDis->arch.x86.i32SibDisp;
     761            pParam->x86.uDisp.i32 = pDis->x86.i32SibDisp;
    762762            pParam->fUse |= DISUSE_DISPLACEMENT32;
    763763            break;
     
    775775            if (rm == 6)
    776776            {//16 bits displacement
    777                 pParam->arch.x86.uDisp.i16 = pDis->arch.x86.i32SibDisp;
     777                pParam->x86.uDisp.i16 = pDis->x86.i32SibDisp;
    778778                pParam->fUse |= DISUSE_DISPLACEMENT16;
    779779            }
     
    787787        case 1: //effective address + 8 bits displacement
    788788            disasmModRMReg16(rm, pOp, pDis, pParam);
    789             pParam->arch.x86.uDisp.i8 = pDis->arch.x86.i32SibDisp;
     789            pParam->x86.uDisp.i8 = pDis->x86.i32SibDisp;
    790790            pParam->fUse |= DISUSE_BASE | DISUSE_DISPLACEMENT8;
    791791            break;
     
    793793        case 2: //effective address + 16 bits displacement
    794794            disasmModRMReg16(rm, pOp, pDis, pParam);
    795             pParam->arch.x86.uDisp.i16 = pDis->arch.x86.i32SibDisp;
     795            pParam->x86.uDisp.i16 = pDis->x86.i32SibDisp;
    796796            pParam->fUse |= DISUSE_BASE | DISUSE_DISPLACEMENT16;
    797797            break;
     
    809809static size_t QueryModRM(size_t offInstr, PCDISOPCODE pOp, PDISSTATE pDis, PDISOPPARAM pParam)
    810810{
    811     uint8_t mod = pDis->arch.x86.ModRM.Bits.Mod;
    812     uint8_t rm  = pDis->arch.x86.ModRM.Bits.Rm;
    813 
    814     if (pDis->arch.x86.uAddrMode != DISCPUMODE_16BIT)
    815     {
    816         Assert(pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT || pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT);
     811    uint8_t mod = pDis->x86.ModRM.Bits.Mod;
     812    uint8_t rm  = pDis->x86.ModRM.Bits.Rm;
     813
     814    if (pDis->x86.uAddrMode != DISCPUMODE_16BIT)
     815    {
     816        Assert(pDis->x86.uAddrMode == DISCPUMODE_32BIT || pDis->x86.uAddrMode == DISCPUMODE_64BIT);
    817817
    818818        /*
     
    827827            if (rm == 5)    /* 32 bits displacement */
    828828            {
    829                 pDis->arch.x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
     829                pDis->x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
    830830                offInstr += 4;
    831831            }
     
    834834
    835835        case 1: /* Effective address + 8 bits displacement */
    836             pDis->arch.x86.i32SibDisp = (int8_t)disReadByte(pDis, offInstr);
     836            pDis->x86.i32SibDisp = (int8_t)disReadByte(pDis, offInstr);
    837837            offInstr++;
    838838            break;
    839839
    840840        case 2: /* Effective address + 32 bits displacement */
    841             pDis->arch.x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
     841            pDis->x86.i32SibDisp = (int32_t)disReadDWord(pDis, offInstr);
    842842            offInstr += 4;
    843843            break;
     
    855855            if (rm == 6)
    856856            {
    857                 pDis->arch.x86.i32SibDisp = disReadWord(pDis, offInstr);
     857                pDis->x86.i32SibDisp = disReadWord(pDis, offInstr);
    858858                offInstr += 2;
    859859            }
     
    862862
    863863        case 1: /* Effective address + 8 bits displacement */
    864             pDis->arch.x86.i32SibDisp = (int8_t)disReadByte(pDis, offInstr);
     864            pDis->x86.i32SibDisp = (int8_t)disReadByte(pDis, offInstr);
    865865            offInstr++;
    866866            break;
    867867
    868868        case 2: /* Effective address + 32 bits displacement */
    869             pDis->arch.x86.i32SibDisp = (int16_t)disReadWord(pDis, offInstr);
     869            pDis->x86.i32SibDisp = (int16_t)disReadWord(pDis, offInstr);
    870870            offInstr += 2;
    871871            break;
     
    882882static size_t QueryModRM_SizeOnly(size_t offInstr, PCDISOPCODE pOp, PDISSTATE pDis, PDISOPPARAM pParam)
    883883{
    884     uint8_t mod = pDis->arch.x86.ModRM.Bits.Mod;
    885     uint8_t rm  = pDis->arch.x86.ModRM.Bits.Rm;
    886 
    887     if (pDis->arch.x86.uAddrMode != DISCPUMODE_16BIT)
    888     {
    889         Assert(pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT || pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT);
     884    uint8_t mod = pDis->x86.ModRM.Bits.Mod;
     885    uint8_t rm  = pDis->x86.ModRM.Bits.Rm;
     886
     887    if (pDis->x86.uAddrMode != DISCPUMODE_16BIT)
     888    {
     889        Assert(pDis->x86.uAddrMode == DISCPUMODE_32BIT || pDis->x86.uAddrMode == DISCPUMODE_64BIT);
    890890        /*
    891891         * Note: displacements in long mode are 8 or 32 bits and sign-extended to 64 bits
     
    956956    offInstr++;
    957957
    958     pDis->arch.x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
    959     pDis->arch.x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
    960     pDis->arch.x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
     958    pDis->x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
     959    pDis->x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
     960    pDis->x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
    961961
    962962    /* Disregard the mod bits for certain instructions (mov crx, mov drx).
     
    967967     */
    968968    if (pOp->fOpType & DISOPTYPE_X86_MOD_FIXED_11)
    969         pDis->arch.x86.ModRM.Bits.Mod = 3;
    970 
    971     if (pDis->arch.x86.fPrefix & DISPREFIX_REX)
     969        pDis->x86.ModRM.Bits.Mod = 3;
     970
     971    if (pDis->x86.fPrefix & DISPREFIX_REX)
    972972    {
    973973        Assert(pDis->uCpuMode == DISCPUMODE_64BIT);
    974974
    975975        /* REX.R extends the Reg field. */
    976         pDis->arch.x86.ModRM.Bits.Reg |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_R)) << 3);
     976        pDis->x86.ModRM.Bits.Reg |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_R)) << 3);
    977977
    978978        /* REX.B extends the Rm field if there is no SIB byte nor a 32 bits displacement */
    979         if (!(    pDis->arch.x86.ModRM.Bits.Mod != 3
    980               &&  pDis->arch.x86.ModRM.Bits.Rm  == 4)
     979        if (!(    pDis->x86.ModRM.Bits.Mod != 3
     980              &&  pDis->x86.ModRM.Bits.Rm  == 4)
    981981            &&
    982             !(    pDis->arch.x86.ModRM.Bits.Mod == 0
    983               &&  pDis->arch.x86.ModRM.Bits.Rm  == 5))
    984         {
    985             pDis->arch.x86.ModRM.Bits.Rm |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
     982            !(    pDis->x86.ModRM.Bits.Mod == 0
     983              &&  pDis->x86.ModRM.Bits.Rm  == 5))
     984        {
     985            pDis->x86.ModRM.Bits.Rm |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
    986986        }
    987987    }
     
    997997    offInstr++;
    998998
    999     pDis->arch.x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
    1000     pDis->arch.x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
    1001     pDis->arch.x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
     999    pDis->x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
     1000    pDis->x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
     1001    pDis->x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
    10021002
    10031003    /* Disregard the mod bits for certain instructions (mov crx, mov drx).
     
    10081008     */
    10091009    if (pOp->fOpType & DISOPTYPE_X86_MOD_FIXED_11)
    1010         pDis->arch.x86.ModRM.Bits.Mod = 3;
    1011 
    1012     if (pDis->arch.x86.fPrefix & DISPREFIX_REX)
     1010        pDis->x86.ModRM.Bits.Mod = 3;
     1011
     1012    if (pDis->x86.fPrefix & DISPREFIX_REX)
    10131013    {
    10141014        Assert(pDis->uCpuMode == DISCPUMODE_64BIT);
    10151015
    10161016        /* REX.R extends the Reg field. */
    1017         pDis->arch.x86.ModRM.Bits.Reg |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_R)) << 3);
     1017        pDis->x86.ModRM.Bits.Reg |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_R)) << 3);
    10181018
    10191019        /* REX.B extends the Rm field if there is no SIB byte nor a 32 bits displacement */
    1020         if (!(    pDis->arch.x86.ModRM.Bits.Mod != 3
    1021               &&  pDis->arch.x86.ModRM.Bits.Rm  == 4)
     1020        if (!(    pDis->x86.ModRM.Bits.Mod != 3
     1021              &&  pDis->x86.ModRM.Bits.Rm  == 4)
    10221022            &&
    1023             !(    pDis->arch.x86.ModRM.Bits.Mod == 0
    1024               &&  pDis->arch.x86.ModRM.Bits.Rm  == 5))
    1025         {
    1026             pDis->arch.x86.ModRM.Bits.Rm |= ((!!(pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
     1023            !(    pDis->x86.ModRM.Bits.Mod == 0
     1024              &&  pDis->x86.ModRM.Bits.Rm  == 5))
     1025        {
     1026            pDis->x86.ModRM.Bits.Rm |= ((!!(pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)) << 3);
    10271027        }
    10281028    }
     
    10471047    RT_NOREF_PV(pOp);
    10481048    uint8_t byte = disReadByte(pDis, offInstr);
    1049     if (pParam->arch.x86.fParam == OP_PARM_Lx)
    1050     {
    1051         pParam->fUse  |= (VEXREG_IS256B(pDis->arch.x86.bVexDestReg) ? DISUSE_REG_YMM : DISUSE_REG_XMM);
     1049    if (pParam->x86.fParam == OP_PARM_Lx)
     1050    {
     1051        pParam->fUse  |= (VEXREG_IS256B(pDis->x86.bVexDestReg) ? DISUSE_REG_YMM : DISUSE_REG_XMM);
    10521052
    10531053        // Ignore MSB in 32-bit mode.
     
    10551055            byte &= 0x7f;
    10561056
    1057         pParam->arch.x86.Base.idxXmmReg = byte >> 4;
     1057        pParam->x86.Base.idxXmmReg = byte >> 4;
    10581058    }
    10591059    else
     
    10611061        pParam->uValue = byte;
    10621062        pParam->fUse  |= DISUSE_IMMEDIATE8;
    1063         pParam->arch.x86.cb     = sizeof(uint8_t);
     1063        pParam->x86.cb     = sizeof(uint8_t);
    10641064    }
    10651065    return offInstr + 1;
     
    10771077{
    10781078    RT_NOREF_PV(pOp);
    1079     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1079    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    10801080    {
    10811081        pParam->uValue = (uint32_t)(int8_t)disReadByte(pDis, offInstr);
    10821082        pParam->fUse  |= DISUSE_IMMEDIATE32_SX8;
    1083         pParam->arch.x86.cb     = sizeof(uint32_t);
    1084     }
    1085     else
    1086     if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1083        pParam->x86.cb     = sizeof(uint32_t);
     1084    }
     1085    else
     1086    if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    10871087    {
    10881088        pParam->uValue = (uint64_t)(int8_t)disReadByte(pDis, offInstr);
    10891089        pParam->fUse  |= DISUSE_IMMEDIATE64_SX8;
    1090         pParam->arch.x86.cb     = sizeof(uint64_t);
     1090        pParam->x86.cb     = sizeof(uint64_t);
    10911091    }
    10921092    else
     
    10941094        pParam->uValue = (uint16_t)(int8_t)disReadByte(pDis, offInstr);
    10951095        pParam->fUse  |= DISUSE_IMMEDIATE16_SX8;
    1096         pParam->arch.x86.cb     = sizeof(uint16_t);
     1096        pParam->x86.cb     = sizeof(uint16_t);
    10971097    }
    10981098    return offInstr + 1;
     
    11121112    pParam->uValue = disReadWord(pDis, offInstr);
    11131113    pParam->fUse  |= DISUSE_IMMEDIATE16;
    1114     pParam->arch.x86.cb     = sizeof(uint16_t);
     1114    pParam->x86.cb     = sizeof(uint16_t);
    11151115    return offInstr + 2;
    11161116}
     
    11291129    pParam->uValue = disReadDWord(pDis, offInstr);
    11301130    pParam->fUse  |= DISUSE_IMMEDIATE32;
    1131     pParam->arch.x86.cb     = sizeof(uint32_t);
     1131    pParam->x86.cb     = sizeof(uint32_t);
    11321132    return offInstr + 4;
    11331133}
     
    11461146    pParam->uValue = disReadQWord(pDis, offInstr);
    11471147    pParam->fUse  |= DISUSE_IMMEDIATE64;
    1148     pParam->arch.x86.cb     = sizeof(uint64_t);
     1148    pParam->x86.cb     = sizeof(uint64_t);
    11491149    return offInstr + 8;
    11501150}
     
    11611161{
    11621162    RT_NOREF_PV(pOp);
    1163     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1163    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    11641164    {
    11651165        pParam->uValue = disReadDWord(pDis, offInstr);
    11661166        pParam->fUse  |= DISUSE_IMMEDIATE32;
    1167         pParam->arch.x86.cb     = sizeof(uint32_t);
     1167        pParam->x86.cb     = sizeof(uint32_t);
    11681168        return offInstr + 4;
    11691169    }
    11701170
    1171     if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1171    if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    11721172    {
    11731173        pParam->uValue = disReadQWord(pDis, offInstr);
    11741174        pParam->fUse  |= DISUSE_IMMEDIATE64;
    1175         pParam->arch.x86.cb     = sizeof(uint64_t);
     1175        pParam->x86.cb     = sizeof(uint64_t);
    11761176        return offInstr + 8;
    11771177    }
     
    11791179    pParam->uValue = disReadWord(pDis, offInstr);
    11801180    pParam->fUse  |= DISUSE_IMMEDIATE16;
    1181     pParam->arch.x86.cb     = sizeof(uint16_t);
     1181    pParam->x86.cb     = sizeof(uint16_t);
    11821182    return offInstr + 2;
    11831183}
     
    11871187{
    11881188    RT_NOREF_PV(offInstr); RT_NOREF_PV(pOp); RT_NOREF_PV(pParam);
    1189     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1189    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    11901190        return offInstr + 4;
    1191     if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1191    if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    11921192        return offInstr + 8;
    11931193    return offInstr + 2;
     
    11991199    RT_NOREF_PV(pOp);
    12001200    /* Word for 16-bit operand-size or doubleword for 32 or 64-bit operand-size. */
    1201     if (pDis->arch.x86.uOpMode == DISCPUMODE_16BIT)
     1201    if (pDis->x86.uOpMode == DISCPUMODE_16BIT)
    12021202    {
    12031203        pParam->uValue = disReadWord(pDis, offInstr);
    12041204        pParam->fUse  |= DISUSE_IMMEDIATE16;
    1205         pParam->arch.x86.cb     = sizeof(uint16_t);
     1205        pParam->x86.cb     = sizeof(uint16_t);
    12061206        return offInstr + 2;
    12071207    }
    12081208
    12091209    /* 64 bits op mode means *sign* extend to 64 bits. */
    1210     if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1210    if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    12111211    {
    12121212        pParam->uValue = (uint64_t)(int32_t)disReadDWord(pDis, offInstr);
    12131213        pParam->fUse  |= DISUSE_IMMEDIATE64;
    1214         pParam->arch.x86.cb     = sizeof(uint64_t);
     1214        pParam->x86.cb     = sizeof(uint64_t);
    12151215    }
    12161216    else
     
    12181218        pParam->uValue = disReadDWord(pDis, offInstr);
    12191219        pParam->fUse  |= DISUSE_IMMEDIATE32;
    1220         pParam->arch.x86.cb     = sizeof(uint32_t);
     1220        pParam->x86.cb     = sizeof(uint32_t);
    12211221    }
    12221222    return offInstr + 4;
     
    12281228    RT_NOREF_PV(offInstr); RT_NOREF_PV(pOp); RT_NOREF_PV(pParam);
    12291229    /* Word for 16-bit operand-size or doubleword for 32 or 64-bit operand-size. */
    1230     if (pDis->arch.x86.uOpMode == DISCPUMODE_16BIT)
     1230    if (pDis->x86.uOpMode == DISCPUMODE_16BIT)
    12311231        return offInstr + 2;
    12321232    return offInstr + 4;
     
    12411241    pParam->uValue = disReadByte(pDis, offInstr);
    12421242    pParam->fUse  |= DISUSE_IMMEDIATE8_REL;
    1243     pParam->arch.x86.cb     = sizeof(uint8_t);
     1243    pParam->x86.cb     = sizeof(uint8_t);
    12441244    return offInstr + 1;
    12451245}
     
    12581258{
    12591259    RT_NOREF_PV(pOp);
    1260     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1260    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    12611261    {
    12621262        pParam->uValue = disReadDWord(pDis, offInstr);
    12631263        pParam->fUse  |= DISUSE_IMMEDIATE32_REL;
    1264         pParam->arch.x86.cb     = sizeof(int32_t);
     1264        pParam->x86.cb     = sizeof(int32_t);
    12651265        return offInstr + 4;
    12661266    }
    12671267
    1268     if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1268    if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    12691269    {
    12701270        /* 32 bits relative immediate sign extended to 64 bits. */
    12711271        pParam->uValue = (uint64_t)(int32_t)disReadDWord(pDis, offInstr);
    12721272        pParam->fUse  |= DISUSE_IMMEDIATE64_REL;
    1273         pParam->arch.x86.cb     = sizeof(int64_t);
     1273        pParam->x86.cb     = sizeof(int64_t);
    12741274        return offInstr + 4;
    12751275    }
     
    12771277    pParam->uValue = disReadWord(pDis, offInstr);
    12781278    pParam->fUse  |= DISUSE_IMMEDIATE16_REL;
    1279     pParam->arch.x86.cb     = sizeof(int16_t);
     1279    pParam->x86.cb     = sizeof(int16_t);
    12801280    return offInstr + 2;
    12811281}
     
    12861286{
    12871287    RT_NOREF_PV(offInstr); RT_NOREF_PV(pOp); RT_NOREF_PV(pParam);
    1288     if (pDis->arch.x86.uOpMode == DISCPUMODE_16BIT)
     1288    if (pDis->x86.uOpMode == DISCPUMODE_16BIT)
    12891289        return offInstr + 2;
    12901290    /* Both 32 & 64 bits mode use 32 bits relative immediates. */
     
    12961296{
    12971297    RT_NOREF_PV(pOp);
    1298     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1299     {
    1300         if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p)
     1298    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1299    {
     1300        if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p)
    13011301        {
    13021302            /* far 16:32 pointer */
     
    13041304            *((uint32_t*)&pParam->uValue+1) = disReadWord(pDis, offInstr+sizeof(uint32_t));
    13051305            pParam->fUse   |= DISUSE_IMMEDIATE_ADDR_16_32;
    1306             pParam->arch.x86.cb     = sizeof(uint16_t) + sizeof(uint32_t);
     1306            pParam->x86.cb     = sizeof(uint16_t) + sizeof(uint32_t);
    13071307            return offInstr + 4 + 2;
    13081308        }
     
    13141314         * so we treat it like displacement.
    13151315         */
    1316         pParam->arch.x86.uDisp.u32 = disReadDWord(pDis, offInstr);
     1316        pParam->x86.uDisp.u32 = disReadDWord(pDis, offInstr);
    13171317        pParam->fUse  |= DISUSE_DISPLACEMENT32;
    1318         pParam->arch.x86.cb     = sizeof(uint32_t);
     1318        pParam->x86.cb     = sizeof(uint32_t);
    13191319        return offInstr + 4;
    13201320    }
    13211321
    1322     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
     1322    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
    13231323    {
    13241324        /*
     
    13281328         * so we treat it like displacement.
    13291329         */
    1330         Assert(OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_p);
    1331         pParam->arch.x86.uDisp.u64 = disReadQWord(pDis, offInstr);
     1330        Assert(OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_p);
     1331        pParam->x86.uDisp.u64 = disReadQWord(pDis, offInstr);
    13321332        pParam->fUse  |= DISUSE_DISPLACEMENT64;
    1333         pParam->arch.x86.cb     = sizeof(uint64_t);
     1333        pParam->x86.cb     = sizeof(uint64_t);
    13341334        return offInstr + 8;
    13351335    }
    1336     if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p)
     1336    if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p)
    13371337    {
    13381338        /* far 16:16 pointer */
    13391339        pParam->uValue = disReadDWord(pDis, offInstr);
    13401340        pParam->fUse  |= DISUSE_IMMEDIATE_ADDR_16_16;
    1341         pParam->arch.x86.cb     = 2*sizeof(uint16_t);
     1341        pParam->x86.cb     = 2*sizeof(uint16_t);
    13421342        return offInstr + 4;
    13431343    }
     
    13491349     * so we treat it like displacement.
    13501350     */
    1351     pParam->arch.x86.uDisp.i16 = disReadWord(pDis, offInstr);
     1351    pParam->x86.uDisp.i16 = disReadWord(pDis, offInstr);
    13521352    pParam->fUse  |= DISUSE_DISPLACEMENT16;
    1353     pParam->arch.x86.cb     = sizeof(uint16_t);
     1353    pParam->x86.cb     = sizeof(uint16_t);
    13541354    return offInstr + 2;
    13551355}
     
    13591359{
    13601360    RT_NOREF_PV(offInstr); RT_NOREF_PV(pOp);
    1361     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1362     {
    1363         if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p)
     1361    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1362    {
     1363        if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p)
    13641364            return offInstr + 4 + 2; /* far 16:32 pointer */
    13651365        return offInstr + 4;         /* near 32 bits pointer */
    13661366    }
    1367     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
    1368     {
    1369         Assert(OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_p);
     1367    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
     1368    {
     1369        Assert(OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_p);
    13701370        return offInstr + 8;
    13711371    }
    1372     if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p)
     1372    if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p)
    13731373        return offInstr + 4;        /* far 16:16 pointer */
    13741374    return offInstr + 2;            /* near 16 bits pointer */
     
    13801380    RT_NOREF_PV(pOp);
    13811381    // immediate far pointers - only 16:16 or 16:32; determined by operand, *not* address size!
    1382     Assert(pDis->arch.x86.uOpMode == DISCPUMODE_16BIT || pDis->arch.x86.uOpMode == DISCPUMODE_32BIT);
    1383     Assert(OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p);
    1384     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1382    Assert(pDis->x86.uOpMode == DISCPUMODE_16BIT || pDis->x86.uOpMode == DISCPUMODE_32BIT);
     1383    Assert(OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p);
     1384    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    13851385    {
    13861386        // far 16:32 pointer
     
    13881388        *((uint32_t*)&pParam->uValue+1) = disReadWord(pDis, offInstr+sizeof(uint32_t));
    13891389        pParam->fUse   |= DISUSE_IMMEDIATE_ADDR_16_32;
    1390         pParam->arch.x86.cb     = sizeof(uint16_t) + sizeof(uint32_t);
     1390        pParam->x86.cb     = sizeof(uint16_t) + sizeof(uint32_t);
    13911391        return offInstr + 4 + 2;
    13921392    }
     
    13951395    pParam->uValue = disReadDWord(pDis, offInstr);
    13961396    pParam->fUse  |= DISUSE_IMMEDIATE_ADDR_16_16;
    1397     pParam->arch.x86.cb     = 2*sizeof(uint16_t);
     1397    pParam->x86.cb     = 2*sizeof(uint16_t);
    13981398    return offInstr + 2 + 2;
    13991399}
     
    14041404    RT_NOREF_PV(offInstr); RT_NOREF_PV(pOp);
    14051405    // immediate far pointers - only 16:16 or 16:32
    1406     Assert(pDis->arch.x86.uOpMode == DISCPUMODE_16BIT || pDis->arch.x86.uOpMode == DISCPUMODE_32BIT);
    1407     Assert(OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p); RT_NOREF_PV(pParam);
    1408     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1406    Assert(pDis->x86.uOpMode == DISCPUMODE_16BIT || pDis->x86.uOpMode == DISCPUMODE_32BIT);
     1407    Assert(OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p); RT_NOREF_PV(pParam);
     1408    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    14091409        return offInstr + 4 + 2;    /* far 16:32 pointer */
    14101410    return offInstr + 2 + 2;        /* far 16:16 pointer */
     
    14201420     */
    14211421
    1422     if (pParam->arch.x86.fParam == OP_PARM_NONE)
     1422    if (pParam->x86.fParam == OP_PARM_NONE)
    14231423    {
    14241424        /* No parameter at all. */
     
    14311431    AssertCompile(OP_PARM_REG_GEN8_END < OP_PARM_REG_FP_END);
    14321432
    1433     if (pParam->arch.x86.fParam <= OP_PARM_REG_GEN32_END)
     1433    if (pParam->x86.fParam <= OP_PARM_REG_GEN32_END)
    14341434    {
    14351435        /* 32-bit EAX..EDI registers. */
    1436         if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     1436        if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    14371437        {
    14381438            /* Use 32-bit registers. */
    1439             pParam->arch.x86.Base.idxGenReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_GEN32_START);
     1439            pParam->x86.Base.idxGenReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_GEN32_START);
    14401440            pParam->fUse  |= DISUSE_REG_GEN32;
    1441             pParam->arch.x86.cb     = 4;
    1442         }
    1443         else if (pDis->arch.x86.uOpMode == DISCPUMODE_64BIT)
     1441            pParam->x86.cb     = 4;
     1442        }
     1443        else if (pDis->x86.uOpMode == DISCPUMODE_64BIT)
    14441444        {
    14451445            /* Use 64-bit registers. */
    1446             pParam->arch.x86.Base.idxGenReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_GEN32_START);
     1446            pParam->x86.Base.idxGenReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_GEN32_START);
    14471447            pParam->fUse  |= DISUSE_REG_GEN64;
    1448             pParam->arch.x86.cb     = 8;
     1448            pParam->x86.cb     = 8;
    14491449        }
    14501450        else
    14511451        {
    14521452            /* Use 16-bit registers. */
    1453             pParam->arch.x86.Base.idxGenReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_GEN32_START);
     1453            pParam->x86.Base.idxGenReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_GEN32_START);
    14541454            pParam->fUse  |= DISUSE_REG_GEN16;
    1455             pParam->arch.x86.cb     = 2;
    1456             pParam->arch.x86.fParam = pParam->arch.x86.fParam - OP_PARM_REG_GEN32_START + OP_PARM_REG_GEN16_START;
     1455            pParam->x86.cb     = 2;
     1456            pParam->x86.fParam = pParam->x86.fParam - OP_PARM_REG_GEN32_START + OP_PARM_REG_GEN16_START;
    14571457        }
    14581458
    14591459        if (    (pOp->fOpType & DISOPTYPE_X86_REXB_EXTENDS_OPREG)
    14601460            &&  pParam == &pDis->Param1             /* ugly assumption that it only applies to the first parameter */
    1461             &&  (pDis->arch.x86.fPrefix & DISPREFIX_REX)
    1462             &&  (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B))
     1461            &&  (pDis->x86.fPrefix & DISPREFIX_REX)
     1462            &&  (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B))
    14631463        {
    14641464            Assert(pDis->uCpuMode == DISCPUMODE_64BIT);
    1465             pParam->arch.x86.Base.idxGenReg += 8;
    1466         }
    1467     }
    1468     else if (pParam->arch.x86.fParam <= OP_PARM_REG_SEG_END)
     1465            pParam->x86.Base.idxGenReg += 8;
     1466        }
     1467    }
     1468    else if (pParam->x86.fParam <= OP_PARM_REG_SEG_END)
    14691469    {
    14701470        /* Segment ES..GS registers. */
    1471         pParam->arch.x86.Base.idxSegReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_SEG_START);
     1471        pParam->x86.Base.idxSegReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_SEG_START);
    14721472        pParam->fUse  |= DISUSE_REG_SEG;
    1473         pParam->arch.x86.cb     = 2;
    1474     }
    1475     else if (pParam->arch.x86.fParam <= OP_PARM_REG_GEN16_END)
     1473        pParam->x86.cb     = 2;
     1474    }
     1475    else if (pParam->x86.fParam <= OP_PARM_REG_GEN16_END)
    14761476    {
    14771477        /* 16-bit AX..DI registers. */
    1478         pParam->arch.x86.Base.idxGenReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_GEN16_START);
     1478        pParam->x86.Base.idxGenReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_GEN16_START);
    14791479        pParam->fUse  |= DISUSE_REG_GEN16;
    1480         pParam->arch.x86.cb     = 2;
    1481     }
    1482     else if (pParam->arch.x86.fParam <= OP_PARM_REG_GEN8_END)
     1480        pParam->x86.cb     = 2;
     1481    }
     1482    else if (pParam->x86.fParam <= OP_PARM_REG_GEN8_END)
    14831483    {
    14841484        /* 8-bit AL..DL, AH..DH registers. */
    1485         pParam->arch.x86.Base.idxGenReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_GEN8_START);
     1485        pParam->x86.Base.idxGenReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_GEN8_START);
    14861486        pParam->fUse  |= DISUSE_REG_GEN8;
    1487         pParam->arch.x86.cb     = 1;
     1487        pParam->x86.cb     = 1;
    14881488
    14891489        if (   pDis->uCpuMode == DISCPUMODE_64BIT
    14901490            && (pOp->fOpType & DISOPTYPE_X86_REXB_EXTENDS_OPREG)
    14911491            &&  pParam == &pDis->Param1             /* ugly assumption that it only applies to the first parameter */
    1492             &&  (pDis->arch.x86.fPrefix & DISPREFIX_REX))
    1493         {
    1494             if (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)
    1495                 pParam->arch.x86.Base.idxGenReg += 8;              /* least significant byte of R8-R15 */
    1496             else if (   pParam->arch.x86.Base.idxGenReg >= DISGREG_AH
    1497                      && pParam->arch.x86.Base.idxGenReg <= DISGREG_BH)
    1498                 pParam->arch.x86.Base.idxGenReg += DISGREG_SPL - DISGREG_AH;
    1499         }
    1500     }
    1501     else if (pParam->arch.x86.fParam <= OP_PARM_REG_FP_END)
     1492            &&  (pDis->x86.fPrefix & DISPREFIX_REX))
     1493        {
     1494            if (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_B)
     1495                pParam->x86.Base.idxGenReg += 8;              /* least significant byte of R8-R15 */
     1496            else if (   pParam->x86.Base.idxGenReg >= DISGREG_AH
     1497                     && pParam->x86.Base.idxGenReg <= DISGREG_BH)
     1498                pParam->x86.Base.idxGenReg += DISGREG_SPL - DISGREG_AH;
     1499        }
     1500    }
     1501    else if (pParam->x86.fParam <= OP_PARM_REG_FP_END)
    15021502    {
    15031503        /* FPU registers. */
    1504         pParam->arch.x86.Base.idxFpuReg = (uint8_t)(pParam->arch.x86.fParam - OP_PARM_REG_FP_START);
     1504        pParam->x86.Base.idxFpuReg = (uint8_t)(pParam->x86.fParam - OP_PARM_REG_FP_START);
    15051505        pParam->fUse  |= DISUSE_REG_FP;
    1506         pParam->arch.x86.cb     = 10;
    1507     }
    1508     Assert(!(pParam->arch.x86.fParam >= OP_PARM_REG_GEN64_START && pParam->arch.x86.fParam <= OP_PARM_REG_GEN64_END));
     1506        pParam->x86.cb     = 10;
     1507    }
     1508    Assert(!(pParam->x86.fParam >= OP_PARM_REG_GEN64_START && pParam->x86.fParam <= OP_PARM_REG_GEN64_END));
    15091509
    15101510    /* else - not supported for now registers. */
     
    15191519
    15201520    pParam->fUse |= DISUSE_POINTER_DS_BASED;
    1521     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1522     {
    1523         pParam->arch.x86.Base.idxGenReg = DISGREG_ESI;
     1521    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1522    {
     1523        pParam->x86.Base.idxGenReg = DISGREG_ESI;
    15241524        pParam->fUse |= DISUSE_REG_GEN32;
    15251525    }
    15261526    else
    1527     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
    1528     {
    1529         pParam->arch.x86.Base.idxGenReg = DISGREG_RSI;
     1527    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
     1528    {
     1529        pParam->x86.Base.idxGenReg = DISGREG_RSI;
    15301530        pParam->fUse |= DISUSE_REG_GEN64;
    15311531    }
    15321532    else
    15331533    {
    1534         pParam->arch.x86.Base.idxGenReg = DISGREG_SI;
     1534        pParam->x86.Base.idxGenReg = DISGREG_SI;
    15351535        pParam->fUse |= DISUSE_REG_GEN16;
    15361536    }
     
    15441544
    15451545    pParam->fUse |= DISUSE_POINTER_DS_BASED;
    1546     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1547     {
    1548         pParam->arch.x86.Base.idxGenReg = DISGREG_ESI;
     1546    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1547    {
     1548        pParam->x86.Base.idxGenReg = DISGREG_ESI;
    15491549        pParam->fUse |= DISUSE_REG_GEN32;
    15501550    }
    15511551    else
    1552     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
    1553     {
    1554         pParam->arch.x86.Base.idxGenReg = DISGREG_RSI;
     1552    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
     1553    {
     1554        pParam->x86.Base.idxGenReg = DISGREG_RSI;
    15551555        pParam->fUse |= DISUSE_REG_GEN64;
    15561556    }
    15571557    else
    15581558    {
    1559         pParam->arch.x86.Base.idxGenReg = DISGREG_SI;
     1559        pParam->x86.Base.idxGenReg = DISGREG_SI;
    15601560        pParam->fUse |= DISUSE_REG_GEN16;
    15611561    }
     
    15691569
    15701570    pParam->fUse |= DISUSE_POINTER_ES_BASED;
    1571     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1572     {
    1573         pParam->arch.x86.Base.idxGenReg = DISGREG_EDI;
     1571    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1572    {
     1573        pParam->x86.Base.idxGenReg = DISGREG_EDI;
    15741574        pParam->fUse |= DISUSE_REG_GEN32;
    15751575    }
    15761576    else
    1577     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
    1578     {
    1579         pParam->arch.x86.Base.idxGenReg = DISGREG_RDI;
     1577    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
     1578    {
     1579        pParam->x86.Base.idxGenReg = DISGREG_RDI;
    15801580        pParam->fUse |= DISUSE_REG_GEN64;
    15811581    }
    15821582    else
    15831583    {
    1584         pParam->arch.x86.Base.idxGenReg = DISGREG_DI;
     1584        pParam->x86.Base.idxGenReg = DISGREG_DI;
    15851585        pParam->fUse |= DISUSE_REG_GEN16;
    15861586    }
     
    15941594
    15951595    pParam->fUse |= DISUSE_POINTER_ES_BASED;
    1596     if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
    1597     {
    1598         pParam->arch.x86.Base.idxGenReg = DISGREG_EDI;
     1596    if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
     1597    {
     1598        pParam->x86.Base.idxGenReg = DISGREG_EDI;
    15991599        pParam->fUse |= DISUSE_REG_GEN32;
    16001600    }
    16011601    else
    1602     if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
    1603     {
    1604         pParam->arch.x86.Base.idxGenReg = DISGREG_RDI;
     1602    if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
     1603    {
     1604        pParam->x86.Base.idxGenReg = DISGREG_RDI;
    16051605        pParam->fUse |= DISUSE_REG_GEN64;
    16061606    }
    16071607    else
    16081608    {
    1609         pParam->arch.x86.Base.idxGenReg = DISGREG_DI;
     1609        pParam->x86.Base.idxGenReg = DISGREG_DI;
    16101610        pParam->fUse |= DISUSE_REG_GEN16;
    16111611    }
     
    16271627    RT_NOREF_PV(pOp);
    16281628
    1629     unsigned type = OP_PARM_VTYPE(pParam->arch.x86.fParam);
     1629    unsigned type = OP_PARM_VTYPE(pParam->x86.fParam);
    16301630    switch (type)
    16311631    {
    16321632        case OP_PARM_H: //XMM or YMM register
    1633             if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg))
     1633            if (VEXREG_IS256B(pDis->x86.bVexDestReg))
    16341634            {
    16351635                pParam->fUse |= DISUSE_REG_YMM;
    1636                 pParam->arch.x86.Base.idxYmmReg = (pDis->arch.x86.bVexDestReg >> 1) ^ 0xf;
     1636                pParam->x86.Base.idxYmmReg = (pDis->x86.bVexDestReg >> 1) ^ 0xf;
    16371637            }
    16381638            else
    16391639            {
    16401640                pParam->fUse |= DISUSE_REG_XMM;
    1641                 pParam->arch.x86.Base.idxXmmReg = (pDis->arch.x86.bVexDestReg >> 1) ^ 0xf;
     1641                pParam->x86.Base.idxXmmReg = (pDis->x86.bVexDestReg >> 1) ^ 0xf;
    16421642            }
    16431643            break;
    16441644
    16451645        case OP_PARM_B: // Always OP_PARM_By. Change if it is not so.
    1646             if (pDis->arch.x86.bVexWFlag && pDis->uCpuMode == DISCPUMODE_64BIT)
     1646            if (pDis->x86.bVexWFlag && pDis->uCpuMode == DISCPUMODE_64BIT)
    16471647                pParam->fUse |= DISUSE_REG_GEN64;
    16481648            else
    16491649                pParam->fUse |= DISUSE_REG_GEN32;
    16501650            /// @todo Check if the register number is correct
    1651             pParam->arch.x86.Base.idxGenReg = (pDis->arch.x86.bVexDestReg >> 1) ^ 0xf;
     1651            pParam->x86.Base.idxGenReg = (pDis->x86.bVexDestReg >> 1) ^ 0xf;
    16521652            break;
    16531653    }
     
    16621662
    16631663    /* 2nd byte */
    1664     pDis->arch.x86.bOpCode = disReadByte(pDis, offInstr);
     1664    pDis->x86.bOpCode = disReadByte(pDis, offInstr);
    16651665    offInstr++;
    16661666
    16671667    /* default to the non-prefixed table. */
    1668     PCDISOPCODE pOpcode = &g_aTwoByteMapX86[pDis->arch.x86.bOpCode];
     1668    PCDISOPCODE pOpcode = &g_aTwoByteMapX86[pDis->x86.bOpCode];
    16691669
    16701670    /* Handle opcode table extensions that rely on the opsize, repe or repne prefix byte.  */
    16711671    /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */
    1672     if (pDis->arch.x86.bLastPrefix)
    1673     {
    1674         switch (pDis->arch.x86.bLastPrefix)
     1672    if (pDis->x86.bLastPrefix)
     1673    {
     1674        switch (pDis->x86.bLastPrefix)
    16751675        {
    16761676        case OP_OPSIZE: /* 0x66 */
    1677             if (g_aTwoByteMapX86_PF66[pDis->arch.x86.bOpCode].uOpcode != OP_INVALID)
     1677            if (g_aTwoByteMapX86_PF66[pDis->x86.bOpCode].uOpcode != OP_INVALID)
    16781678            {
    16791679                /* Table entry is valid, so use the extension table. */
    1680                 pOpcode = &g_aTwoByteMapX86_PF66[pDis->arch.x86.bOpCode];
     1680                pOpcode = &g_aTwoByteMapX86_PF66[pDis->x86.bOpCode];
    16811681
    16821682                /* Cancel prefix changes. */
    1683                 pDis->arch.x86.fPrefix &= ~DISPREFIX_OPSIZE;
     1683                pDis->x86.fPrefix &= ~DISPREFIX_OPSIZE;
    16841684
    16851685                if (pDis->uCpuMode == DISCPUMODE_64BIT)
    16861686                {
    1687                     pDis->arch.x86.uOpMode = (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
     1687                    pDis->x86.uOpMode = (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
    16881688                }
    16891689                else
    1690                     pDis->arch.x86.uOpMode  = pDis->uCpuMode;
     1690                    pDis->x86.uOpMode  = pDis->uCpuMode;
    16911691            }
    16921692            break;
    16931693
    16941694        case OP_REPNE:   /* 0xF2 */
    1695             if (g_aTwoByteMapX86_PFF2[pDis->arch.x86.bOpCode].uOpcode != OP_INVALID)
     1695            if (g_aTwoByteMapX86_PFF2[pDis->x86.bOpCode].uOpcode != OP_INVALID)
    16961696            {
    16971697                /* Table entry is valid, so use the extension table. */
    1698                 pOpcode = &g_aTwoByteMapX86_PFF2[pDis->arch.x86.bOpCode];
     1698                pOpcode = &g_aTwoByteMapX86_PFF2[pDis->x86.bOpCode];
    16991699
    17001700                /* Cancel prefix changes. */
    1701                 pDis->arch.x86.fPrefix &= ~DISPREFIX_REPNE;
     1701                pDis->x86.fPrefix &= ~DISPREFIX_REPNE;
    17021702            }
    17031703            break;
    17041704
    17051705        case OP_REPE:  /* 0xF3 */
    1706             if (g_aTwoByteMapX86_PFF3[pDis->arch.x86.bOpCode].uOpcode != OP_INVALID)
     1706            if (g_aTwoByteMapX86_PFF3[pDis->x86.bOpCode].uOpcode != OP_INVALID)
    17071707            {
    17081708                /* Table entry is valid, so use the extension table. */
    1709                 pOpcode = &g_aTwoByteMapX86_PFF3[pDis->arch.x86.bOpCode];
     1709                pOpcode = &g_aTwoByteMapX86_PFF3[pDis->x86.bOpCode];
    17101710
    17111711                /* Cancel prefix changes. */
    1712                 pDis->arch.x86.fPrefix &= ~DISPREFIX_REP;
     1712                pDis->x86.fPrefix &= ~DISPREFIX_REP;
    17131713            }
    17141714            break;
     
    17251725
    17261726    /* 3rd byte */
    1727     pDis->arch.x86.bOpCode = disReadByte(pDis, offInstr);
     1727    pDis->x86.bOpCode = disReadByte(pDis, offInstr);
    17281728    offInstr++;
    17291729
    17301730    /* default to the non-prefixed table. */
    17311731    PCDISOPCODE pOpcode;
    1732     if (g_apThreeByteMapX86_0F38[pDis->arch.x86.bOpCode >> 4])
    1733     {
    1734         pOpcode = g_apThreeByteMapX86_0F38[pDis->arch.x86.bOpCode >> 4];
    1735         pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1732    if (g_apThreeByteMapX86_0F38[pDis->x86.bOpCode >> 4])
     1733    {
     1734        pOpcode = g_apThreeByteMapX86_0F38[pDis->x86.bOpCode >> 4];
     1735        pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    17361736    }
    17371737    else
     
    17401740    /* Handle opcode table extensions that rely on the address, repne prefix byte.  */
    17411741    /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */
    1742     switch (pDis->arch.x86.bLastPrefix)
     1742    switch (pDis->x86.bLastPrefix)
    17431743    {
    17441744    case OP_OPSIZE: /* 0x66 */
    1745         if (g_apThreeByteMapX86_660F38[pDis->arch.x86.bOpCode >> 4])
    1746         {
    1747             pOpcode = g_apThreeByteMapX86_660F38[pDis->arch.x86.bOpCode >> 4];
    1748             pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1745        if (g_apThreeByteMapX86_660F38[pDis->x86.bOpCode >> 4])
     1746        {
     1747            pOpcode = g_apThreeByteMapX86_660F38[pDis->x86.bOpCode >> 4];
     1748            pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    17491749
    17501750            if (pOpcode->uOpcode != OP_INVALID)
     
    17531753
    17541754                /* Cancel prefix changes. */
    1755                 pDis->arch.x86.fPrefix &= ~DISPREFIX_OPSIZE;
     1755                pDis->x86.fPrefix &= ~DISPREFIX_OPSIZE;
    17561756                if (pDis->uCpuMode == DISCPUMODE_64BIT)
    17571757                {
    1758                     pDis->arch.x86.uOpMode = (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
     1758                    pDis->x86.uOpMode = (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
    17591759                }
    17601760                else
    1761                     pDis->arch.x86.uOpMode  = pDis->uCpuMode;
     1761                    pDis->x86.uOpMode  = pDis->uCpuMode;
    17621762
    17631763            }
     
    17661766
    17671767    case OP_REPNE:   /* 0xF2 */
    1768         if ((pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE) && g_apThreeByteMapX86_66F20F38[pDis->arch.x86.bOpCode >> 4])
     1768        if ((pDis->x86.fPrefix & DISPREFIX_OPSIZE) && g_apThreeByteMapX86_66F20F38[pDis->x86.bOpCode >> 4])
    17691769        {
    17701770        /* 0x66F2 */
    1771             pOpcode = g_apThreeByteMapX86_66F20F38[pDis->arch.x86.bOpCode >> 4];
    1772             pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1771            pOpcode = g_apThreeByteMapX86_66F20F38[pDis->x86.bOpCode >> 4];
     1772            pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    17731773
    17741774            if (pOpcode->uOpcode != OP_INVALID)
     
    17771777
    17781778                /* Cancel prefix changes. */
    1779                 pDis->arch.x86.fPrefix &= ~DISPREFIX_REPNE;
    1780                 pDis->arch.x86.fPrefix &= ~DISPREFIX_OPSIZE;
     1779                pDis->x86.fPrefix &= ~DISPREFIX_REPNE;
     1780                pDis->x86.fPrefix &= ~DISPREFIX_OPSIZE;
    17811781                if (pDis->uCpuMode == DISCPUMODE_64BIT)
    17821782                {
    1783                     pDis->arch.x86.uOpMode = (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
     1783                    pDis->x86.uOpMode = (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
    17841784                }
    17851785                else
    1786                     pDis->arch.x86.uOpMode  = pDis->uCpuMode;
     1786                    pDis->x86.uOpMode  = pDis->uCpuMode;
    17871787            }
    17881788        }
    1789         else if (g_apThreeByteMapX86_F20F38[pDis->arch.x86.bOpCode >> 4])
    1790         {
    1791             pOpcode = g_apThreeByteMapX86_F20F38[pDis->arch.x86.bOpCode >> 4];
    1792             pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1789        else if (g_apThreeByteMapX86_F20F38[pDis->x86.bOpCode >> 4])
     1790        {
     1791            pOpcode = g_apThreeByteMapX86_F20F38[pDis->x86.bOpCode >> 4];
     1792            pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    17931793
    17941794            if (pOpcode->uOpcode != OP_INVALID)
     
    17971797
    17981798                /* Cancel prefix changes. */
    1799                 pDis->arch.x86.fPrefix &= ~DISPREFIX_REPNE;
     1799                pDis->x86.fPrefix &= ~DISPREFIX_REPNE;
    18001800            }
    18011801        }
     
    18031803
    18041804    case OP_REPE:    /* 0xF3 */
    1805         if (g_apThreeByteMapX86_F30F38[pDis->arch.x86.bOpCode >> 4])
    1806         {
    1807             pOpcode = g_apThreeByteMapX86_F30F38[pDis->arch.x86.bOpCode >> 4];
    1808             pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1805        if (g_apThreeByteMapX86_F30F38[pDis->x86.bOpCode >> 4])
     1806        {
     1807            pOpcode = g_apThreeByteMapX86_F30F38[pDis->x86.bOpCode >> 4];
     1808            pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    18091809
    18101810            if (pOpcode->uOpcode != OP_INVALID)
     
    18131813
    18141814                /* Cancel prefix changes. */
    1815                 pDis->arch.x86.fPrefix &= ~DISPREFIX_REP;
     1815                pDis->x86.fPrefix &= ~DISPREFIX_REP;
    18161816            }
    18171817        }
     
    18271827
    18281828    /* 3rd byte */
    1829     pDis->arch.x86.bOpCode = disReadByte(pDis, offInstr);
     1829    pDis->x86.bOpCode = disReadByte(pDis, offInstr);
    18301830    offInstr++;
    18311831
    18321832    /* default to the non-prefixed table. */
    18331833    PCDISOPCODE pOpcode;
    1834     if (g_apThreeByteMapX86_0F3A[pDis->arch.x86.bOpCode >> 4])
    1835     {
    1836         pOpcode = g_apThreeByteMapX86_0F3A[pDis->arch.x86.bOpCode >> 4];
    1837         pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1834    if (g_apThreeByteMapX86_0F3A[pDis->x86.bOpCode >> 4])
     1835    {
     1836        pOpcode = g_apThreeByteMapX86_0F3A[pDis->x86.bOpCode >> 4];
     1837        pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    18381838    }
    18391839    else
     
    18411841
    18421842    /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */
    1843     if (pDis->arch.x86.bLastPrefix == OP_OPSIZE && g_apThreeByteMapX86_660F3A[pDis->arch.x86.bOpCode >> 4])
    1844     {
    1845         pOpcode = g_apThreeByteMapX86_660F3A[pDis->arch.x86.bOpCode >> 4];
    1846         pOpcode = &pOpcode[pDis->arch.x86.bOpCode & 0xf];
     1843    if (pDis->x86.bLastPrefix == OP_OPSIZE && g_apThreeByteMapX86_660F3A[pDis->x86.bOpCode >> 4])
     1844    {
     1845        pOpcode = g_apThreeByteMapX86_660F3A[pDis->x86.bOpCode >> 4];
     1846        pOpcode = &pOpcode[pDis->x86.bOpCode & 0xf];
    18471847
    18481848        if (pOpcode->uOpcode != OP_INVALID)
     
    18511851
    18521852            /* Cancel prefix changes. */
    1853             pDis->arch.x86.fPrefix &= ~DISPREFIX_OPSIZE;
     1853            pDis->x86.fPrefix &= ~DISPREFIX_OPSIZE;
    18541854            if (pDis->uCpuMode == DISCPUMODE_64BIT)
    18551855            {
    1856                 pDis->arch.x86.uOpMode = (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
     1856                pDis->x86.uOpMode = (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_W ? DISCPUMODE_64BIT : DISCPUMODE_32BIT);
    18571857            }
    18581858            else
    1859                 pDis->arch.x86.uOpMode  = pDis->uCpuMode;
     1859                pDis->x86.uOpMode  = pDis->uCpuMode;
    18601860
    18611861        }
     
    18701870    RT_NOREF_PV(pParam);
    18711871
    1872     if (pDis->arch.x86.fPrefix & DISPREFIX_REP)
     1872    if (pDis->x86.fPrefix & DISPREFIX_REP)
    18731873    {
    18741874        pOp = &g_aMapX86_NopPause[1]; /* PAUSE */
    1875         pDis->arch.x86.fPrefix &= ~DISPREFIX_REP;
     1875        pDis->x86.fPrefix &= ~DISPREFIX_REP;
    18761876    }
    18771877    else
     
    18881888    uint8_t  modrm = disReadByte(pDis, offInstr);
    18891889    uint8_t  reg   = MODRM_REG(modrm);
    1890     unsigned idx   = (pDis->arch.x86.bOpCode - 0x80) * 8;
     1890    unsigned idx   = (pDis->x86.bOpCode - 0x80) * 8;
    18911891
    18921892    pOp = &g_aMapX86_Group1[idx+reg];
     
    19011901
    19021902    unsigned idx;
    1903     switch (pDis->arch.x86.bOpCode)
     1903    switch (pDis->x86.bOpCode)
    19041904    {
    19051905    case 0xC0:
    19061906    case 0xC1:
    1907         idx = (pDis->arch.x86.bOpCode - 0xC0)*8;
     1907        idx = (pDis->x86.bOpCode - 0xC0)*8;
    19081908        break;
    19091909
     
    19121912    case 0xD2:
    19131913    case 0xD3:
    1914         idx = (pDis->arch.x86.bOpCode - 0xD0 + 2)*8;
     1914        idx = (pDis->x86.bOpCode - 0xD0 + 2)*8;
    19151915        break;
    19161916
    19171917    default:
    1918         Log(("ParseShiftGrp2: bOpCode=%#x\n", pDis->arch.x86.bOpCode));
     1918        Log(("ParseShiftGrp2: bOpCode=%#x\n", pDis->x86.bOpCode));
    19191919        pDis->rc = VERR_DIS_INVALID_OPCODE;
    19201920        return offInstr;
     
    19321932static size_t ParseGrp3(size_t offInstr, PCDISOPCODE pOp, PDISSTATE pDis, PDISOPPARAM pParam)
    19331933{
    1934     unsigned idx = (pDis->arch.x86.bOpCode - 0xF6) * 8;
     1934    unsigned idx = (pDis->x86.bOpCode - 0xF6) * 8;
    19351935    RT_NOREF_PV(pParam);
    19361936
     
    19791979
    19801980    uint8_t ModRM = disReadByte(pDis, offInstr);
    1981     pDis->arch.x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
    1982     pDis->arch.x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
    1983     pDis->arch.x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
     1981    pDis->x86.ModRM.Bits.Rm  = MODRM_RM(ModRM);
     1982    pDis->x86.ModRM.Bits.Mod = MODRM_MOD(ModRM);
     1983    pDis->x86.ModRM.Bits.Reg = MODRM_REG(ModRM);
    19841984
    19851985    size_t offRet = QueryModRM(offInstr + 1, pOp, pDis, pParam);
     
    20842084    uint8_t reg   = MODRM_REG(modrm);
    20852085
    2086     if (pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     2086    if (pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    20872087        reg += 8;   /* 2nd table */
    20882088
     
    20992099    uint8_t modrm = disReadByte(pDis, offInstr);
    21002100    uint8_t reg   = MODRM_REG(modrm);
    2101     if (pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     2101    if (pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    21022102        reg += 8;   /* 2nd table */
    21032103
     
    21142114    uint8_t modrm = disReadByte(pDis, offInstr);
    21152115    uint8_t reg   = MODRM_REG(modrm);
    2116     if (pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     2116    if (pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    21172117        reg += 8;   /* 2nd table */
    21182118
     
    21602160
    21612161    uint8_t const bRm = disReadByte(pDis, offInstr);
    2162     pOp = &g_aMapX86_Group17[(MODRM_REG(bRm) << 1) | (pDis->arch.x86.bVexDestReg & 1)];
     2162    pOp = &g_aMapX86_Group17[(MODRM_REG(bRm) << 1) | (pDis->x86.bVexDestReg & 1)];
    21632163
    21642164    return disParseInstruction(offInstr, pOp, pDis);
     
    21732173
    21742174    uint8_t byte = disReadByte(pDis, offInstr++);
    2175     pDis->arch.x86.bOpCode = disReadByte(pDis, offInstr++);
    2176 
    2177     pDis->arch.x86.bVexDestReg = VEX_2B2INT(byte);
     2175    pDis->x86.bOpCode = disReadByte(pDis, offInstr++);
     2176
     2177    pDis->x86.bVexDestReg = VEX_2B2INT(byte);
    21782178
    21792179    // VEX.R (equivalent to REX.R)
     
    21812181    {
    21822182        /* REX prefix byte */
    2183         pDis->arch.x86.fPrefix   |= DISPREFIX_REX;
    2184         pDis->arch.x86.fRexPrefix = DISPREFIX_REX_FLAGS_R;
     2183        pDis->x86.fPrefix   |= DISPREFIX_REX;
     2184        pDis->x86.fRexPrefix = DISPREFIX_REX_FLAGS_R;
    21852185    }
    21862186
    21872187    PCDISOPMAPDESC const pRange    = g_aapVexOpcodesMapRanges[byte & 3][1];
    2188     unsigned  const      idxOpcode = pDis->arch.x86.bOpCode - pRange->idxFirst;
     2188    unsigned  const      idxOpcode = pDis->x86.bOpCode - pRange->idxFirst;
    21892189    PCDISOPCODE          pOpCode;
    21902190    if (idxOpcode < pRange->cOpcodes)
     
    22032203    uint8_t byte1 = disReadByte(pDis, offInstr++);
    22042204    uint8_t byte2 = disReadByte(pDis, offInstr++);
    2205     pDis->arch.x86.bOpCode = disReadByte(pDis, offInstr++);
    2206     pDis->arch.x86.bVexDestReg = VEX_2B2INT(byte2); /** @todo r=bird: why on earth ~vvvv + L; this is obfuscation non-sense. Either split the shit up or just store byte2 raw here! */
     2205    pDis->x86.bOpCode = disReadByte(pDis, offInstr++);
     2206    pDis->x86.bVexDestReg = VEX_2B2INT(byte2); /** @todo r=bird: why on earth ~vvvv + L; this is obfuscation non-sense. Either split the shit up or just store byte2 raw here! */
    22072207
    22082208    // VEX.W
    2209     pDis->arch.x86.bVexWFlag = !!(byte2 & 0x80); /** @todo r=bird: why a whole byte for this one flag? arch.x86.bVexWFlag and bVexDestReg makes little sense. */
     2209    pDis->x86.bVexWFlag = !!(byte2 & 0x80); /** @todo r=bird: why a whole byte for this one flag? x86.bVexWFlag and bVexDestReg makes little sense. */
    22102210
    22112211    /* Hack alert! Assume VEX.W rules over any 66h prefix and that no VEX
    2212        encoded instructions ever uses the regular arch.x86.uOpMode w/o VEX.W. */
    2213     pDis->arch.x86.uOpMode = (byte2 & 0x80) && pDis->uCpuMode == DISCPUMODE_64BIT ? DISCPUMODE_64BIT : DISCPUMODE_32BIT;
     2212       encoded instructions ever uses the regular x86.uOpMode w/o VEX.W. */
     2213    pDis->x86.uOpMode = (byte2 & 0x80) && pDis->uCpuMode == DISCPUMODE_64BIT ? DISCPUMODE_64BIT : DISCPUMODE_32BIT;
    22142214
    22152215    // VEX.~R~X~B => REX.RXB
    22162216    if (pDis->uCpuMode == DISCPUMODE_64BIT)
    22172217    {
    2218         pDis->arch.x86.fRexPrefix |= (byte1 >> 5) ^ 7;
    2219         if (pDis->arch.x86.fRexPrefix)
    2220             pDis->arch.x86.fPrefix |= DISPREFIX_REX;
     2218        pDis->x86.fRexPrefix |= (byte1 >> 5) ^ 7;
     2219        if (pDis->x86.fRexPrefix)
     2220            pDis->x86.fPrefix |= DISPREFIX_REX;
    22212221    }
    22222222
     
    22262226    {
    22272227        PCDISOPMAPDESC const pRange    = g_aapVexOpcodesMapRanges[byte2 & 3][idxVexMap];
    2228         unsigned  const      idxOpcode = pDis->arch.x86.bOpCode - pRange->idxFirst;
     2228        unsigned  const      idxOpcode = pDis->x86.bOpCode - pRange->idxFirst;
    22292229        if (idxOpcode < pRange->cOpcodes)
    22302230            pOpCode = &pRange->papOpcodes[idxOpcode];
     
    22672267static void disValidateLockSequence(PDISSTATE pDis)
    22682268{
    2269     Assert(pDis->arch.x86.fPrefix & DISPREFIX_LOCK);
     2269    Assert(pDis->x86.fPrefix & DISPREFIX_LOCK);
    22702270
    22712271    /*
     
    22842284        case OP_CMPXCHG:
    22852285        case OP_XADD:
    2286             if (pDis->arch.x86.ModRM.Bits.Mod == 3)
     2286            if (pDis->x86.ModRM.Bits.Mod == 3)
    22872287                break;
    22882288            return;
     
    23362336    for (;;)
    23372337    {
    2338         uint8_t  const     bCode     = disReadByte(pDis, offInstr++);
     2338        uint8_t  const        bCode     = disReadByte(pDis, offInstr++);
    23392339        enum OPCODESX86 const enmOpcode = (enum OPCODESX86)paOneByteMap[bCode].uOpcode;
    23402340
     
    23462346            {
    23472347                /* Last prefix byte (for SSE2 extension tables); don't include the REX prefix */
    2348                 pDis->arch.x86.bLastPrefix = (uint8_t)enmOpcode;
    2349                 pDis->arch.x86.fPrefix    &= ~DISPREFIX_REX;
     2348                pDis->x86.bLastPrefix = (uint8_t)enmOpcode;
     2349                pDis->x86.fPrefix    &= ~DISPREFIX_REX;
    23502350            }
    23512351
     
    23592359            // segment override prefix byte
    23602360            case OP_SEG:
    2361                 pDis->arch.x86.idxSegPrefix = (uint8_t)(paOneByteMap[bCode].fParam1 - OP_PARM_REG_SEG_START);
     2361                pDis->x86.idxSegPrefix = (uint8_t)(paOneByteMap[bCode].fParam1 - OP_PARM_REG_SEG_START);
    23622362#if 0  /* Try be accurate in our reporting, shouldn't break anything... :-) */
    23632363                /* Segment prefixes for CS, DS, ES and SS are ignored in long mode. */
    23642364                if (   pDis->uCpuMode != DISCPUMODE_64BIT
    23652365                    || pDis->idxSegPrefix >= DISSELREG_FS)
    2366                     pDis->arch.x86.fPrefix   |= DISPREFIX_SEG;
     2366                    pDis->x86.fPrefix   |= DISPREFIX_SEG;
    23672367#else
    2368                 pDis->arch.x86.fPrefix |= DISPREFIX_SEG;
     2368                pDis->x86.fPrefix |= DISPREFIX_SEG;
    23692369#endif
    23702370                continue;   //fetch the next byte
     
    23722372            // lock prefix byte
    23732373            case OP_LOCK:
    2374                 pDis->arch.x86.fPrefix |= DISPREFIX_LOCK;
     2374                pDis->x86.fPrefix |= DISPREFIX_LOCK;
    23752375                continue;   //fetch the next byte
    23762376
    23772377            // address size override prefix byte
    23782378            case OP_ADDRSIZE:
    2379                 pDis->arch.x86.fPrefix |= DISPREFIX_ADDRSIZE;
     2379                pDis->x86.fPrefix |= DISPREFIX_ADDRSIZE;
    23802380                if (pDis->uCpuMode == DISCPUMODE_16BIT)
    2381                     pDis->arch.x86.uAddrMode = DISCPUMODE_32BIT;
     2381                    pDis->x86.uAddrMode = DISCPUMODE_32BIT;
    23822382                else
    23832383                if (pDis->uCpuMode == DISCPUMODE_32BIT)
    2384                     pDis->arch.x86.uAddrMode = DISCPUMODE_16BIT;
     2384                    pDis->x86.uAddrMode = DISCPUMODE_16BIT;
    23852385                else
    2386                     pDis->arch.x86.uAddrMode = DISCPUMODE_32BIT;     /* 64 bits */
     2386                    pDis->x86.uAddrMode = DISCPUMODE_32BIT;     /* 64 bits */
    23872387                continue;   //fetch the next byte
    23882388
    23892389            // operand size override prefix byte
    23902390            case OP_OPSIZE:
    2391                 pDis->arch.x86.fPrefix |= DISPREFIX_OPSIZE;
     2391                pDis->x86.fPrefix |= DISPREFIX_OPSIZE;
    23922392                if (pDis->uCpuMode == DISCPUMODE_16BIT)
    2393                     pDis->arch.x86.uOpMode = DISCPUMODE_32BIT;
     2393                    pDis->x86.uOpMode = DISCPUMODE_32BIT;
    23942394                else
    2395                     pDis->arch.x86.uOpMode = DISCPUMODE_16BIT;  /* for 32 and 64 bits mode (there is no 32 bits operand size override prefix) */
     2395                    pDis->x86.uOpMode = DISCPUMODE_16BIT;  /* for 32 and 64 bits mode (there is no 32 bits operand size override prefix) */
    23962396                continue;   //fetch the next byte
    23972397
    23982398            // rep and repne are not really prefixes, but we'll treat them as such
    23992399            case OP_REPE:
    2400                 pDis->arch.x86.fPrefix |= DISPREFIX_REP;
     2400                pDis->x86.fPrefix |= DISPREFIX_REP;
    24012401                continue;   //fetch the next byte
    24022402
    24032403            case OP_REPNE:
    2404                 pDis->arch.x86.fPrefix |= DISPREFIX_REPNE;
     2404                pDis->x86.fPrefix |= DISPREFIX_REPNE;
    24052405                continue;   //fetch the next byte
    24062406
     
    24082408                Assert(pDis->uCpuMode == DISCPUMODE_64BIT);
    24092409                /* REX prefix byte */
    2410                 pDis->arch.x86.fPrefix   |= DISPREFIX_REX;
    2411                 pDis->arch.x86.fRexPrefix = (uint8_t)DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[bCode].fParam1);
    2412                 if (pDis->arch.x86.fRexPrefix & DISPREFIX_REX_FLAGS_W)
    2413                     pDis->arch.x86.uOpMode = DISCPUMODE_64BIT;  /* overrides size prefix byte */
     2410                pDis->x86.fPrefix   |= DISPREFIX_REX;
     2411                pDis->x86.fRexPrefix = (uint8_t)DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[bCode].fParam1);
     2412                if (pDis->x86.fRexPrefix & DISPREFIX_REX_FLAGS_W)
     2413                    pDis->x86.uOpMode = DISCPUMODE_64BIT;  /* overrides size prefix byte */
    24142414                continue;   //fetch the next byte
    24152415            default:
     
    24282428
    24292429        /* first opcode byte. */
    2430         pDis->arch.x86.bOpCode  = bCode;
    2431         pDis->arch.x86.cbPrefix = (uint8_t)offInstr - 1;
     2430        pDis->x86.bOpCode  = bCode;
     2431        pDis->x86.cbPrefix = (uint8_t)offInstr - 1;
    24322432
    24332433        offInstr = disParseInstruction(offInstr, &paOneByteMap[bCode], pDis);
     
    24392439        *pcbInstr = (uint32_t)offInstr;
    24402440
    2441     if (pDis->arch.x86.fPrefix & DISPREFIX_LOCK)
     2441    if (pDis->x86.fPrefix & DISPREFIX_LOCK)
    24422442        disValidateLockSequence(pDis);
    24432443
     
    24602460{
    24612461#ifdef VBOX_STRICT /* poison */
    2462     pDis->Param1.arch.x86.Base.idxGenReg    = 0xc1;
    2463     pDis->Param2.arch.x86.Base.idxGenReg    = 0xc2;
    2464     pDis->Param3.arch.x86.Base.idxGenReg    = 0xc3;
    2465     pDis->Param1.arch.x86.Index.idxGenReg   = 0xc4;
    2466     pDis->Param2.arch.x86.Index.idxGenReg   = 0xc5;
    2467     pDis->Param3.arch.x86.Index.idxGenReg   = 0xc6;
    2468     pDis->Param1.arch.x86.uDisp.u64         = UINT64_C(0xd1d1d1d1d1d1d1d1);
    2469     pDis->Param2.arch.x86.uDisp.u64         = UINT64_C(0xd2d2d2d2d2d2d2d2);
    2470     pDis->Param3.arch.x86.uDisp.u64         = UINT64_C(0xd3d3d3d3d3d3d3d3);
     2462    pDis->Param1.x86.Base.idxGenReg    = 0xc1;
     2463    pDis->Param2.x86.Base.idxGenReg    = 0xc2;
     2464    pDis->Param3.x86.Base.idxGenReg    = 0xc3;
     2465    pDis->Param1.x86.Index.idxGenReg   = 0xc4;
     2466    pDis->Param2.x86.Index.idxGenReg   = 0xc5;
     2467    pDis->Param3.x86.Index.idxGenReg   = 0xc6;
     2468    pDis->Param1.x86.uDisp.u64         = UINT64_C(0xd1d1d1d1d1d1d1d1);
     2469    pDis->Param2.x86.uDisp.u64         = UINT64_C(0xd2d2d2d2d2d2d2d2);
     2470    pDis->Param3.x86.uDisp.u64         = UINT64_C(0xd3d3d3d3d3d3d3d3);
    24712471    pDis->Param1.uValue                     = UINT64_C(0xb1b1b1b1b1b1b1b1);
    24722472    pDis->Param2.uValue                     = UINT64_C(0xb2b2b2b2b2b2b2b2);
    24732473    pDis->Param3.uValue                     = UINT64_C(0xb3b3b3b3b3b3b3b3);
    2474     pDis->Param1.arch.x86.uScale            = 28;
    2475     pDis->Param2.arch.x86.uScale            = 29;
    2476     pDis->Param3.arch.x86.uScale            = 30;
     2474    pDis->Param1.x86.uScale            = 28;
     2475    pDis->Param2.x86.uScale            = 29;
     2476    pDis->Param3.x86.uScale            = 30;
    24772477#endif
    24782478
    2479     pDis->arch.x86.fPrefix           = DISPREFIX_NONE;
    2480     pDis->arch.x86.idxSegPrefix      = DISSELREG_DS;
    2481     pDis->arch.x86.pfnDisasmFnTable  = g_apfnFullDisasm;
    2482     pDis->arch.x86.fFilter           = fFilter;
     2479    pDis->x86.fPrefix           = DISPREFIX_NONE;
     2480    pDis->x86.idxSegPrefix      = DISSELREG_DS;
     2481    pDis->x86.pfnDisasmFnTable  = g_apfnFullDisasm;
     2482    pDis->x86.fFilter           = fFilter;
    24832483
    24842484    PCDISOPCODE paOneByteMap;
    24852485    if (enmCpuMode == DISCPUMODE_64BIT)
    24862486    {
    2487         pDis->arch.x86.uAddrMode     = DISCPUMODE_64BIT;
    2488         pDis->arch.x86.uOpMode       = DISCPUMODE_32BIT;
     2487        pDis->x86.uAddrMode     = DISCPUMODE_64BIT;
     2488        pDis->x86.uOpMode       = DISCPUMODE_32BIT;
    24892489        paOneByteMap        = g_aOneByteMapX64;
    24902490    }
    24912491    else
    24922492    {
    2493         pDis->arch.x86.uAddrMode     = (uint8_t)enmCpuMode;
    2494         pDis->arch.x86.uOpMode       = (uint8_t)enmCpuMode;
     2493        pDis->x86.uAddrMode     = (uint8_t)enmCpuMode;
     2494        pDis->x86.uOpMode       = (uint8_t)enmCpuMode;
    24952495        paOneByteMap        = g_aOneByteMapX86;
    24962496    }
  • trunk/src/VBox/Disassembler/DisasmFormatArmV8.cpp

    r99321 r101539  
    7474        case DISUSE_REG_GEN32:
    7575        {
    76             Assert(pParam->arch.armv8.Reg.idxGenReg < RT_ELEMENTS(g_aszArmV8RegGen32));
    77             const char *psz = g_aszArmV8RegGen32[pParam->arch.armv8.Reg.idxGenReg];
     76            Assert(pParam->armv8.Reg.idxGenReg < RT_ELEMENTS(g_aszArmV8RegGen32));
     77            const char *psz = g_aszArmV8RegGen32[pParam->armv8.Reg.idxGenReg];
    7878            *pcchReg = 2 + !!psz[2];
    7979            return psz;
     
    8282        case DISUSE_REG_GEN64:
    8383        {
    84             Assert(pParam->arch.armv8.Reg.idxGenReg < RT_ELEMENTS(g_aszArmV8RegGen64));
    85             const char *psz = g_aszArmV8RegGen64[pParam->arch.armv8.Reg.idxGenReg];
     84            Assert(pParam->armv8.Reg.idxGenReg < RT_ELEMENTS(g_aszArmV8RegGen64));
     85            const char *psz = g_aszArmV8RegGen64[pParam->armv8.Reg.idxGenReg];
    8686            *pcchReg = 2 + !!psz[2];
    8787            return psz;
  • trunk/src/VBox/Disassembler/DisasmFormatBytes.cpp

    r99220 r101539  
    7979    {
    8080        if (i != 0 && (fFlags & DIS_FMT_FLAGS_BYTES_SPACED))
    81             PUT_NUM(3, " %02x", pDis->u.abInstr[i]);
     81            PUT_NUM(3, " %02x", pDis->Instr.ab[i]);
    8282        else
    83             PUT_NUM(2, "%02x", pDis->u.abInstr[i]);
     83            PUT_NUM(2, "%02x", pDis->Instr.ab[i]);
    8484    }
    8585
  • trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp

    r101426 r101539  
    119119        case DISUSE_REG_GEN8:
    120120        {
    121             Assert(pParam->arch.x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen8));
    122             const char *psz = g_aszYasmRegGen8[pParam->arch.x86.Base.idxGenReg];
     121            Assert(pParam->x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen8));
     122            const char *psz = g_aszYasmRegGen8[pParam->x86.Base.idxGenReg];
    123123            *pcchReg = 2 + !!psz[2] + !!psz[3];
    124124            return psz;
     
    127127        case DISUSE_REG_GEN16:
    128128        {
    129             Assert(pParam->arch.x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen16));
    130             const char *psz = g_aszYasmRegGen16[pParam->arch.x86.Base.idxGenReg];
     129            Assert(pParam->x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen16));
     130            const char *psz = g_aszYasmRegGen16[pParam->x86.Base.idxGenReg];
    131131            *pcchReg = 2 + !!psz[2] + !!psz[3];
    132132            return psz;
     
    138138        case DISUSE_REG_GEN32:
    139139        {
    140             Assert(pParam->arch.x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen32));
    141             const char *psz = g_aszYasmRegGen32[pParam->arch.x86.Base.idxGenReg];
     140            Assert(pParam->x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen32));
     141            const char *psz = g_aszYasmRegGen32[pParam->x86.Base.idxGenReg];
    142142            *pcchReg = 2 + !!psz[2] + !!psz[3];
    143143            return psz;
     
    149149        case DISUSE_REG_GEN64:
    150150        {
    151             Assert(pParam->arch.x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen64));
    152             const char *psz = g_aszYasmRegGen64[pParam->arch.x86.Base.idxGenReg];
     151            Assert(pParam->x86.Base.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen64));
     152            const char *psz = g_aszYasmRegGen64[pParam->x86.Base.idxGenReg];
    153153            *pcchReg = 2 + !!psz[2] + !!psz[3];
    154154            return psz;
     
    157157        case DISUSE_REG_FP:
    158158        {
    159             Assert(pParam->arch.x86.Base.idxFpuReg < RT_ELEMENTS(g_aszYasmRegFP));
    160             const char *psz = g_aszYasmRegFP[pParam->arch.x86.Base.idxFpuReg];
     159            Assert(pParam->x86.Base.idxFpuReg < RT_ELEMENTS(g_aszYasmRegFP));
     160            const char *psz = g_aszYasmRegFP[pParam->x86.Base.idxFpuReg];
    161161            *pcchReg = 3;
    162162            return psz;
     
    165165        case DISUSE_REG_MMX:
    166166        {
    167             Assert(pParam->arch.x86.Base.idxMmxReg < RT_ELEMENTS(g_aszYasmRegMMX));
    168             const char *psz = g_aszYasmRegMMX[pParam->arch.x86.Base.idxMmxReg];
     167            Assert(pParam->x86.Base.idxMmxReg < RT_ELEMENTS(g_aszYasmRegMMX));
     168            const char *psz = g_aszYasmRegMMX[pParam->x86.Base.idxMmxReg];
    169169            *pcchReg = 3;
    170170            return psz;
     
    173173        case DISUSE_REG_XMM:
    174174        {
    175             Assert(pParam->arch.x86.Base.idxXmmReg < RT_ELEMENTS(g_aszYasmRegXMM));
    176             const char *psz = g_aszYasmRegXMM[pParam->arch.x86.Base.idxXmmReg];
     175            Assert(pParam->x86.Base.idxXmmReg < RT_ELEMENTS(g_aszYasmRegXMM));
     176            const char *psz = g_aszYasmRegXMM[pParam->x86.Base.idxXmmReg];
    177177            *pcchReg = 4 + !!psz[4];
    178178            return psz;
     
    181181        case DISUSE_REG_YMM:
    182182        {
    183             Assert(pParam->arch.x86.Base.idxYmmReg < RT_ELEMENTS(g_aszYasmRegYMM));
    184             const char *psz = g_aszYasmRegYMM[pParam->arch.x86.Base.idxYmmReg];
     183            Assert(pParam->x86.Base.idxYmmReg < RT_ELEMENTS(g_aszYasmRegYMM));
     184            const char *psz = g_aszYasmRegYMM[pParam->x86.Base.idxYmmReg];
    185185            *pcchReg = 4 + !!psz[4];
    186186            return psz;
     
    189189        case DISUSE_REG_CR:
    190190        {
    191             Assert(pParam->arch.x86.Base.idxCtrlReg < RT_ELEMENTS(g_aszYasmRegCRx));
    192             const char *psz = g_aszYasmRegCRx[pParam->arch.x86.Base.idxCtrlReg];
     191            Assert(pParam->x86.Base.idxCtrlReg < RT_ELEMENTS(g_aszYasmRegCRx));
     192            const char *psz = g_aszYasmRegCRx[pParam->x86.Base.idxCtrlReg];
    193193            *pcchReg = 3;
    194194            return psz;
     
    197197        case DISUSE_REG_DBG:
    198198        {
    199             Assert(pParam->arch.x86.Base.idxDbgReg < RT_ELEMENTS(g_aszYasmRegDRx));
    200             const char *psz = g_aszYasmRegDRx[pParam->arch.x86.Base.idxDbgReg];
     199            Assert(pParam->x86.Base.idxDbgReg < RT_ELEMENTS(g_aszYasmRegDRx));
     200            const char *psz = g_aszYasmRegDRx[pParam->x86.Base.idxDbgReg];
    201201            *pcchReg = 3;
    202202            return psz;
     
    205205        case DISUSE_REG_SEG:
    206206        {
    207             Assert(pParam->arch.x86.Base.idxSegReg < RT_ELEMENTS(g_aszYasmRegCRx));
    208             const char *psz = g_aszYasmRegSeg[pParam->arch.x86.Base.idxSegReg];
     207            Assert(pParam->x86.Base.idxSegReg < RT_ELEMENTS(g_aszYasmRegCRx));
     208            const char *psz = g_aszYasmRegSeg[pParam->x86.Base.idxSegReg];
    209209            *pcchReg = 2;
    210210            return psz;
     
    213213        case DISUSE_REG_TEST:
    214214        {
    215             Assert(pParam->arch.x86.Base.idxTestReg < RT_ELEMENTS(g_aszYasmRegTRx));
    216             const char *psz = g_aszYasmRegTRx[pParam->arch.x86.Base.idxTestReg];
     215            Assert(pParam->x86.Base.idxTestReg < RT_ELEMENTS(g_aszYasmRegTRx));
     216            const char *psz = g_aszYasmRegTRx[pParam->x86.Base.idxTestReg];
    217217            *pcchReg = 3;
    218218            return psz;
     
    239239    if (pParam->fUse & DISUSE_REG_XMM)
    240240    {
    241         Assert(pParam->arch.x86.Index.idxXmmReg < RT_ELEMENTS(g_aszYasmRegXMM));
    242         const char *psz = g_aszYasmRegXMM[pParam->arch.x86.Index.idxXmmReg];
     241        Assert(pParam->x86.Index.idxXmmReg < RT_ELEMENTS(g_aszYasmRegXMM));
     242        const char *psz = g_aszYasmRegXMM[pParam->x86.Index.idxXmmReg];
    243243        *pcchReg = 4 + !!psz[4];
    244244        return psz;
     
    246246    else if (pParam->fUse & DISUSE_REG_YMM)
    247247    {
    248         Assert(pParam->arch.x86.Index.idxYmmReg < RT_ELEMENTS(g_aszYasmRegYMM));
    249         const char *psz = g_aszYasmRegYMM[pParam->arch.x86.Index.idxYmmReg];
     248        Assert(pParam->x86.Index.idxYmmReg < RT_ELEMENTS(g_aszYasmRegYMM));
     249        const char *psz = g_aszYasmRegYMM[pParam->x86.Index.idxYmmReg];
    250250        *pcchReg = 4 + !!psz[4];
    251251        return psz;
     
    253253    }
    254254    else
    255     switch (pDis->arch.x86.uAddrMode)
     255    switch (pDis->x86.uAddrMode)
    256256    {
    257257        case DISCPUMODE_16BIT:
    258258        {
    259             Assert(pParam->arch.x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen16));
    260             const char *psz = g_aszYasmRegGen16[pParam->arch.x86.Index.idxGenReg];
     259            Assert(pParam->x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen16));
     260            const char *psz = g_aszYasmRegGen16[pParam->x86.Index.idxGenReg];
    261261            *pcchReg = 2 + !!psz[2] + !!psz[3];
    262262            return psz;
     
    265265        case DISCPUMODE_32BIT:
    266266        {
    267             Assert(pParam->arch.x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen32));
    268             const char *psz = g_aszYasmRegGen32[pParam->arch.x86.Index.idxGenReg];
     267            Assert(pParam->x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen32));
     268            const char *psz = g_aszYasmRegGen32[pParam->x86.Index.idxGenReg];
    269269            *pcchReg = 2 + !!psz[2] + !!psz[3];
    270270            return psz;
     
    273273        case DISCPUMODE_64BIT:
    274274        {
    275             Assert(pParam->arch.x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen64));
    276             const char *psz = g_aszYasmRegGen64[pParam->arch.x86.Index.idxGenReg];
     275            Assert(pParam->x86.Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen64));
     276            const char *psz = g_aszYasmRegGen64[pParam->x86.Index.idxGenReg];
    277277            *pcchReg = 2 + !!psz[2] + !!psz[3];
    278278            return psz;
     
    280280
    281281        default:
    282             AssertMsgFailed(("%#x %#x\n", pParam->fUse, pDis->arch.x86.uAddrMode));
     282            AssertMsgFailed(("%#x %#x\n", pParam->fUse, pDis->x86.uAddrMode));
    283283            *pcchReg = 3;
    284284            return "r??";
     
    472472    if (    pOp->uOpcode == OP_INVALID
    473473        ||  (   pOp->uOpcode == OP_ILLUD2
    474              && (pDis->arch.x86.fPrefix & DISPREFIX_LOCK)))
     474             && (pDis->x86.fPrefix & DISPREFIX_LOCK)))
    475475        PUT_SZ("Illegal opcode");
    476476    else
     
    479479         * Prefixes
    480480         */
    481         if (pDis->arch.x86.fPrefix & DISPREFIX_LOCK)
     481        if (pDis->x86.fPrefix & DISPREFIX_LOCK)
    482482            PUT_SZ("lock ");
    483         if (pDis->arch.x86.fPrefix & DISPREFIX_REP)
     483        if (pDis->x86.fPrefix & DISPREFIX_REP)
    484484            PUT_SZ("rep ");
    485         else if(pDis->arch.x86.fPrefix & DISPREFIX_REPNE)
     485        else if(pDis->x86.fPrefix & DISPREFIX_REPNE)
    486486            PUT_SZ("repne ");
    487487
     
    497497        {
    498498            case OP_JECXZ:
    499                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "jcxz %Jb" : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "jecxz %Jb"   : "jrcxz %Jb";
     499                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "jcxz %Jb" : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "jecxz %Jb"   : "jrcxz %Jb";
    500500                break;
    501501            case OP_PUSHF:
    502                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "pushfw"   : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "pushfd"      : "pushfq";
     502                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "pushfw"   : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "pushfd"      : "pushfq";
    503503                break;
    504504            case OP_POPF:
    505                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "popfw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "popfd"       : "popfq";
     505                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "popfw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "popfd"       : "popfq";
    506506                break;
    507507            case OP_PUSHA:
    508                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "pushaw"   : "pushad";
     508                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "pushaw"   : "pushad";
    509509                break;
    510510            case OP_POPA:
    511                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "popaw"    : "popad";
     511                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "popaw"    : "popad";
    512512                break;
    513513            case OP_INSB:
     
    516516                break;
    517517            case OP_INSWD:
    518                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "insw"     : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "insd"  : "insq";
     518                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "insw"     : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "insd"  : "insq";
    519519                fMayNeedAddrSize = true;
    520520                break;
     
    524524                break;
    525525            case OP_OUTSWD:
    526                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "outsw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "outsd" : "outsq";
     526                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "outsw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "outsd" : "outsq";
    527527                fMayNeedAddrSize = true;
    528528                break;
     
    532532                break;
    533533            case OP_MOVSWD:
    534                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "movsw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "movsd" : "movsq";
     534                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "movsw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "movsd" : "movsq";
    535535                fMayNeedAddrSize = true;
    536536                break;
     
    540540                break;
    541541            case OP_CMPWD:
    542                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "cmpsw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "cmpsd" : "cmpsq";
     542                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "cmpsw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "cmpsd" : "cmpsq";
    543543                fMayNeedAddrSize = true;
    544544                break;
     
    548548                break;
    549549            case OP_SCASWD:
    550                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "scasw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "scasd" : "scasq";
     550                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "scasw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "scasd" : "scasq";
    551551                fMayNeedAddrSize = true;
    552552                break;
     
    556556                break;
    557557            case OP_LODSWD:
    558                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "lodsw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "lodsd" : "lodsq";
     558                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "lodsw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "lodsd" : "lodsq";
    559559                fMayNeedAddrSize = true;
    560560                break;
     
    564564                break;
    565565            case OP_STOSWD:
    566                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "stosw"    : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "stosd" : "stosq";
     566                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "stosw"    : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "stosd" : "stosq";
    567567                fMayNeedAddrSize = true;
    568568                break;
    569569            case OP_CBW:
    570                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "cbw"      : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "cwde"  : "cdqe";
     570                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "cbw"      : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "cwde"  : "cdqe";
    571571                break;
    572572            case OP_CWD:
    573                 pszFmt = pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? "cwd"      : pDis->arch.x86.uOpMode == DISCPUMODE_32BIT ? "cdq"   : "cqo";
     573                pszFmt = pDis->x86.uOpMode == DISCPUMODE_16BIT ? "cwd"      : pDis->x86.uOpMode == DISCPUMODE_32BIT ? "cdq"   : "cqo";
    574574                break;
    575575            case OP_SHL:
     
    588588             */
    589589            case OP_NOP:
    590                 if (pDis->arch.x86.bOpCode == 0x90)
     590                if (pDis->x86.bOpCode == 0x90)
    591591                    /* fine, fine */;
    592592                else if (pszFmt[sizeof("nop %Ev") - 1] == '/' && pszFmt[sizeof("nop %Ev")] == 'p')
    593593                    pszFmt = "prefetch %Eb";
    594                 else if (pDis->arch.x86.bOpCode == 0x1f)
     594                else if (pDis->x86.bOpCode == 0x1f)
    595595                {
    596596                    Assert(pDis->cbInstr >= 3);
    597597                    PUT_SZ("db 00fh, 01fh,");
    598                     PUT_NUM_8(MAKE_MODRM(pDis->arch.x86.ModRM.Bits.Mod, pDis->arch.x86.ModRM.Bits.Reg, pDis->arch.x86.ModRM.Bits.Rm));
     598                    PUT_NUM_8(MAKE_MODRM(pDis->x86.ModRM.Bits.Mod, pDis->x86.ModRM.Bits.Reg, pDis->x86.ModRM.Bits.Rm));
    599599                    for (unsigned i = 3; i < pDis->cbInstr; i++)
    600600                    {
     
    638638                        char *pszFmtDst = szTmpFmt;
    639639                        if (pszSpace == NULL) pszSpace = strchr(pszDelim, 0);
    640                         if (   (*pszFmt == '#' && !pDis->arch.x86.bVexWFlag) /** @todo check this*/
    641                             || (*pszFmt == '@' && !VEXREG_IS256B(pDis->arch.x86.bVexDestReg))
     640                        if (   (*pszFmt == '#' && !pDis->x86.bVexWFlag) /** @todo check this*/
     641                            || (*pszFmt == '@' && !VEXREG_IS256B(pDis->x86.bVexDestReg))
    642642                            || (*pszFmt == '&' && (   DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse)
    643643                                                   || DISUSE_IS_EFFECTIVE_ADDR(pDis->Param2.fUse)
     
    663663             */
    664664            case OP_FLD:
    665                 if (pDis->arch.x86.bOpCode == 0xdb) /* m80fp workaround. */
    666                     *(int *)&pDis->Param1.arch.x86.fParam &= ~0x1f; /* make it pure OP_PARM_M */
     665                if (pDis->x86.bOpCode == 0xdb) /* m80fp workaround. */
     666                    *(int *)&pDis->Param1.x86.fParam &= ~0x1f; /* make it pure OP_PARM_M */
    667667                break;
    668668            case OP_LAR: /* hack w -> v, probably not correct. */
    669                 *(int *)&pDis->Param2.arch.x86.fParam &= ~0x1f;
    670                 *(int *)&pDis->Param2.arch.x86.fParam |= OP_PARM_v;
     669                *(int *)&pDis->Param2.x86.fParam &= ~0x1f;
     670                *(int *)&pDis->Param2.x86.fParam |= OP_PARM_v;
    671671                break;
    672672        }
     
    675675         * Add operand size and address prefixes for outsb, movsb, etc.
    676676         */
    677         if (pDis->arch.x86.fPrefix & (DISPREFIX_OPSIZE | DISPREFIX_ADDRSIZE))
    678         {
    679             if (fIgnoresOpSize && (pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE) )
     677        if (pDis->x86.fPrefix & (DISPREFIX_OPSIZE | DISPREFIX_ADDRSIZE))
     678        {
     679            if (fIgnoresOpSize && (pDis->x86.fPrefix & DISPREFIX_OPSIZE) )
    680680            {
    681681                if (pDis->uCpuMode == DISCPUMODE_16BIT)
     
    684684                    PUT_SZ("o16 ");
    685685            }
    686             if (fMayNeedAddrSize && (pDis->arch.x86.fPrefix & DISPREFIX_ADDRSIZE) )
     686            if (fMayNeedAddrSize && (pDis->x86.fPrefix & DISPREFIX_ADDRSIZE) )
    687687            {
    688688                if (pDis->uCpuMode == DISCPUMODE_16BIT)
     
    701701#define PUT_FAR() \
    702702            do { \
    703                 if (    OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_p \
     703                if (    OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_p \
    704704                    &&  pOp->uOpcode != OP_LDS /* table bugs? */ \
    705705                    &&  pOp->uOpcode != OP_LES \
     
    713713#define PUT_SIZE_OVERRIDE() \
    714714            do { \
    715                 switch (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam)) \
     715                switch (OP_PARM_VSUBTYPE(pParam->x86.fParam)) \
    716716                { \
    717717                    case OP_PARM_v: \
    718718                    case OP_PARM_y: \
    719                         switch (pDis->arch.x86.uOpMode) \
     719                        switch (pDis->x86.uOpMode) \
    720720                        { \
    721                             case DISCPUMODE_16BIT: if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) != OP_PARM_y) PUT_SZ("word "); break; \
     721                            case DISCPUMODE_16BIT: if (OP_PARM_VSUBTYPE(pParam->x86.fParam) != OP_PARM_y) PUT_SZ("word "); break; \
    722722                            case DISCPUMODE_32BIT: \
    723                                 if (pDis->pCurInstr->uOpcode != OP_GATHER || pDis->arch.x86.bVexWFlag) { PUT_SZ("dword "); break; } \
     723                                if (pDis->pCurInstr->uOpcode != OP_GATHER || pDis->x86.bVexWFlag) { PUT_SZ("dword "); break; } \
    724724                                RT_FALL_THRU(); \
    725725                            case DISCPUMODE_64BIT: PUT_SZ("qword "); break; \
     
    729729                    case OP_PARM_b: PUT_SZ("byte "); break; \
    730730                    case OP_PARM_w: \
    731                         if (   OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_W \
    732                             || OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_M) \
     731                        if (   OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_W \
     732                            || OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_M) \
    733733                        { \
    734                             if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg)) PUT_SZ("dword "); \
     734                            if (VEXREG_IS256B(pDis->x86.bVexDestReg)) PUT_SZ("dword "); \
    735735                            else PUT_SZ("word "); \
    736736                        } \
    737737                        break; \
    738738                    case OP_PARM_d: \
    739                         if (   OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_W \
    740                             || OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_M) \
     739                        if (   OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_W \
     740                            || OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_M) \
    741741                        { \
    742                             if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg)) PUT_SZ("qword "); \
     742                            if (VEXREG_IS256B(pDis->x86.bVexDestReg)) PUT_SZ("qword "); \
    743743                            else PUT_SZ("dword "); \
    744744                        } \
    745745                        break; \
    746746                    case OP_PARM_q: \
    747                         if (   OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_W \
    748                             || OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_M) \
     747                        if (   OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_W \
     748                            || OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_M) \
    749749                        { \
    750                             if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg)) PUT_SZ("oword "); \
     750                            if (VEXREG_IS256B(pDis->x86.bVexDestReg)) PUT_SZ("oword "); \
    751751                            else PUT_SZ("qword "); \
    752752                        } \
     
    754754                    case OP_PARM_ps: \
    755755                    case OP_PARM_pd: \
    756                     case OP_PARM_x: if (VEXREG_IS256B(pDis->arch.x86.bVexDestReg)) { PUT_SZ("yword "); break; } RT_FALL_THRU(); \
     756                    case OP_PARM_x: if (VEXREG_IS256B(pDis->x86.bVexDestReg)) { PUT_SZ("yword "); break; } RT_FALL_THRU(); \
    757757                    case OP_PARM_ss: \
    758758                    case OP_PARM_sd: \
     
    763763                    case OP_PARM_z: break; \
    764764                    case OP_PARM_NONE: \
    765                         if (    OP_PARM_VTYPE(pParam->arch.x86.fParam) == OP_PARM_M \
     765                        if (    OP_PARM_VTYPE(pParam->x86.fParam) == OP_PARM_M \
    766766                            &&  ((pParam->fUse & DISUSE_REG_FP) || pOp->uOpcode == OP_FLD)) \
    767767                            PUT_SZ("tword "); \
     
    773773#define PUT_SEGMENT_OVERRIDE() \
    774774        do { \
    775             if (pDis->arch.x86.fPrefix & DISPREFIX_SEG) \
    776                 PUT_STR(s_szSegPrefix[pDis->arch.x86.idxSegPrefix], 3); \
     775            if (pDis->x86.fPrefix & DISPREFIX_SEG) \
     776                PUT_STR(s_szSegPrefix[pDis->x86.idxSegPrefix], 3); \
    777777        } while (0)
    778778
     
    781781         * Segment prefixing for instructions that doesn't do memory access.
    782782         */
    783         if (    (pDis->arch.x86.fPrefix & DISPREFIX_SEG)
     783        if (    (pDis->x86.fPrefix & DISPREFIX_SEG)
    784784            &&  !DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse)
    785785            &&  !DISUSE_IS_EFFECTIVE_ADDR(pDis->Param2.fUse)
    786786            &&  !DISUSE_IS_EFFECTIVE_ADDR(pDis->Param3.fUse))
    787787        {
    788             PUT_STR(s_szSegPrefix[pDis->arch.x86.idxSegPrefix], 2);
     788            PUT_STR(s_szSegPrefix[pDis->x86.idxSegPrefix], 2);
    789789            PUT_C(' ');
    790790        }
     
    846846                            /* Work around mov seg,[mem16]  and mov [mem16],seg as these always make a 16-bit mem
    847847                               while the register variants deals with 16, 32 & 64 in the normal fashion. */
    848                             if (    pParam->arch.x86.fParam != OP_PARM_Ev
     848                            if (    pParam->x86.fParam != OP_PARM_Ev
    849849                                ||  pOp->uOpcode != OP_MOV
    850850                                ||  (   pOp->fParam1 != OP_PARM_Sw
     
    857857                        {
    858858                            if (   (fUse & DISUSE_DISPLACEMENT8)
    859                                 && !pParam->arch.x86.uDisp.i8)
     859                                && !pParam->x86.uDisp.i8)
    860860                                PUT_SZ("byte ");
    861861                            else if (   (fUse & DISUSE_DISPLACEMENT16)
    862                                      && (int8_t)pParam->arch.x86.uDisp.i16 == (int16_t)pParam->arch.x86.uDisp.i16)
     862                                     && (int8_t)pParam->x86.uDisp.i16 == (int16_t)pParam->x86.uDisp.i16)
    863863                                PUT_SZ("word ");
    864864                            else if (   (fUse & DISUSE_DISPLACEMENT32)
    865                                      && (int16_t)pParam->arch.x86.uDisp.i32 == (int32_t)pParam->arch.x86.uDisp.i32) //??
     865                                     && (int16_t)pParam->x86.uDisp.i32 == (int32_t)pParam->x86.uDisp.i32) //??
    866866                                PUT_SZ("dword ");
    867867                            else if (   (fUse & DISUSE_DISPLACEMENT64)
    868                                      && (pDis->arch.x86.SIB.Bits.Base != 5 || pDis->arch.x86.ModRM.Bits.Mod != 0)
    869                                      && (int32_t)pParam->arch.x86.uDisp.i64 == (int64_t)pParam->arch.x86.uDisp.i64) //??
     868                                     && (pDis->x86.SIB.Bits.Base != 5 || pDis->x86.ModRM.Bits.Mod != 0)
     869                                     && (int32_t)pParam->x86.uDisp.i64 == (int64_t)pParam->x86.uDisp.i64) //??
    870870                                PUT_SZ("qword ");
    871871                        }
     
    906906                            {
    907907                                PUT_C('*');
    908                                 PUT_C('0' + pParam->arch.x86.uScale);
     908                                PUT_C('0' + pParam->x86.uScale);
    909909                            }
    910910                        }
     
    916916                        {
    917917                            if (fUse & DISUSE_DISPLACEMENT8)
    918                                 off2 = pParam->arch.x86.uDisp.i8;
     918                                off2 = pParam->x86.uDisp.i8;
    919919                            else if (fUse & DISUSE_DISPLACEMENT16)
    920                                 off2 = pParam->arch.x86.uDisp.i16;
     920                                off2 = pParam->x86.uDisp.i16;
    921921                            else if (fUse & (DISUSE_DISPLACEMENT32 | DISUSE_RIPDISPLACEMENT32))
    922                                 off2 = pParam->arch.x86.uDisp.i32;
     922                                off2 = pParam->x86.uDisp.i32;
    923923                            else if (fUse & DISUSE_DISPLACEMENT64)
    924                                 off2 = pParam->arch.x86.uDisp.i64;
     924                                off2 = pParam->x86.uDisp.i64;
    925925                            else
    926926                            {
     
    951951                                PUT_NUM_64(off2);
    952952                                if (pfnGetSymbol)
    953                                     PUT_SYMBOL((pDis->arch.x86.fPrefix & DISPREFIX_SEG)
    954                                                ? DIS_FMT_SEL_FROM_REG(pDis->arch.x86.idxSegPrefix)
     953                                    PUT_SYMBOL((pDis->x86.fPrefix & DISPREFIX_SEG)
     954                                               ? DIS_FMT_SEL_FROM_REG(pDis->x86.idxSegPrefix)
    955955                                               : DIS_FMT_SEL_FROM_REG(DISSELREG_DS),
    956                                                pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT
     956                                               pDis->x86.uAddrMode == DISCPUMODE_64BIT
    957957                                               ? (uint64_t)off2
    958                                                : pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT
     958                                               : pDis->x86.uAddrMode == DISCPUMODE_32BIT
    959959                                               ? (uint32_t)off2
    960960                                               : (uint16_t)off2,
     
    969969                        {
    970970                            if (pfnGetSymbol && !fBase && !(fUse & (DISUSE_INDEX | DISUSE_RIPDISPLACEMENT32)) && off2 != 0)
    971                                 PUT_SYMBOL((pDis->arch.x86.fPrefix & DISPREFIX_SEG)
    972                                            ? DIS_FMT_SEL_FROM_REG(pDis->arch.x86.idxSegPrefix)
     971                                PUT_SYMBOL((pDis->x86.fPrefix & DISPREFIX_SEG)
     972                                           ? DIS_FMT_SEL_FROM_REG(pDis->x86.idxSegPrefix)
    973973                                           : DIS_FMT_SEL_FROM_REG(DISSELREG_DS),
    974                                            pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT
     974                                           pDis->x86.uAddrMode == DISCPUMODE_64BIT
    975975                                           ? (uint64_t)off2
    976                                            : pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT
     976                                           : pDis->x86.uAddrMode == DISCPUMODE_32BIT
    977977                                           ? (uint32_t)off2
    978978                                           : (uint16_t)off2,
     
    10031003
    10041004                            case DISUSE_IMMEDIATE16:
    1005                                 if (    pDis->uCpuMode != pDis->arch.x86.uOpMode
     1005                                if (    pDis->uCpuMode != pDis->x86.uOpMode
    10061006                                    ||  (   (fFlags & DIS_FMT_FLAGS_STRICT)
    10071007                                         && (   (int8_t)pParam->uValue == (int16_t)pParam->uValue
     
    10111011                                   )
    10121012                                {
    1013                                     if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_b)
     1013                                    if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_b)
    10141014                                        PUT_SZ_STRICT("strict byte ", "byte ");
    1015                                     else if (   OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_v
    1016                                              || OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_z)
     1015                                    else if (   OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_v
     1016                                             || OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_z)
    10171017                                        PUT_SZ_STRICT("strict word ", "word ");
    10181018                                }
     
    10211021
    10221022                            case DISUSE_IMMEDIATE16_SX8:
    1023                                 if (   !(pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     1023                                if (   !(pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    10241024                                    || pDis->pCurInstr->uOpcode != OP_PUSH)
    10251025                                    PUT_SZ_STRICT("strict byte ", "byte ");
     
    10301030
    10311031                            case DISUSE_IMMEDIATE32:
    1032                                 if (    pDis->arch.x86.uOpMode != (pDis->uCpuMode == DISCPUMODE_16BIT ? DISCPUMODE_16BIT : DISCPUMODE_32BIT) /* not perfect */
     1032                                if (    pDis->x86.uOpMode != (pDis->uCpuMode == DISCPUMODE_16BIT ? DISCPUMODE_16BIT : DISCPUMODE_32BIT) /* not perfect */
    10331033                                    ||  (   (fFlags & DIS_FMT_FLAGS_STRICT)
    10341034                                         && (   (int8_t)pParam->uValue == (int32_t)pParam->uValue
     
    10381038                                    )
    10391039                                {
    1040                                     if (OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_b)
     1040                                    if (OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_b)
    10411041                                        PUT_SZ_STRICT("strict byte ", "byte ");
    1042                                     else if (   OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_v
    1043                                              || OP_PARM_VSUBTYPE(pParam->arch.x86.fParam) == OP_PARM_z)
     1042                                    else if (   OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_v
     1043                                             || OP_PARM_VSUBTYPE(pParam->x86.fParam) == OP_PARM_z)
    10441044                                        PUT_SZ_STRICT("strict dword ", "dword ");
    10451045                                }
     
    10501050
    10511051                            case DISUSE_IMMEDIATE32_SX8:
    1052                                 if (   !(pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     1052                                if (   !(pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    10531053                                    || pDis->pCurInstr->uOpcode != OP_PUSH)
    10541054                                    PUT_SZ_STRICT("strict byte ", "byte ");
     
    10591059
    10601060                            case DISUSE_IMMEDIATE64_SX8:
    1061                                 if (   !(pDis->arch.x86.fPrefix & DISPREFIX_OPSIZE)
     1061                                if (   !(pDis->x86.fPrefix & DISPREFIX_OPSIZE)
    10621062                                    || pDis->pCurInstr->uOpcode != OP_PUSH)
    10631063                                    PUT_SZ_STRICT("strict byte ", "byte ");
     
    12161216                                break;
    12171217                            case DISUSE_DISPLACEMENT16:
    1218                                 PUT_NUM_16(pParam->arch.x86.uDisp.i16);
     1218                                PUT_NUM_16(pParam->x86.uDisp.i16);
    12191219                                if (pfnGetSymbol)
    1220                                     rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->arch.x86.uDisp.u16, szSymbol, sizeof(szSymbol), &off, pvUser);
     1220                                    rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->x86.uDisp.u16, szSymbol, sizeof(szSymbol), &off, pvUser);
    12211221                                break;
    12221222                            case DISUSE_DISPLACEMENT32:
    1223                                 PUT_NUM_32(pParam->arch.x86.uDisp.i32);
     1223                                PUT_NUM_32(pParam->x86.uDisp.i32);
    12241224                                if (pfnGetSymbol)
    1225                                     rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->arch.x86.uDisp.u32, szSymbol, sizeof(szSymbol), &off, pvUser);
     1225                                    rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->x86.uDisp.u32, szSymbol, sizeof(szSymbol), &off, pvUser);
    12261226                                break;
    12271227                            case DISUSE_DISPLACEMENT64:
    1228                                 PUT_NUM_64(pParam->arch.x86.uDisp.i64);
     1228                                PUT_NUM_64(pParam->x86.uDisp.i64);
    12291229                                if (pfnGetSymbol)
    1230                                     rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->arch.x86.uDisp.u64, szSymbol, sizeof(szSymbol), &off, pvUser);
     1230                                    rc = pfnGetSymbol(pDis, DIS_FMT_SEL_FROM_REG(DISSELREG_CS), pParam->x86.uDisp.u64, szSymbol, sizeof(szSymbol), &off, pvUser);
    12311231                                break;
    12321232                            default:
     
    13851385     * Mod rm + SIB: Check for duplicate EBP encodings that yasm won't use for very good reasons.
    13861386     */
    1387     if (    pDis->arch.x86.uAddrMode != DISCPUMODE_16BIT /// @todo correct?
    1388         &&  pDis->arch.x86.ModRM.Bits.Rm == 4
    1389         &&  pDis->arch.x86.ModRM.Bits.Mod != 3)
     1387    if (    pDis->x86.uAddrMode != DISCPUMODE_16BIT /// @todo correct?
     1388        &&  pDis->x86.ModRM.Bits.Rm == 4
     1389        &&  pDis->x86.ModRM.Bits.Mod != 3)
    13901390    {
    13911391        /* No scaled index SIB (index=4), except for ESP. */
    1392         if (    pDis->arch.x86.SIB.Bits.Index == 4
    1393             &&  pDis->arch.x86.SIB.Bits.Base != 4)
     1392        if (    pDis->x86.SIB.Bits.Index == 4
     1393            &&  pDis->x86.SIB.Bits.Base != 4)
    13941394            return true;
    13951395
    13961396        /* EBP + displacement */
    1397         if (    pDis->arch.x86.ModRM.Bits.Mod != 0
    1398              && pDis->arch.x86.SIB.Bits.Base == 5
    1399              && pDis->arch.x86.SIB.Bits.Scale == 0)
     1397        if (    pDis->x86.ModRM.Bits.Mod != 0
     1398             && pDis->x86.SIB.Bits.Base == 5
     1399             && pDis->x86.SIB.Bits.Scale == 0)
    14001400            return true;
    14011401    }
     
    14051405     */
    14061406    if (    pDis->pCurInstr->uOpcode == OP_SHL
    1407         &&  pDis->arch.x86.ModRM.Bits.Reg == 6)
     1407        &&  pDis->x86.ModRM.Bits.Reg == 6)
    14081408        return true;
    14091409
     
    14151415    uint8_t  offAddrSize = UINT8_MAX;
    14161416    uint32_t fPrefixes = 0;
    1417     for (uint32_t offOpcode = 0; offOpcode < RT_ELEMENTS(pDis->u.abInstr); offOpcode++)
     1417    for (uint32_t offOpcode = 0; offOpcode < RT_ELEMENTS(pDis->Instr.ab); offOpcode++)
    14181418    {
    14191419        uint32_t f;
    1420         switch (pDis->u.abInstr[offOpcode])
     1420        switch (pDis->Instr.ab[offOpcode])
    14211421        {
    14221422            case 0xf0:
     
    14721472    {
    14731473        /* no effective address which it may apply to. */
    1474         Assert((pDis->arch.x86.fPrefix & DISPREFIX_SEG) || pDis->uCpuMode == DISCPUMODE_64BIT);
     1474        Assert((pDis->x86.fPrefix & DISPREFIX_SEG) || pDis->uCpuMode == DISCPUMODE_64BIT);
    14751475        if (    !DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse)
    14761476            &&  !DISUSE_IS_EFFECTIVE_ADDR(pDis->Param2.fUse)
     
    14871487    if (fPrefixes & DISPREFIX_ADDRSIZE)
    14881488    {
    1489         Assert(pDis->arch.x86.fPrefix & DISPREFIX_ADDRSIZE);
     1489        Assert(pDis->x86.fPrefix & DISPREFIX_ADDRSIZE);
    14901490        if (    pDis->pCurInstr->fParam3 == OP_PARM_NONE
    14911491            &&  pDis->pCurInstr->fParam2 == OP_PARM_NONE
     
    16381638     *        yasm: 18F5   sbb ch, dh     ; SBB r/m8, r8
    16391639     */
    1640     if (pDis->arch.x86.ModRM.Bits.Mod == 3 /* reg,reg */)
     1640    if (pDis->x86.ModRM.Bits.Mod == 3 /* reg,reg */)
    16411641    {
    16421642        switch (pDis->pCurInstr->uOpcode)
     
    16571657
    16581658                /* 82 (see table A-6). */
    1659                 if (pDis->arch.x86.bOpCode == 0x82)
     1659                if (pDis->x86.bOpCode == 0x82)
    16601660                    return true;
    16611661                break;
     
    16681668            case OP_POP:
    16691669            case OP_PUSH:
    1670                 Assert(pDis->arch.x86.bOpCode == 0x8f);
     1670                Assert(pDis->x86.bOpCode == 0x8f);
    16711671                return true;
    16721672
    16731673            case OP_MOV:
    1674                 if (   pDis->arch.x86.bOpCode == 0x8a
    1675                     || pDis->arch.x86.bOpCode == 0x8b)
     1674                if (   pDis->x86.bOpCode == 0x8a
     1675                    || pDis->x86.bOpCode == 0x8b)
    16761676                    return true;
    16771677                break;
     
    17001700
    17011701    /* And some more - see table A-6. */
    1702     if (pDis->arch.x86.bOpCode == 0x82)
     1702    if (pDis->x86.bOpCode == 0x82)
    17031703    {
    17041704        switch (pDis->pCurInstr->uOpcode)
     
    17401740        case OP_SETLE:
    17411741        case OP_SETNLE:
    1742             AssertMsg(pDis->arch.x86.bOpCode >= 0x90 && pDis->arch.x86.bOpCode <= 0x9f, ("%#x\n", pDis->arch.x86.bOpCode));
    1743             if (pDis->arch.x86.ModRM.Bits.Reg != 2)
     1742            AssertMsg(pDis->x86.bOpCode >= 0x90 && pDis->x86.bOpCode <= 0x9f, ("%#x\n", pDis->x86.bOpCode));
     1743            if (pDis->x86.ModRM.Bits.Reg != 2)
    17441744                return true;
    17451745            break;
     
    17511751     */
    17521752    if (    pDis->pCurInstr->uOpcode == OP_MOVZX
    1753         &&  pDis->arch.x86.bOpCode == 0xB7
     1753        &&  pDis->x86.bOpCode == 0xB7
    17541754        &&  (pDis->uCpuMode == DISCPUMODE_16BIT) != !!(fPrefixes & DISPREFIX_OPSIZE))
    17551755        return true;
     
    17581758     * YASM doesn't do ICEBP/INT1/INT01, unlike NASM.
    17591759     */
    1760     if (pDis->arch.x86.bOpCode == 0xF1)
     1760    if (pDis->x86.bOpCode == 0xF1)
    17611761        return true;
    17621762
  • trunk/src/VBox/Disassembler/DisasmInternal.h

    r99241 r101539  
    4545 */
    4646
    47 /** This must be less or equal to DISSTATE::u.abInstr.
     47/** This must be less or equal to DISSTATE::Instr.ab.
    4848 * See Vol3A/Table 6-2 and Vol3B/Section22.25 for instance.  */
    4949#define DIS_MAX_INSTR_LENGTH    15
     
    103103    if (offInstr >= pDis->cbCachedInstr)
    104104        return disReadByteSlow(pDis, offInstr);
    105     return pDis->u.abInstr[offInstr];
     105    return pDis->Instr.ab[offInstr];
    106106}
    107107
     
    121121
    122122#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    123     return *(uint16_t const *)&pDis->u.abInstr[offInstr];
    124 #else
    125     return RT_MAKE_U16(pDis->u.abInstr[offInstr], pDis->u.abInstr[offInstr + 1]);
     123    return *(uint16_t const *)&pDis->Instr.ab[offInstr];
     124#else
     125    return RT_MAKE_U16(pDis->Instr.ab[offInstr], pDis->Instr.ab[offInstr + 1]);
    126126#endif
    127127}
     
    142142
    143143#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    144     return *(uint32_t const *)&pDis->u.abInstr[offInstr];
    145 #else
    146     return RT_MAKE_U32_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    147                                pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3]);
     144    return *(uint32_t const *)&pDis->Instr.ab[offInstr];
     145#else
     146    return RT_MAKE_U32_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     147                               pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3]);
    148148#endif
    149149}
     
    163163
    164164#ifdef DIS_HOST_UNALIGNED_ACCESS_OK
    165     return *(uint64_t const *)&pDis->u.abInstr[offInstr];
    166 #else
    167     return RT_MAKE_U64_FROM_U8(pDis->u.abInstr[offInstr    ], pDis->u.abInstr[offInstr + 1],
    168                                pDis->u.abInstr[offInstr + 2], pDis->u.abInstr[offInstr + 3],
    169                                pDis->u.abInstr[offInstr + 4], pDis->u.abInstr[offInstr + 5],
    170                                pDis->u.abInstr[offInstr + 6], pDis->u.abInstr[offInstr + 7]);
     165    return *(uint64_t const *)&pDis->Instr.ab[offInstr];
     166#else
     167    return RT_MAKE_U64_FROM_U8(pDis->Instr.ab[offInstr    ], pDis->Instr.ab[offInstr + 1],
     168                               pDis->Instr.ab[offInstr + 2], pDis->Instr.ab[offInstr + 3],
     169                               pDis->Instr.ab[offInstr + 4], pDis->Instr.ab[offInstr + 5],
     170                               pDis->Instr.ab[offInstr + 6], pDis->Instr.ab[offInstr + 7]);
    171171#endif
    172172}
     
    189189     * the cache here.)
    190190     */
    191     int rc = pDis->pfnReadBytes(pDis, 0, 1, sizeof(pDis->u.abInstr));
     191    int rc = pDis->pfnReadBytes(pDis, 0, 1, sizeof(pDis->Instr.ab));
    192192    if (RT_SUCCESS(rc))
    193193    {
    194194        Assert(pDis->cbCachedInstr >= 1);
    195         Assert(pDis->cbCachedInstr <= sizeof(pDis->u.abInstr));
     195        Assert(pDis->cbCachedInstr <= sizeof(pDis->Instr.ab));
    196196    }
    197197    else
     
    204204
    205205#if defined(VBOX_DIS_WITH_X86_AMD64)
    206 /* x86/amd64 */
    207206DECLHIDDEN(PCDISOPCODE) disInitializeStateX86(PDISSTATE pDis, DISCPUMODE enmCpuMode, uint32_t fFilter);
    208207DECLHIDDEN(int)         disInstrWorkerX86(PDISSTATE pDis, PCDISOPCODE paOneByteMap, uint32_t *pcbInstr);
    209208#endif
    210209#if defined(VBOX_DIS_WITH_ARMV8)
    211 /* x86/amd64 */
    212210DECLHIDDEN(PCDISOPCODE) disInitializeStateArmV8(PDISSTATE pDis, DISCPUMODE enmCpuMode, uint32_t fFilter);
    213211DECLHIDDEN(int)         disInstrWorkerArmV8(PDISSTATE pDis, PCDISOPCODE paOneByteMap, uint32_t *pcbInstr);
  • trunk/src/VBox/Disassembler/DisasmMisc.cpp

    r99220 r101539  
    4444DISDECL(uint8_t) DISGetParamSize(PCDISSTATE pDis, PCDISOPPARAM pParam)
    4545{
    46     unsigned subtype = OP_PARM_VSUBTYPE(pParam->arch.x86.fParam);
     46    unsigned subtype = OP_PARM_VSUBTYPE(pParam->x86.fParam);
    4747    switch (subtype)
    4848    {
    4949        case OP_PARM_v:
    50             switch (pDis->arch.x86.uOpMode)
     50            switch (pDis->x86.uOpMode)
    5151            {
    5252                case DISCPUMODE_32BIT:
     
    8787
    8888        case OP_PARM_p: /* far pointer */
    89             if (pDis->arch.x86.uAddrMode == DISCPUMODE_32BIT)
     89            if (pDis->x86.uAddrMode == DISCPUMODE_32BIT)
    9090                return 6;   /* 16:32 */
    91             if (pDis->arch.x86.uAddrMode == DISCPUMODE_64BIT)
     91            if (pDis->x86.uAddrMode == DISCPUMODE_64BIT)
    9292                return 12;  /* 16:64 */
    9393            return 4;       /* 16:16 */
     
    9797
    9898        case OP_PARM_a:
    99             return pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? 2 + 2 : 4 + 4;
     99            return pDis->x86.uOpMode == DISCPUMODE_16BIT ? 2 + 2 : 4 + 4;
    100100
    101101        case OP_PARM_pi:
     
    109109        case OP_PARM_pd:
    110110        case OP_PARM_ps:
    111             return VEXREG_IS256B(pDis->arch.x86.bVexDestReg) ? 32 : 16; //??
     111            return VEXREG_IS256B(pDis->x86.bVexDestReg) ? 32 : 16; //??
    112112
    113113        case OP_PARM_y:
    114             return pDis->arch.x86.uOpMode == DISCPUMODE_64BIT ? 4 : 8;  //??
     114            return pDis->x86.uOpMode == DISCPUMODE_64BIT ? 4 : 8;  //??
    115115
    116116        case OP_PARM_z:
    117             if (pParam->arch.x86.cb)
    118                 return pParam->arch.x86.cb;
    119             return pDis->arch.x86.uOpMode == DISCPUMODE_16BIT ? 2 : 4;  //??
     117            if (pParam->x86.cb)
     118                return pParam->x86.cb;
     119            return pDis->x86.uOpMode == DISCPUMODE_16BIT ? 2 : 4;  //??
    120120
    121121        default:
    122             if (pParam->arch.x86.cb)
    123                 return pParam->arch.x86.cb;
     122            if (pParam->x86.cb)
     123                return pParam->x86.cb;
    124124            /// @todo dangerous!!!
    125             AssertMsgFailed(("subtype=%#x fParam=%#x fUse=%#RX64 op=%#x\n", subtype, pParam->arch.x86.fParam, pParam->fUse,
     125            AssertMsgFailed(("subtype=%#x fParam=%#x fUse=%#RX64 op=%#x\n", subtype, pParam->x86.fParam, pParam->fUse,
    126126                             pDis->pCurInstr ? pDis->pCurInstr->uOpcode : 0));
    127127            return 4;
     
    132132DISDECL(DISSELREG) DISDetectSegReg(PCDISSTATE pDis, PCDISOPPARAM pParam)
    133133{
    134     if (pDis->arch.x86.fPrefix & DISPREFIX_SEG)
     134    if (pDis->x86.fPrefix & DISPREFIX_SEG)
    135135        /* Use specified SEG: prefix. */
    136         return (DISSELREG)pDis->arch.x86.idxSegPrefix;
     136        return (DISSELREG)pDis->x86.idxSegPrefix;
    137137
    138138    /* Guess segment register by parameter type. */
     
    143143        AssertCompile(DISGREG_ESP == DISGREG_SP);
    144144        AssertCompile(DISGREG_EBP == DISGREG_BP);
    145         if (pParam->arch.x86.Base.idxGenReg == DISGREG_ESP || pParam->arch.x86.Base.idxGenReg == DISGREG_EBP)
     145        if (pParam->x86.Base.idxGenReg == DISGREG_ESP || pParam->x86.Base.idxGenReg == DISGREG_EBP)
    146146            return DISSELREG_SS;
    147147    }
     
    153153DISDECL(uint8_t) DISQuerySegPrefixByte(PCDISSTATE pDis)
    154154{
    155     Assert(pDis->arch.x86.fPrefix & DISPREFIX_SEG);
    156     switch (pDis->arch.x86.idxSegPrefix)
     155    Assert(pDis->x86.fPrefix & DISPREFIX_SEG);
     156    switch (pDis->x86.idxSegPrefix)
    157157    {
    158158    case DISSELREG_ES:
  • trunk/src/VBox/Disassembler/Makefile.kmk

    r100046 r101539  
    3737LIBRARIES              += DisasmR3
    3838DisasmR3_TEMPLATE       = VBoxR3Dll
    39 DisasmR3_DEFS           = IN_DIS VBOX_DIS_WITH_X86_AMD64
     39DisasmR3_DEFS           = IN_DIS
    4040DisasmR3_SOURCES        = \
    4141        Disasm.cpp \
     42        DisasmMisc.cpp \
     43        DisasmFormatBytes.cpp
     44if 1
     45 DisasmR3_DEFS         += VBOX_DIS_WITH_X86_AMD64
     46 DisasmR3_SOURCES      += \
    4247        DisasmCore-x86-amd64.cpp \
    4348        DisasmTables-x86-amd64.cpp \
    4449        DisasmTablesX64.cpp \
    45         DisasmMisc.cpp \
    46         DisasmFormatBytes.cpp \
    4750        DisasmFormatYasm.cpp
     51endif
     52if 1
     53 DisasmR3_DEFS          += VBOX_DIS_WITH_ARMV8
     54 DisasmR3_SOURCES       += \
     55        DisasmCore-armv8.cpp \
     56        DisasmTables-armv8-a64.cpp \
     57        DisasmFormatArmV8.cpp
     58endif
    4859
    4960LIBRARIES              += DisasmR3Static
    5061DisasmR3Static_TEMPLATE = VBoxR3Static
    5162DisasmR3Static_EXTENDS  = DisasmR3
    52 
    53 ifdef VBOX_WITH_VIRT_ARMV8
    54  LIBRARIES              += DisasmR3-armv8
    55  DisasmR3-armv8_TEMPLATE       = VBoxR3Dll
    56  DisasmR3-armv8_DEFS           = IN_DIS VBOX_DIS_WITH_ARMV8
    57  DisasmR3-armv8_SOURCES        = \
    58         Disasm.cpp \
    59         DisasmCore-armv8.cpp \
    60         DisasmTables-armv8-a64.cpp \
    61         DisasmFormatBytes.cpp \
    62         DisasmFormatArmV8.cpp
    63 endif
    6463
    6564ifndef VBOX_ONLY_VALIDATIONKIT
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-1.cpp

    r99775 r101539  
    8989        DISSTATE        DisOnly;
    9090        rc = DISInstrWithPrefetchedBytes((uintptr_t)&pabInstrs[off], enmDisCpuMode,  0 /*fFilter - none */,
    91                                          Dis.u.abInstr, Dis.cbCachedInstr, NULL, NULL, &DisOnly, &cbOnly);
     91                                         Dis.Instr.ab, Dis.cbCachedInstr, NULL, NULL, &DisOnly, &cbOnly);
    9292
    9393        RTTESTI_CHECK_RC(rc, VINF_SUCCESS);
     
    109109{
    110110    RT_NOREF1(cbMinRead);
    111     memcpy(&pDis->u.abInstr[offInstr], (void *)((uintptr_t)pDis->uInstrAddr + offInstr), cbMaxRead);
     111    memcpy(&pDis->Instr.ab[offInstr], (void *)((uintptr_t)pDis->uInstrAddr + offInstr), cbMaxRead);
    112112    pDis->cbCachedInstr = offInstr + cbMaxRead;
    113113    return VINF_SUCCESS;
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp

    r99220 r101539  
    149149        case OP_MOV_DR:
    150150        case OP_MOV_TR:
    151             if (pDis->arch.x86.ModRM.Bits.Mod != 3)
     151            if (pDis->x86.ModRM.Bits.Mod != 3)
    152152                return false;
    153153            break;
     
    155155         /* The 0x8f /0 variant of this instruction doesn't get its /r value verified. */
    156156        case OP_POP:
    157             if (    pDis->arch.x86.bOpCode == 0x8f
    158                 &&  pDis->arch.x86.ModRM.Bits.Reg != 0)
     157            if (    pDis->x86.bOpCode == 0x8f
     158                &&  pDis->x86.ModRM.Bits.Reg != 0)
    159159                return false;
    160160            break;
     
    162162        /* The 0xc6 /0 and 0xc7 /0 variants of this instruction don't get their /r values verified. */
    163163        case OP_MOV:
    164             if (    (   pDis->arch.x86.bOpCode == 0xc6
    165                      || pDis->arch.x86.bOpCode == 0xc7)
    166                 &&  pDis->arch.x86.ModRM.Bits.Reg != 0)
     164            if (    (   pDis->x86.bOpCode == 0xc6
     165                     || pDis->x86.bOpCode == 0xc7)
     166                &&  pDis->x86.ModRM.Bits.Reg != 0)
    167167                return false;
    168168            break;
     
    192192        //size_t cbToRead    = cbMaxRead;
    193193        size_t cbToRead    = cbMinRead;
    194         memcpy(&pState->Dis.u.abInstr[offInstr], pState->pbNext, cbToRead);
     194        memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, cbToRead);
    195195        pState->Dis.cbCachedInstr = offInstr + (uint8_t)cbToRead;
    196196        pState->pbNext    += cbToRead;
     
    207207        if (pState->cbLeft > 0)
    208208        {
    209             memcpy(&pState->Dis.u.abInstr[offInstr], pState->pbNext, pState->cbLeft);
     209            memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, pState->cbLeft);
    210210            offInstr          += (uint8_t)pState->cbLeft;
    211211            cbMinRead         -= (uint8_t)pState->cbLeft;
     
    214214            pState->cbLeft     = 0;
    215215        }
    216         memset(&pState->Dis.u.abInstr[offInstr], 0xcc, cbMinRead);
     216        memset(&pState->Dis.Instr.ab[offInstr], 0xcc, cbMinRead);
    217217        pState->rc = VERR_EOF;
    218218    }
     
    223223         */
    224224        RTStrmPrintf(g_pStdErr, "Reading before current instruction!\n");
    225         memset(&pState->Dis.u.abInstr[offInstr], 0x90, cbMinRead);
     225        memset(&pState->Dis.Instr.ab[offInstr], 0x90, cbMinRead);
    226226        pState->rc = VERR_INTERNAL_ERROR;
    227227    }
     
    316316                if (!State.cbInstr)
    317317                {
    318                     State.Dis.u.abInstr[0] = 0;
     318                    State.Dis.Instr.ab[0] = 0;
    319319                    State.Dis.pfnReadBytes(&State.Dis, 0, 1, 1);
    320320                    State.cbInstr = 1;
     
    322322                RTPrintf("    db");
    323323                for (unsigned off = 0; off < State.cbInstr; off++)
    324                     RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[off]);
     324                    RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.Instr.ab[off]);
    325325                RTPrintf("    ; %s\n", State.szLine);
    326326            }
     
    345345                    RTPrintf("    db");
    346346                    for (unsigned off = 0; off < State.cbInstr; off++)
    347                         RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[off]);
     347                        RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.Instr.ab[off]);
    348348                    RTPrintf(" ; ");
    349349                }
     
    376376        {
    377377            uint32_t cbInstrOnly = 32;
    378             uint8_t  abInstr[sizeof(State.Dis.u.abInstr)];
    379             memcpy(abInstr, State.Dis.u.abInstr, sizeof(State.Dis.u.abInstr));
     378            uint8_t  abInstr[sizeof(State.Dis.Instr.ab)];
     379            memcpy(abInstr, State.Dis.Instr.ab, sizeof(State.Dis.Instr.ab));
    380380            int rcOnly = DISInstrWithPrefetchedBytes(State.uAddress, enmCpuMode, 0 /*fFilter - none */,
    381381                                                     abInstr, State.Dis.cbCachedInstr, MyDisasInstrRead, &State,
  • trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp

    r99227 r101539  
    165165    RT_NOREF1(cbMaxRead);
    166166    uint8_t const *pbSrc = (uint8_t const *)((uintptr_t)pDis->uInstrAddr + (uintptr_t)pDis->pvUser + offInstr);
    167     memcpy(&pDis->u.abInstr[offInstr], pbSrc, cbMinRead);
     167    memcpy(&pDis->Instr.ab[offInstr], pbSrc, cbMinRead);
    168168    pDis->cbCachedInstr = offInstr + cbMinRead;
    169169    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp

    r99775 r101539  
    9797    if (cb + pDis->uInstrAddr + offInstr > sizeof(g_ab32BitCode))
    9898        cb = cbMinRead;
    99     memcpy(&pDis->u.abInstr[offInstr], &g_ab32BitCode[pDis->uInstrAddr + offInstr], cb);
     99    memcpy(&pDis->Instr.ab[offInstr], &g_ab32BitCode[pDis->uInstrAddr + offInstr], cb);
    100100    pDis->cbCachedInstr = offInstr + (uint8_t)cb;
    101101    return VINF_SUCCESS;
     
    112112    *pcb = cb;
    113113    MY_PRINTF(("DISCoreOneEx -> rc=%d cb=%d  Cpu: bOpCode=%#x pCurInstr=%p (42=%d)\n", \
    114                rc, cb, pDis->arch.x86.bOpCode, pDis->pCurInstr, 42)); \
     114               rc, cb, pDis->x86.bOpCode, pDis->pCurInstr, 42)); \
    115115    return rc;
    116116}
  • trunk/src/VBox/VMM/Makefile.kmk

    r101307 r101539  
    486486
    487487 VBoxVMMArm_LIBS = \
    488         $(PATH_STAGE_LIB)/DisasmR3-armv8$(VBOX_SUFF_LIB)
     488        $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
    489489 ifdef VBOX_WITH_DEBUGGER
    490490  VBoxVMMArm_LIBS += \
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r99220 r101539  
    867867        cbToRead = cbMinRead;
    868868
    869     int rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->u.abInstr[offInstr], uSrcAddr, cbToRead);
     869    int rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->Instr.ab[offInstr], uSrcAddr, cbToRead);
    870870    if (RT_FAILURE(rc))
    871871    {
     
    873873        {
    874874            cbToRead = cbMinRead;
    875             rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->u.abInstr[offInstr], uSrcAddr, cbToRead);
     875            rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->Instr.ab[offInstr], uSrcAddr, cbToRead);
    876876        }
    877877        if (RT_FAILURE(rc))
     
    10201020    LogFlow(("EMInterpretInstructionDisasState %RGv\n", (RTGCPTR)rip));
    10211021
    1022     VBOXSTRICTRC rc = IEMExecOneBypassWithPrefetchedByPC(pVCpu, rip, pDis->u.abInstr, pDis->cbCachedInstr);
     1022    VBOXSTRICTRC rc = IEMExecOneBypassWithPrefetchedByPC(pVCpu, rip, pDis->Instr.ab, pDis->cbCachedInstr);
    10231023    if (RT_UNLIKELY(   rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED
    10241024                    || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED))
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r101538 r101539  
    5151#include <VBox/vmm/iem.h>
    5252#include <VBox/vmm/cpum.h>
     53#include <VBox/vmm/dbgf.h>
    5354#include "IEMInternal.h"
    5455#include <VBox/vmm/vmcc.h>
    5556#include <VBox/log.h>
    5657#include <VBox/err.h>
     58#include <VBox/dis.h>
    5759#include <VBox/param.h>
    5860#include <iprt/assert.h>
     
    39773979
    39783980
     3981/** @callback_method_impl{FNDISREADBYTES, Dummy.} */
     3982static DECLCALLBACK(int) iemNativeDisasReadBytesDummy(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
     3983{
     3984    RT_BZERO(&pDis->Instr.ab[offInstr], cbMaxRead);
     3985    pDis->cbCachedInstr += cbMaxRead;
     3986    RT_NOREF(cbMinRead);
     3987    return VERR_NO_DATA;
     3988}
     3989
     3990
     3991
     3992void iemNativeDisassembleTb(PCIEMTB pTb, PCDBGFINFOHLP pHlp)
     3993{
     3994    AssertReturnVoid((pTb->fFlags & IEMTB_F_TYPE_MASK) == IEMTB_F_TYPE_NATIVE);
     3995
     3996    char                    szDisBuf[512];
     3997    DISSTATE                Dis;
     3998    PCIEMNATIVEINSTR const  paInstrs      = pTb->Native.paInstructions;
     3999    uint32_t const          cInstrs       = pTb->Native.cInstructions;
     4000    PCIEMTBDBG const        pDbgInfo      = pTb->pDbgInfo;
     4001    DISCPUMODE              enmGstCpuMode = (pTb->fFlags & IEM_F_MODE_CPUMODE_MASK) == IEMMODE_16BIT ? DISCPUMODE_16BIT
     4002                                          : (pTb->fFlags & IEM_F_MODE_CPUMODE_MASK) == IEMMODE_32BIT ? DISCPUMODE_32BIT
     4003                                          :                                                            DISCPUMODE_64BIT;
     4004#ifdef RT_ARCH_AMD64
     4005    DISCPUMODE const        enmHstCpuMode = DISCPUMODE_64BIT;
     4006#elif defined(RT_ARCH_ARM64)
     4007    DISCPUMODE const        enmHstCpuMode = DISCPUMODE_ARMV8_A64;
     4008#else
     4009# error "Port me"
     4010#endif
     4011
     4012    pHlp->pfnPrintf(pHlp,
     4013                    "pTb=%p: GCPhysPc=%RGp cInstructions=%u LB %#x cRanges=%u\n"
     4014                    "pTb=%p: fFlags=%#010x cUsed=%u msLastUsed=%u\n",
     4015                    pTb, pTb->GCPhysPc, pTb->cInstructions, pTb->cbOpcodes, pTb->cRanges,
     4016                    pTb, pTb->fFlags, pTb->cUsed, pTb->msLastUsed);
     4017    if (pDbgInfo)
     4018    {
     4019
     4020
     4021    }
     4022    else
     4023    {
     4024        /*
     4025         * No debug info, just disassemble the x86 code and then the native code.
     4026         */
     4027        /* The guest code. */
     4028        for (unsigned i = 0; i < pTb->cRanges; i++)
     4029        {
     4030            RTGCPHYS GCPhysPc = pTb->aRanges[i].offPhysPage
     4031                              + (pTb->aRanges[i].idxPhysPage == 0
     4032                                 ? pTb->GCPhysPc & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK
     4033                                 : pTb->aGCPhysPages[pTb->aRanges[i].idxPhysPage - 1]);
     4034            pHlp->pfnPrintf(pHlp, "  Range #%u: GCPhysPc=%RGp LB %#x [idxPg=%d]\n",
     4035                            i, GCPhysPc, pTb->aRanges[i].cbOpcodes, pTb->aRanges[i].idxPhysPage);
     4036            unsigned       off       = pTb->aRanges[i].offOpcodes;
     4037            unsigned const cbOpcodes = pTb->aRanges[i].cbOpcodes + off;
     4038            while (off < cbOpcodes)
     4039            {
     4040                uint32_t cbInstr = 1;
     4041                int rc = DISInstrWithPrefetchedBytes(GCPhysPc, enmGstCpuMode, DISOPTYPE_ALL,
     4042                                                     &pTb->pabOpcodes[off], cbOpcodes - off,
     4043                                                     iemNativeDisasReadBytesDummy, NULL, &Dis, &cbInstr);
     4044                if (RT_SUCCESS(rc))
     4045                {
     4046                    DISFormatYasmEx(&Dis, szDisBuf, sizeof(szDisBuf),
     4047                                    DIS_FMT_FLAGS_BYTES_LEFT | DIS_FMT_FLAGS_RELATIVE_BRANCH,
     4048                                    NULL /*pfnGetSymbol*/, NULL /*pvUser*/);
     4049                    pHlp->pfnPrintf(pHlp, "    %s\n", szDisBuf);
     4050                    off += cbInstr;
     4051                }
     4052                else
     4053                {
     4054                    pHlp->pfnPrintf(pHlp, "    %.*Rhxs - disassembly failure %Rrc\n",
     4055                                    cbOpcodes - off, &pTb->pabOpcodes[off], rc);
     4056                    break;
     4057                }
     4058            }
     4059        }
     4060
     4061        /* The native code: */
     4062        pHlp->pfnPrintf(pHlp, "  Native code %p L %#x\n", paInstrs, cInstrs);
     4063        for (uint32_t offNative = 0; offNative < cInstrs; )
     4064        {
     4065            uint32_t  cbInstr = sizeof(paInstrs[0]);
     4066            int const rc      = DISInstr(&paInstrs[offNative], enmHstCpuMode, &Dis, &cbInstr);
     4067            if (RT_SUCCESS(rc))
     4068            {
     4069# if defined(RT_ARCH_AMD64) && 0
     4070                if (Dis.pCurInstr->uOpcode == )
     4071                {
     4072                }
     4073                else
     4074# endif
     4075                {
     4076                    DISFormatYasmEx(&Dis, szDisBuf, sizeof(szDisBuf),
     4077                                    DIS_FMT_FLAGS_BYTES_LEFT | DIS_FMT_FLAGS_RELATIVE_BRANCH,
     4078                                    NULL /*pfnGetSymbol*/, NULL /*pvUser*/);
     4079                    pHlp->pfnPrintf(pHlp, "    %p: %s\n", &paInstrs[offNative], szDisBuf);
     4080                }
     4081            }
     4082            else
     4083            {
     4084# if defined(RT_ARCH_AMD64)
     4085                pHlp->pfnPrintf(pHlp, "    %p:  %.*Rhxs - disassembly failure %Rrc\n",
     4086                                &paInstrs[offNative], RT_MIN(cInstrs - offNative, 16), &paInstrs[offNative], rc);
     4087# elif defined(RT_ARCH_ARM64)
     4088                pHlp->pfnPrintf(pHlp, "    %p:  %#010RX32 - disassembly failure %Rrc\n",
     4089                                &paInstrs[offNative], paInstrs[offNative], rc);
     4090# else
     4091#  error "Port me"
     4092#endif
     4093                cbInstr = sizeof(paInstrs[0]);
     4094            }
     4095            offNative += cbInstr / sizeof(paInstrs[0]);
     4096        }
     4097    }
     4098}
     4099
     4100
    39794101/**
    39804102 * Recompiles the given threaded TB into a native one.
     
    41054227
    41064228    iemExecMemAllocatorReadyForUse(pVCpu, paFinalInstrBuf, off * sizeof(IEMNATIVEINSTR));
    4107 #ifdef LOG_ENABLED
    4108     if (LogIs3Enabled())
    4109     {
    4110 
    4111     }
    4112 #endif
    41134229
    41144230    /*
     
    41264242    Assert(pTbAllocator->cNativeTbs <= pTbAllocator->cTotalTbs);
    41274243
     4244#ifdef LOG_ENABLED
     4245    /*
     4246     * Disassemble to the log if enabled.
     4247     */
     4248    if (LogIs3Enabled())
     4249        iemNativeDisassembleTb(pTb, DBGFR3InfoLogHlp());
     4250#endif
     4251
    41284252    return pTb;
    41294253}
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r100966 r101539  
    227227            if (     RT_SUCCESS(rc)
    228228                &&   pDis->uCpuMode == DISCPUMODE_32BIT  /** @todo why does this matter? */
    229                 &&  !(pDis->arch.x86.fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP | DISPREFIX_SEG)))
     229                &&  !(pDis->x86.fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP | DISPREFIX_SEG)))
    230230            {
    231                 switch (pDis->arch.x86.bOpCode)
     231                switch (pDis->x86.bOpCode)
    232232                {
    233233                    /** @todo Find other instructions we can safely skip, possibly
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r100964 r101539  
    792792    }
    793793
    794     LogFlow(("Reused instr %RGv %d at %RGv param1.fUse=%llx param1.reg=%d\n", pCtx->rip, pDis->pCurInstr->uOpcode, pvFault, pDis->Param1.fUse,  pDis->Param1.arch.x86.Base.idxGenReg));
     794    LogFlow(("Reused instr %RGv %d at %RGv param1.fUse=%llx param1.reg=%d\n", pCtx->rip, pDis->pCurInstr->uOpcode, pvFault, pDis->Param1.fUse,  pDis->Param1.x86.Base.idxGenReg));
    795795
    796796    /* Non-supervisor mode write means it's used for something else. */
     
    824824        case OP_MOVSWD:
    825825        case OP_STOSWD:
    826             if (    pDis->arch.x86.fPrefix == (DISPREFIX_REP|DISPREFIX_REX)
     826            if (    pDis->x86.fPrefix == (DISPREFIX_REP|DISPREFIX_REX)
    827827                &&  pCtx->rcx >= 0x40
    828828               )
     
    841841            if (    (    (pDis->Param1.fUse & DISUSE_REG_GEN32)
    842842                     ||  (pDis->Param1.fUse & DISUSE_REG_GEN64))
    843                 &&  (pDis->Param1.arch.x86.Base.idxGenReg == DISGREG_ESP))
     843                &&  (pDis->Param1.x86.Base.idxGenReg == DISGREG_ESP))
    844844            {
    845845                Log4(("pgmRZPoolMonitorIsReused: ESP\n"));
     
    941941                                              PCPUMCTX pCtx, RTGCPHYS GCPhysFault, RTGCPTR pvFault)
    942942{
    943     unsigned uIncrement = pDis->Param1.arch.x86.cb;
     943    unsigned uIncrement = pDis->Param1.x86.cb;
    944944    NOREF(pVM);
    945945
     
    948948
    949949# ifdef VBOX_STRICT
    950     if (pDis->arch.x86.uOpMode == DISCPUMODE_32BIT)
     950    if (pDis->x86.uOpMode == DISCPUMODE_32BIT)
    951951        Assert(uIncrement == 4);
    952952    else
     
    11861186    if (    pPage->GCPtrLastAccessHandlerRip >= pCtx->rip - 0x40      /* observed loops in Windows 7 x64 */
    11871187        &&  pPage->GCPtrLastAccessHandlerRip <  pCtx->rip + 0x40
    1188         &&  pvFault == (pPage->GCPtrLastAccessHandlerFault + pDis->Param1.arch.x86.cb)
     1188        &&  pvFault == (pPage->GCPtrLastAccessHandlerFault + pDis->Param1.x86.cb)
    11891189        &&  pVCpu->pgm.s.cPoolAccessHandler == pPage->cLastAccessHandler + 1)
    11901190    {
     
    12181218         * Simple instructions, no REP prefix.
    12191219         */
    1220         if (!(pDis->arch.x86.fPrefix & (DISPREFIX_REP | DISPREFIX_REPNE)))
     1220        if (!(pDis->x86.fPrefix & (DISPREFIX_REP | DISPREFIX_REPNE)))
    12211221        {
    12221222            rc = pgmRZPoolAccessPfHandlerSimple(pVM, pVCpu, pPool, pPage, pDis, pCtx, GCPhysFault, &fReused);
     
    12611261        if (    pDis->pCurInstr->uOpcode == OP_STOSWD
    12621262            &&  !pCtx->eflags.Bits.u1DF
    1263             &&  pDis->arch.x86.uOpMode == pDis->uCpuMode
    1264             &&  pDis->arch.x86.uAddrMode == pDis->uCpuMode)
     1263            &&  pDis->x86.uOpMode == pDis->uCpuMode
     1264            &&  pDis->x86.uAddrMode == pDis->uCpuMode)
    12651265        {
    12661266            bool fValidStosd = false;
    12671267
    12681268            if (    pDis->uCpuMode == DISCPUMODE_32BIT
    1269                 &&  pDis->arch.x86.fPrefix == DISPREFIX_REP
     1269                &&  pDis->x86.fPrefix == DISPREFIX_REP
    12701270                &&  pCtx->ecx <= 0x20
    12711271                &&  pCtx->ecx * 4 <= GUEST_PAGE_SIZE - ((uintptr_t)pvFault & GUEST_PAGE_OFFSET_MASK)
     
    12791279            else
    12801280            if (    pDis->uCpuMode == DISCPUMODE_64BIT
    1281                 &&  pDis->arch.x86.fPrefix == (DISPREFIX_REP | DISPREFIX_REX)
     1281                &&  pDis->x86.fPrefix == (DISPREFIX_REP | DISPREFIX_REX)
    12821282                &&  pCtx->rcx <= 0x20
    12831283                &&  pCtx->rcx * 8 <= GUEST_PAGE_SIZE - ((uintptr_t)pvFault & GUEST_PAGE_OFFSET_MASK)
     
    13011301        STAM_COUNTER_INC(&pPool->StatMonitorPfRZRepPrefix);
    13021302        Log4(("pgmRZPoolAccessPfHandler: eax=%#x ecx=%#x edi=%#x esi=%#x rip=%RGv opcode=%d prefix=%#x\n",
    1303               pCtx->eax, pCtx->ecx, pCtx->edi, pCtx->esi, (RTGCPTR)pCtx->rip, pDis->pCurInstr->uOpcode, pDis->arch.x86.fPrefix));
     1303              pCtx->eax, pCtx->ecx, pCtx->edi, pCtx->esi, (RTGCPTR)pCtx->rip, pDis->pCurInstr->uOpcode, pDis->x86.fPrefix));
    13041304        fNotReusedNotForking = true;
    13051305    }
  • trunk/src/VBox/VMM/VMMR3/CPUM-armv8.cpp

    r101190 r101539  
    2929 *
    3030 * The CPU Monitor / Manager keeps track of all the CPU registers.
    31  * This is the ARMv8 variant which is doing much less than its x86/amd64
     31 * This is the ARMv8 variant which is doing much less than its x86/AMD6464
    3232 * counterpart due to the fact that we currently only support the NEM backends
    3333 * for running ARM guests. It might become complex iff we decide to implement our
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r101323 r101539  
    44744474         * Read and advance or exit.
    44754475         */
    4476         memcpy(&pDis->u.abInstr[offInstr], (uint8_t *)pState->pvPageR3 + (GCPtr & GUEST_PAGE_OFFSET_MASK), cb);
     4476        memcpy(&pDis->Instr.ab[offInstr], (uint8_t *)pState->pvPageR3 + (GCPtr & GUEST_PAGE_OFFSET_MASK), cb);
    44774477        offInstr  += (uint8_t)cb;
    44784478        if (cb >= cbMinRead)
  • trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp

    r100108 r101539  
    271271         * Read and advance,
    272272         */
    273         memcpy(&pDis->u.abInstr[offInstr], (char *)pState->pvPageR3 + (GCPtr & GUEST_PAGE_OFFSET_MASK), cb);
     273        memcpy(&pDis->Instr.ab[offInstr], (char *)pState->pvPageR3 + (GCPtr & GUEST_PAGE_OFFSET_MASK), cb);
    274274        offInstr  += (uint8_t)cb;
    275275        if (cb >= cbMinRead)
     
    521521    {
    522522        if (State.Dis.cbCachedInstr)
    523             RTStrPrintf(pszOutput, cbOutput, "Disas -> %Rrc; %.*Rhxs\n", rc, (size_t)State.Dis.cbCachedInstr, State.Dis.u.abInstr);
     523            RTStrPrintf(pszOutput, cbOutput, "Disas -> %Rrc; %.*Rhxs\n", rc, (size_t)State.Dis.cbCachedInstr, State.Dis.Instr.ab);
    524524        else
    525525            RTStrPrintf(pszOutput, cbOutput, "Disas -> %Rrc\n", rc);
     
    564564    {
    565565        uint32_t        cbInstr  = State.Dis.cbInstr;
    566         uint8_t const  *pabInstr = State.Dis.u.abInstr;
     566        uint8_t const  *pabInstr = State.Dis.Instr.ab;
    567567        if (fFlags & DBGF_DISAS_FLAGS_NO_ADDRESS)
    568568            cch = RTStrPrintf(pszOutput, cbOutput, "%.*Rhxs%*s %s",
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Flow.cpp

    r99739 r101539  
    788788            if (   DisState.pCurInstr->uOpcode == OP_MOV
    789789                && (DisState.Param1.fUse & (DISUSE_REG_GEN16 | DISUSE_REG_GEN32 | DISUSE_REG_GEN64))
    790                 && DisState.Param1.arch.x86.Base.idxGenReg == idxRegTgt
     790                && DisState.Param1.x86.Base.idxGenReg == idxRegTgt
    791791                /*&& DisState.Param1.cb == cbPtr*/
    792                 && DisState.Param2.arch.x86.cb == cbPtr
     792                && DisState.Param2.x86.cb == cbPtr
    793793                && (DisState.Param2.fUse & (DISUSE_IMMEDIATE16 | DISUSE_IMMEDIATE32 | DISUSE_IMMEDIATE64)))
    794794            {
     
    997997    if (pDisParam->fUse & DISUSE_BASE)
    998998    {
    999         uint8_t idxRegBase = pDisParam->arch.x86.Base.idxGenReg;
     999        uint8_t idxRegBase = pDisParam->x86.Base.idxGenReg;
    10001000
    10011001        /* Check that the used register size and the pointer size match. */
     
    10841084    if (pDisParam->fUse & DISUSE_BASE)
    10851085    {
    1086         uint8_t idxRegBase = pDisParam->arch.x86.Base.idxGenReg;
     1086        uint8_t idxRegBase = pDisParam->x86.Base.idxGenReg;
    10871087
    10881088        /* Check that the used register size and the pointer size match. */
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r101428 r101539  
    23412341            {
    23422342                pPatch->enmType     = HMTPRINSTR_WRITE_REG;
    2343                 pPatch->uSrcOperand = Dis.Param2.arch.x86.Base.idxGenReg;
    2344                 Log(("hmR3ReplaceTprInstr: HMTPRINSTR_WRITE_REG %u\n", Dis.Param2.arch.x86.Base.idxGenReg));
     2343                pPatch->uSrcOperand = Dis.Param2.x86.Base.idxGenReg;
     2344                Log(("hmR3ReplaceTprInstr: HMTPRINSTR_WRITE_REG %u\n", Dis.Param2.x86.Base.idxGenReg));
    23452345            }
    23462346            else
     
    23702370            Assert(Dis.Param1.fUse == DISUSE_REG_GEN32);
    23712371
    2372             uint8_t  const idxMmioReg = Dis.Param1.arch.x86.Base.idxGenReg;
     2372            uint8_t  const idxMmioReg = Dis.Param1.x86.Base.idxGenReg;
    23732373            uint8_t  const cbOpMmio   = cbOp;
    23742374            uint64_t const uSavedRip  = pCtx->rip;
     
    23822382                &&  Dis.pCurInstr->uOpcode == OP_SHR
    23832383                &&  Dis.Param1.fUse == DISUSE_REG_GEN32
    2384                 &&  Dis.Param1.arch.x86.Base.idxGenReg == idxMmioReg
     2384                &&  Dis.Param1.x86.Base.idxGenReg == idxMmioReg
    23852385                &&  Dis.Param2.fUse == DISUSE_IMMEDIATE8
    23862386                &&  Dis.Param2.uValue == 4
     
    24002400                abInstr[1] = 0x0f;
    24012401                abInstr[2] = 0x20;
    2402                 abInstr[3] = 0xc0 | Dis.Param1.arch.x86.Base.idxGenReg;
     2402                abInstr[3] = 0xc0 | Dis.Param1.x86.Base.idxGenReg;
    24032403                for (unsigned i = 4; i < pPatch->cbOp; i++)
    24042404                    abInstr[i] = 0x90;  /* nop */
     
    25322532             * jmp return_address            [E9 return_address]
    25332533             */
    2534             bool fUsesEax = (Dis.Param2.fUse == DISUSE_REG_GEN32 && Dis.Param2.arch.x86.Base.idxGenReg == DISGREG_EAX);
     2534            bool fUsesEax = (Dis.Param2.fUse == DISUSE_REG_GEN32 && Dis.Param2.x86.Base.idxGenReg == DISGREG_EAX);
    25352535
    25362536            aPatch[off++] = 0x51;    /* push ecx */
     
    25452545                {
    25462546                    aPatch[off++] = 0x89;    /* mov eax, src_reg */
    2547                     aPatch[off++] = MAKE_MODRM(3, Dis.Param2.arch.x86.Base.idxGenReg, DISGREG_EAX);
     2547                    aPatch[off++] = MAKE_MODRM(3, Dis.Param2.x86.Base.idxGenReg, DISGREG_EAX);
    25482548                }
    25492549            }
     
    25842584            Assert(Dis.Param1.fUse == DISUSE_REG_GEN32);
    25852585
    2586             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_ECX)
     2586            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_ECX)
    25872587                aPatch[off++] = 0x51;    /* push ecx */
    2588             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_EDX )
     2588            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_EDX )
    25892589                aPatch[off++] = 0x52;    /* push edx */
    2590             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_EAX)
     2590            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_EAX)
    25912591                aPatch[off++] = 0x50;    /* push eax */
    25922592
     
    26012601            aPatch[off++] = 0x32;
    26022602
    2603             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_EAX)
     2603            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_EAX)
    26042604            {
    26052605                aPatch[off++] = 0x89;    /* mov dst_reg, eax */
    2606                 aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, Dis.Param1.arch.x86.Base.idxGenReg);
     2606                aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, Dis.Param1.x86.Base.idxGenReg);
    26072607            }
    26082608
    2609             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_EAX)
     2609            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_EAX)
    26102610                aPatch[off++] = 0x58;    /* pop eax */
    2611             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_EDX )
     2611            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_EDX )
    26122612                aPatch[off++] = 0x5a;    /* pop edx */
    2613             if (Dis.Param1.arch.x86.Base.idxGenReg != DISGREG_ECX)
     2613            if (Dis.Param1.x86.Base.idxGenReg != DISGREG_ECX)
    26142614                aPatch[off++] = 0x59;    /* pop ecx */
    26152615        }
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r101538 r101539  
    814814/** Pointer to a native instruction unit. */
    815815typedef IEMNATIVEINSTR *PIEMNATIVEINSTR;
     816/** Pointer to a const native instruction unit. */
     817typedef IEMNATIVEINSTR const *PCIEMNATIVEINSTR;
    816818
    817819/**
     
    869871 * This will throw/longjmp on occation.  */
    870872typedef FNIEMTBNATIVE *PFNIEMTBNATIVE;
     873
     874
     875/**
     876 * Translation block debug info entry type.
     877 */
     878typedef enum IEMTBDBGENTRYTYPE
     879{
     880    kIemTbDbgEntryType_Invalid = 0,
     881    /** The entry is for a new guest instruction. */
     882    kIemTbDbgEntryType_GuestInstruction,
     883    /** Marks the start of a native call. */
     884    kIemTbDbgEntryType_ThreadedCall1,
     885    /** 2nd entry for the start of a native call. */
     886    kIemTbDbgEntryType_ThreadedCall2,
     887    /** Info about a host register shadowing a guest register. */
     888    kIemTbDbgEntryType_GuestRegShadow,
     889    kIemTbDbgEntryType_End
     890} IEMTBDBGENTRYTYPE;
     891
     892/**
     893 * Translation block debug info entry.
     894 */
     895typedef union IEMTBDBGENTRY
     896{
     897    /** Plain 32-bit view. */
     898    uint32_t u;
     899
     900    /** Generic view for getting at the type field. */
     901    struct
     902    {
     903        /** IEMTBDBGENTRYTYPE */
     904        uint32_t    uType : 4;
     905        uint32_t    uTypeSpecific : 28;
     906    } Gen;
     907
     908    struct
     909    {
     910        /** kIemTbDbgEntryType_GuestInstruction. */
     911        uint32_t    uType      : 4;
     912        /** Index into IEMTB::aRanges. */
     913        uint32_t    idxRange   : 4;
     914        /** Offset relative to the start of the range. */
     915        uint32_t    offOpcodes : 12;
     916        /** Number of opcode bytes for the instruction. */
     917        uint32_t    cbOpcodes  : 4;
     918        /** Basic CPU mode for the disassembler (low 8 bits IEM_F_XXX). */
     919        uint32_t    fCpuMode   : 8;
     920    } GuestInstruction;
     921
     922    struct
     923    {
     924        /** kIemTbDbgEntryType_ThreadedCall1. */
     925        uint32_t    uType      : 4;
     926        /** Native code offset. */
     927        uint32_t    offNative  : 28;
     928    } ThreadedCall1;
     929
     930    struct
     931    {
     932        /* kIemTbDbgEntryType_ThreadedCall2. */
     933        uint32_t    uType      : 4;
     934        /** The threaded call number (IEMTHREADEDFUNCS). */
     935        uint32_t    enmCall    : 16;
     936    } ThreadedCall2;
     937
     938    struct
     939    {
     940        /* kIemTbDbgEntryType_GuestRegShadow. */
     941        uint32_t    uType      : 4;
     942        uint32_t    uPadding   : 4;
     943        /** The host register number. */
     944        uint32_t    idxHstReg  : 8;
     945        /** The guest register being shadowed (IEMNATIVEGSTREG). */
     946        uint32_t    idxGstReg  : 8;
     947        uint32_t    uUnused    : 8;
     948    } GuestRegShadow;
     949} IEMTBDBGENTRY;
     950AssertCompileSize(IEMTBDBGENTRY, sizeof(uint32_t));
     951
     952/**
     953 * Translation block debug info.
     954 */
     955typedef struct IEMTBDBG
     956{
     957    /** Number of entries in aEntries. */
     958    uint32_t        cEntries;
     959    /** Number of entries we've allocated. */
     960    uint32_t        cAllocated;
     961    /** Debug info entries. */
     962    RT_FLEXIBLE_ARRAY_EXTENSION
     963    IEMTBDBGENTRY   aEntries[RT_FLEXIBLE_ARRAY];
     964} IEMTBDBG;
     965/** Pointer to TB debug info. */
     966typedef IEMTBDBG *PIEMTBDBG;
     967/** Pointer to const TB debug info. */
     968typedef IEMTBDBG const *PCIEMTBDBG;
    871969
    872970
     
    9451043    uint8_t            *pabOpcodes;
    9461044
    947     /** Debug info or smth. */
    948     void               *pvDbg;
     1045    /** Debug info if enabled.
     1046     * This is only generated by the native recompiler. */
     1047    PIEMTBDBG           pDbgInfo;
    9491048
    9501049    /* --- 64 byte cache line end --- */
     
    9811080     * The GCPhysPc w/o page offset is element zero, so starting here with 1. */
    9821081    RTGCPHYS            aGCPhysPages[2];
    983 
    9841082} IEMTB;
    9851083#pragma pack()
     
    9871085AssertCompileMemberAlignment(IEMTB, Thrd, sizeof(void *));
    9881086AssertCompileMemberAlignment(IEMTB, pabOpcodes, sizeof(void *));
    989 AssertCompileMemberAlignment(IEMTB, pvDbg, sizeof(void *));
     1087AssertCompileMemberAlignment(IEMTB, pDbgInfo, sizeof(void *));
    9901088AssertCompileMemberAlignment(IEMTB, aGCPhysPages, sizeof(RTGCPHYS));
    9911089AssertCompileMemberOffset(IEMTB, aRanges[0], 64);
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