Changeset 41743 in vbox
- Timestamp:
- Jun 15, 2012 2:00:58 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dis.h
r41742 r41743 194 194 /** @name 64-bit general register indexes. 195 195 * This matches the AMD64 register encoding. It is found used in 196 * DISOPPARAM::base.reg_gen and DISOPPARAM:: index.reg_gen.196 * DISOPPARAM::base.reg_gen and DISOPPARAM::Index.idxGenReg. 197 197 * @note Safe to assume same values as the 16-bit and 32-bit general registers. 198 198 * @{ … … 218 218 /** @name 32-bit general register indexes. 219 219 * This matches the AMD64 register encoding. It is found used in 220 * DISOPPARAM::base.reg_gen and DISOPPARAM:: index.reg_gen.220 * DISOPPARAM::base.reg_gen and DISOPPARAM::Index.idxGenReg. 221 221 * @note Safe to assume same values as the 16-bit and 64-bit general registers. 222 222 * @{ … … 242 242 /** @name 16-bit general register indexes. 243 243 * This matches the AMD64 register encoding. It is found used in 244 * DISOPPARAM::base.reg_gen and DISOPPARAM:: index.reg_gen.244 * DISOPPARAM::base.reg_gen and DISOPPARAM::Index.idxGenReg. 245 245 * @note Safe to assume same values as the 32-bit and 64-bit general registers. 246 246 * @{ … … 266 266 /** @name 8-bit general register indexes. 267 267 * This mostly (?) matches the AMD64 register encoding. It is found used in 268 * DISOPPARAM::base.reg_gen and DISOPPARAM:: index.reg_gen.268 * DISOPPARAM::base.reg_gen and DISOPPARAM::Index.idxGenReg. 269 269 * @{ 270 270 */ … … 426 426 uint8_t reg_dbg; 427 427 } base; 428 /** The SIB index register meaning, applicable if DISUSE_INDEX is 429 * set in fUse. */ 428 430 union 429 431 { 430 /** DISGREG_XXX. */431 uint8_t reg_gen;432 } index;433 432 /** General register index (DISGREG_XXX), applicable if DISUSE_REG_GEN8, 433 * DISUSE_REG_GEN16, DISUSE_REG_GEN32 or DISUSE_REG_GEN64 is set in fUse. */ 434 uint8_t idxGenReg; 435 } Index; 434 436 /** 2, 4 or 8, if DISUSE_SCALE is set in fUse. */ 435 437 uint8_t uScale; -
trunk/src/VBox/Disassembler/DisasmCore.cpp
r41742 r41743 617 617 { 618 618 pParam->fUse |= DISUSE_INDEX | regtype; 619 pParam-> index.reg_gen= index;619 pParam->Index.idxGenReg = index; 620 620 621 621 if (scale != 0) … … 2379 2379 { 2380 2380 pParam->fUse |= DISUSE_INDEX; 2381 pParam-> index.reg_gen= IndexModRMReg16[idx];2381 pParam->Index.idxGenReg = IndexModRMReg16[idx]; 2382 2382 } 2383 2383 } -
trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp
r41742 r41743 208 208 case DISCPUMODE_16BIT: 209 209 { 210 Assert(pParam-> index.reg_gen< RT_ELEMENTS(g_aszYasmRegGen16));211 const char *psz = g_aszYasmRegGen16[pParam-> index.reg_gen];210 Assert(pParam->Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen16)); 211 const char *psz = g_aszYasmRegGen16[pParam->Index.idxGenReg]; 212 212 *pcchReg = 2 + !!psz[2] + !!psz[3]; 213 213 return psz; … … 216 216 case DISCPUMODE_32BIT: 217 217 { 218 Assert(pParam-> index.reg_gen< RT_ELEMENTS(g_aszYasmRegGen32));219 const char *psz = g_aszYasmRegGen32[pParam-> index.reg_gen];218 Assert(pParam->Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen32)); 219 const char *psz = g_aszYasmRegGen32[pParam->Index.idxGenReg]; 220 220 *pcchReg = 2 + !!psz[2] + !!psz[3]; 221 221 return psz; … … 224 224 case DISCPUMODE_64BIT: 225 225 { 226 Assert(pParam-> index.reg_gen< RT_ELEMENTS(g_aszYasmRegGen64));227 const char *psz = g_aszYasmRegGen64[pParam-> index.reg_gen];226 Assert(pParam->Index.idxGenReg < RT_ELEMENTS(g_aszYasmRegGen64)); 227 const char *psz = g_aszYasmRegGen64[pParam->Index.idxGenReg]; 228 228 *pcchReg = 2 + !!psz[2] + !!psz[3]; 229 229 return psz; -
trunk/src/VBox/Disassembler/DisasmReg.cpp
r41742 r41743 549 549 550 550 pParamVal->flags |= DISQPV_FLAG_16; 551 if (RT_FAILURE(DISFetchReg16(pCtx, pParam-> index.reg_gen, &val16))) return VERR_INVALID_PARAMETER;551 if (RT_FAILURE(DISFetchReg16(pCtx, pParam->Index.idxGenReg, &val16))) return VERR_INVALID_PARAMETER; 552 552 553 553 Assert(!(pParam->fUse & DISUSE_SCALE)); /* shouldn't be possible in 16 bits mode */ … … 561 561 562 562 pParamVal->flags |= DISQPV_FLAG_32; 563 if (RT_FAILURE(DISFetchReg32(pCtx, pParam-> index.reg_gen, &val32))) return VERR_INVALID_PARAMETER;563 if (RT_FAILURE(DISFetchReg32(pCtx, pParam->Index.idxGenReg, &val32))) return VERR_INVALID_PARAMETER; 564 564 565 565 if (pParam->fUse & DISUSE_SCALE) … … 574 574 575 575 pParamVal->flags |= DISQPV_FLAG_64; 576 if (RT_FAILURE(DISFetchReg64(pCtx, pParam-> index.reg_gen, &val64))) return VERR_INVALID_PARAMETER;576 if (RT_FAILURE(DISFetchReg64(pCtx, pParam->Index.idxGenReg, &val64))) return VERR_INVALID_PARAMETER; 577 577 578 578 if (pParam->fUse & DISUSE_SCALE)
Note:
See TracChangeset
for help on using the changeset viewer.