- Timestamp:
- Apr 24, 2008 2:20:23 PM (17 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/Disasm.cpp
r8361 r8364 117 117 unsigned i = 0, prefixbytes; 118 118 unsigned idx, inc; 119 const OPCODE *paOneByteMap; 119 120 #ifdef __L4ENV__ 120 121 jmp_buf jumpbuffer; … … 147 148 if (pCpu->mode == CPUMODE_64BIT) 148 149 { 150 paOneByteMap = g_aOneByteMapX64; 149 151 pCpu->addrmode = CPUMODE_64BIT; 150 152 pCpu->opmode = CPUMODE_32BIT; … … 152 154 else 153 155 { 156 paOneByteMap = g_aOneByteMapX86; 154 157 pCpu->addrmode = pCpu->mode; 155 158 pCpu->opmode = pCpu->mode; … … 167 170 { 168 171 uint8_t codebyte = DISReadByte(pCpu, pu8Instruction+i); 169 uint8_t opcode = g_aOneByteMapX86[codebyte].opcode;172 uint8_t opcode = paOneByteMap[codebyte].opcode; 170 173 171 174 /* Hardcoded assumption about OP_* values!! */ … … 265 268 pCpu->opaddr = pu8Instruction + idx + u32EipOffset - prefixbytes; 266 269 267 if (pCpu->mode == CPUMODE_64BIT) 268 inc = ParseInstruction(pu8Instruction + i, &g_aOneByteMapX64[pCpu->opcode], pCpu); 269 else 270 inc = ParseInstruction(pu8Instruction + i, &g_aOneByteMapX86[pCpu->opcode], pCpu); 270 inc = ParseInstruction(pu8Instruction + i, &paOneByteMap[pCpu->opcode], pCpu); 271 271 272 272 pCpu->opsize = prefixbytes + inc + sizeof(uint8_t); -
trunk/src/VBox/Disassembler/DisasmCore.cpp
r8361 r8364 251 251 static int disCoreOne(PDISCPUSTATE pCpu, RTUINTPTR InstructionAddr, unsigned *pcbInstruction) 252 252 { 253 const OPCODE *paOneByteMap; 254 253 255 /* 254 256 * Parse byte by byte. … … 259 261 if (pCpu->mode == CPUMODE_64BIT) 260 262 { 263 paOneByteMap = g_aOneByteMapX64; 261 264 pCpu->addrmode = CPUMODE_64BIT; 262 265 pCpu->opmode = CPUMODE_32BIT; … … 264 267 else 265 268 { 269 paOneByteMap = g_aOneByteMapX86; 266 270 pCpu->addrmode = pCpu->mode; 267 271 pCpu->opmode = pCpu->mode; … … 270 274 while(1) 271 275 { 272 uint8_t codebyte 273 uint8_t opcode = g_aOneByteMapX86[codebyte].opcode;276 uint8_t codebyte = DISReadByte(pCpu, InstructionAddr+iByte); 277 uint8_t opcode = paOneByteMap[codebyte].opcode; 274 278 275 279 /* Hardcoded assumption about OP_* values!! */ … … 360 364 pCpu->opcode = codebyte; 361 365 362 if (pCpu->mode == CPUMODE_64BIT) 363 cbInc = ParseInstruction(InstructionAddr + iByte, &g_aOneByteMapX64[pCpu->opcode], pCpu); 364 else 365 cbInc = ParseInstruction(InstructionAddr + iByte, &g_aOneByteMapX86[pCpu->opcode], pCpu); 366 366 cbInc = ParseInstruction(InstructionAddr + iByte, &paOneByteMap[pCpu->opcode], pCpu); 367 367 iByte += cbInc; 368 368 break; -
trunk/src/VBox/Disassembler/DisasmReg.cpp
r8234 r8364 521 521 522 522 if (pParam->flags & USE_SCALE) 523 {524 523 val32 *= pParam->scale; 525 } 524 526 525 pParamVal->val.val32 += val32; 527 526 } … … 530 529 { 531 530 if (pCpu->mode & CPUMODE_32BIT) 532 {533 531 pParamVal->val.val32 += (int32_t)pParam->disp8; 534 }535 532 else 536 {537 533 pParamVal->val.val16 += (int16_t)pParam->disp8; 538 }539 534 } 540 535 else … … 542 537 { 543 538 if (pCpu->mode & CPUMODE_32BIT) 544 {545 539 pParamVal->val.val32 += (int32_t)pParam->disp16; 546 }547 540 else 548 {549 541 pParamVal->val.val16 += pParam->disp16; 550 }551 542 } 552 543 else … … 554 545 { 555 546 if (pCpu->mode & CPUMODE_32BIT) 556 {557 547 pParamVal->val.val32 += pParam->disp32; 558 }559 548 else 560 { 561 Assert(0); 562 } 549 AssertFailed(); 563 550 } 564 551 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.