VirtualBox

Changeset 41792 in vbox


Ignore:
Timestamp:
Jun 16, 2012 11:41:11 PM (13 years ago)
Author:
vboxsync
Message:

Some more DISSTATE adjustments.

Location:
trunk
Files:
2 edited

Legend:

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

    r41791 r41792  
    529529/**
    530530 * The diassembler state and result.
    531  *
    532  * @todo ModRM and SIB could be joined and 6 bytes would be saved, only it
    533  *       doesn't make any sense right now because of structure alignment.
    534531 */
    535532typedef struct DISSTATE
    536533{
    537     /* Because of pvUser2, put the less frequently used bits at the top for
    538        now. (Might be better off in the middle?) */
    539     DISOPPARAM      Param3;
    540     DISOPPARAM      Param2;
    541     DISOPPARAM      Param1;
    542 
    543     /* off: 0x060 (96) */
     534    /** The number of valid bytes in abInstr. */
     535    uint8_t         cbCachedInstr;
     536    /** SIB fields. */
     537    union
     538    {
     539        /** Bitfield view */
     540        struct
     541        {
     542            uint8_t     Base;
     543            uint8_t     Index;
     544            uint8_t     Scale;
     545        } Bits;
     546    } SIB;
    544547    /** ModRM fields. */
    545548    union
     
    548551        struct
    549552        {
    550             unsigned        Rm  : 4;
    551             unsigned        Reg : 4;
    552             unsigned        Mod : 2;
     553            uint8_t     Rm;
     554            uint8_t     Reg;
     555            uint8_t     Mod;
    553556        } Bits;
    554         /** unsigned view */
    555         unsigned            u;
    556557    } ModRM;
    557     /** SIB fields. */
    558     union
    559     {
    560         /** Bitfield view */
    561         struct
    562         {
    563             unsigned        Base  : 4;
    564             unsigned        Index : 4;
    565             unsigned        Scale : 2;
    566         } Bits;
    567         /** unsigned view */
    568         unsigned            u;
    569     } SIB;
    570     /** SIB displacment. */
    571     int32_t         i32SibDisp;
    572 
    573     /* off: 0x06c (108) */
    574558    /** The CPU mode (DISCPUMODE). */
    575559    uint8_t         uCpuMode;
     
    580564    /** Per instruction prefix settings. */
    581565    uint8_t         fPrefix;
    582     /* off: 0x070 (112) */
    583566    /** REX prefix value (64 bits only). */
    584567    uint8_t         fRexPrefix;
     
    589572    /** First opcode byte of instruction. */
    590573    uint8_t         bOpCode;
    591     /* off: 0x074 (116) */
    592574    /** The size of the prefix bytes. */
    593575    uint8_t         cbPrefix;
    594576    /** The instruction size. */
    595577    uint8_t         cbInstr;
    596     /** The number of valid bytes in abInstr. */
    597     uint8_t         cbCachedInstr;
    598     /** Unused byte. */
    599     uint8_t         abUnused[1];
    600     /* off: 0x078 (120) */
    601     /** Return code set by a worker function like the opcode bytes readers. */
    602     int32_t         rc;
     578    /** Unused bytes. */
     579    uint8_t         abUnused[3];
    603580    /** Internal: instruction filter */
    604581    uint32_t        fFilter;
    605     /* off: 0x080 (128) */
    606582    /** Internal: pointer to disassembly function table */
    607583    PCPFNDISPARSE   pfnDisasmFnTable;
     
    614590    uint32_t        uPtrPadding2;
    615591#endif
    616     /* off: 0x090 (144) */
     592    /** The instruction bytes. */
     593    uint8_t         abInstr[16];
     594    /** SIB displacment. */
     595    int32_t         i32SibDisp;
     596
     597    /** Return code set by a worker function like the opcode bytes readers. */
     598    int32_t         rc;
    617599    /** The address of the instruction. */
    618600    RTUINTPTR       uInstrAddr;
    619     /* off: 0x098 (152) */
    620601    /** Optional read function */
    621602    PFNDISREADBYTES pfnReadBytes;
     
    623604    uint32_t        uPadding3;
    624605#endif
    625     /* off: 0x0a0 (160) */
    626     /** The instruction bytes. */
    627     uint8_t         abInstr[16];
    628     /* off: 0x0b0 (176) */
    629606    /** User data supplied as an argument to the APIs. */
    630607    void           *pvUser;
     
    632609    uint32_t        uPadding4;
    633610#endif
     611    /** Parameters.  */
     612    DISOPPARAM      Param1;
     613    DISOPPARAM      Param2;
     614    DISOPPARAM      Param3;
    634615} DISSTATE;
     616AssertCompileSize(DISSTATE, 0xb8);
    635617
    636618/** @deprecated  Use DISSTATE and change Cpu and DisState to Dis. */
  • trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp

    r41790 r41792  
    500500                    Assert(pDis->cbInstr >= 3);
    501501                    PUT_SZ("db 00fh, 01fh,");
    502                     PUT_NUM_8(pDis->ModRM.u);
     502                    PUT_NUM_8(MAKE_MODRM(pDis->ModRM.Bits.Mod, pDis->ModRM.Bits.Reg, pDis->ModRM.Bits.Rm));
    503503                    for (unsigned i = 3; i < pDis->cbInstr; i++)
    504504                    {
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