VirtualBox

Changeset 10272 in vbox for trunk/src/VBox/Disassembler


Ignore:
Timestamp:
Jul 5, 2008 1:13:50 PM (16 years ago)
Author:
vboxsync
Message:

Deal with sign extending bytes to uint64_t.

Location:
trunk/src/VBox/Disassembler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r9921 r10272  
    11791179unsigned ParseImmByteSX(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
    11801180{
    1181     if (pCpu->opmode == CPUMODE_32BIT) /** @todo In AMD64 mode we're ending up with 16-bit parvals now, see the disassembler _output_ for tstAsmSignExtend-1.asm. */
     1181    if (pCpu->opmode == CPUMODE_32BIT)
    11821182    {
    11831183        pParam->parval = (uint32_t)(int8_t)DISReadByte(pCpu, lpszCodeBlock);
     
    11851185        pParam->size   = sizeof(uint32_t);
    11861186        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%08Xh", (uint32_t)pParam->parval);
     1187    }
     1188    else
     1189    if (pCpu->opmode == CPUMODE_64BIT)
     1190    {
     1191        pParam->parval = (uint64_t)(int8_t)DISReadByte(pCpu, lpszCodeBlock);
     1192        pParam->flags |= USE_IMMEDIATE64_SX8;
     1193        pParam->size   = sizeof(uint64_t);
     1194        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%016RX64h", pParam->parval);
    11871195    }
    11881196    else
  • trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp

    r10203 r10272  
    780780                        Assert(*pszFmt == 'b' || *pszFmt == 'v' || *pszFmt == 'w' || *pszFmt == 'z'); pszFmt++;
    781781                        switch (pParam->flags & (  USE_IMMEDIATE8 | USE_IMMEDIATE16 | USE_IMMEDIATE32 | USE_IMMEDIATE64
    782                                                  | USE_IMMEDIATE16_SX8 | USE_IMMEDIATE32_SX8))
     782                                                 | USE_IMMEDIATE16_SX8 | USE_IMMEDIATE32_SX8 | USE_IMMEDIATE64_SX8))
    783783                        {
    784784                            case USE_IMMEDIATE8:
     
    833833                                PUT_SZ_STRICT("strict byte ", "byte ");
    834834                                PUT_NUM_32(pParam->parval);
     835                                break;
     836
     837                            case USE_IMMEDIATE64_SX8:
     838                                PUT_SZ_STRICT("strict byte ", "byte ");
     839                                PUT_NUM_64(pParam->parval);
    835840                                break;
    836841
  • trunk/src/VBox/Disassembler/DisasmReg.cpp

    r10271 r10272  
    700700        }
    701701        else
    702         if (pParam->flags & (USE_IMMEDIATE64 | USE_IMMEDIATE64_REL))
     702        if (pParam->flags & (USE_IMMEDIATE64 | USE_IMMEDIATE64_REL | USE_IMMEDIATE64_SX8))
    703703        {
    704704            pParamVal->flags |= PARAM_VAL64;
    705705            pParamVal->size   = sizeof(uint64_t);
    706706            pParamVal->val.val64 = pParam->parval;
    707             Assert(pParamVal->size == pParam->size);
     707            Assert(pParamVal->size == pParam->size || ((pParam->size == 1) && (pParam->flags & USE_IMMEDIATE64_SX8)) );
    708708        }
    709709        else
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