- Timestamp:
- Apr 19, 2007 8:58:33 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMGC/IOMGC.cpp
r2201 r2202 46 46 47 47 48 /** @def IOMGC_MOVS_SUPPORT49 * Define IOMGC_MOVS_SUPPORT for movsb/w/d support in GC.50 */51 #define IOMGC_MOVS_SUPPORT52 53 54 48 /******************************************************************************* 55 49 * Internal Functions * 56 50 *******************************************************************************/ 57 #if 058 static bool iomGCCalcParamEA(PDISCPUSTATE pCpu, POP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, void **ppAddr);59 #endif60 51 static unsigned iomGCGetRegSize(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam); 61 52 static bool iomGCGetRegImmData(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, uint32_t *pu32Data, unsigned *pcbSize); … … 87 78 */ 88 79 #define SIZE2SHIFT(cb) (g_aSize2Shift[cb]) 89 90 91 #if 092 /**93 * Calculates effective address (offset from current segment register) for94 * instruction parameter, i.e. [eax + esi*4 + 1234h] -> virtual address.95 *96 * @returns true on success.97 * @param pCpu Pointer to current disassembler context.98 * @param pParam Pointer to parameter of instruction to calc EA.99 * @param pRegFrame Pointer to CPUMCTXCORE guest structure.100 * @param ppAddr Where to store result address.101 */102 static bool iomGCCalcParamEA(PDISCPUSTATE pCpu, POP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, void **ppAddr)103 {104 uint8_t *pAddr = 0;105 106 if (pCpu->addrmode == CPUMODE_32BIT)107 {108 /* 32-bit addressing. */109 if (pParam->flags & USE_BASE)110 pAddr += ACCESS_REG32(pRegFrame, pParam->base.reg_gen32);111 if (pParam->flags & USE_INDEX)112 {113 unsigned i = ACCESS_REG32(pRegFrame, pParam->index.reg_gen);114 if (pParam->flags & USE_SCALE)115 i *= pParam->scale;116 pAddr += i;117 }118 if (pParam->flags & USE_DISPLACEMENT8)119 pAddr += pParam->disp8;120 else121 if (pParam->flags & USE_DISPLACEMENT16)122 pAddr += pParam->disp16;123 else124 if (pParam->flags & USE_DISPLACEMENT32)125 pAddr += pParam->disp32;126 127 if (pParam->flags & (USE_BASE | USE_INDEX | USE_DISPLACEMENT8 | USE_DISPLACEMENT16 | USE_DISPLACEMENT32))128 {129 /* EA present in parameter. */130 *ppAddr = pAddr;131 return true;132 }133 }134 else135 {136 /* 16-bit addressing. */137 if (pParam->flags & USE_BASE)138 pAddr += ACCESS_REG16(pRegFrame, pParam->base.reg_gen16);139 if (pParam->flags & USE_INDEX)140 pAddr += ACCESS_REG16(pRegFrame, pParam->index.reg_gen);141 if (pParam->flags & USE_DISPLACEMENT8)142 pAddr += pParam->disp8;143 else144 if (pParam->flags & USE_DISPLACEMENT16)145 pAddr += pParam->disp16;146 147 if (pParam->flags & (USE_BASE | USE_INDEX | USE_DISPLACEMENT8 | USE_DISPLACEMENT16))148 {149 /* EA present in parameter. */150 *ppAddr = pAddr;151 return true;152 }153 }154 155 /* Error exit. */156 return false;157 }158 #endif159 80 160 81 /**
Note:
See TracChangeset
for help on using the changeset viewer.