VirtualBox

Changeset 9925 in vbox


Ignore:
Timestamp:
Jun 25, 2008 2:42:31 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32347
Message:

Yasm formatter: Fixes for sil, dil, spl, bpl and r8b-r15b.

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

Legend:

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

    r9913 r9925  
    3636static const char g_szSpaces[] =
    3737"                                                                               ";
    38 static const char g_aszYasmRegGen8x86[8][4] =
    39 {
    40     "al\0",   "cl\0",   "dl\0",   "bl\0",   "ah\0",   "ch\0",   "dh\0",   "bh\0"
    41 };
    42 static const char g_aszYasmRegGen8Amd64[16][5] =
    43 {
    44     "al\0\0", "cl\0\0", "dl\0\0", "bl\0\0", "spl\0",  "bpl\0",  "sil\0",  "dil\0",  "r8b\0",  "r9b\0",  "r10b",  "r11b",  "r12b",  "r13b",  "r14b",  "r15b"
     38static const char g_aszYasmRegGen8[20][5] =
     39{
     40    "al\0\0", "cl\0\0", "dl\0\0", "bl\0\0", "ah\0\0", "ch\0\0", "dh\0\0", "bh\0\0", "r8b\0",  "r9b\0",  "r10b",  "r11b",  "r12b",  "r13b",  "r14b",  "r15b",  "spl\0",  "bpl\0",  "sil\0",  "dil\0"
    4541};
    4642static const char g_aszYasmRegGen16[16][5] =
     
    107103    {
    108104        case USE_REG_GEN8:
    109             if (pCpu->opmode == CPUMODE_64BIT)
    110             {
    111                 Assert(pParam->base.reg_gen < RT_ELEMENTS(g_aszYasmRegGen8Amd64));
    112                 const char *psz = g_aszYasmRegGen8Amd64[pParam->base.reg_gen];
    113                 *pcchReg = 2 + !!psz[2] + !!psz[3];
    114                 return psz;
    115             }
    116             *pcchReg = 2;
    117             Assert(pParam->base.reg_gen < RT_ELEMENTS(g_aszYasmRegGen8x86));
    118             return g_aszYasmRegGen8x86[pParam->base.reg_gen];
     105        {
     106            Assert(pParam->base.reg_gen < RT_ELEMENTS(g_aszYasmRegGen8));
     107            const char *psz = g_aszYasmRegGen8[pParam->base.reg_gen];
     108            *pcchReg = 2 + !!psz[2] + !!psz[3];
     109            return psz;
     110        }
    119111
    120112        case USE_REG_GEN16:
     
    184176        case USE_REG_SEG:
    185177        {
    186             Assert(pParam->base.reg_seg < RT_ELEMENTS(g_aszYasmRegCRx));
     178            Assert(pParam->base.reg_seg < (DIS_SELREG)RT_ELEMENTS(g_aszYasmRegCRx));
    187179            const char *psz = g_aszYasmRegSeg[pParam->base.reg_seg];
    188180            *pcchReg = 2;
  • trunk/src/VBox/Disassembler/testcase/tstAsmRegs-1.asm

    r9916 r9925  
    4040    mov     al, dl
    4141    mov     al, dh
    42 %if TEST_BITS == 64 && 0 ; This is busted both in the yasm formatter (all) and in the disasm core (first 4).
     42%if TEST_BITS == 64
    4343    mov     al, dil
    4444    mov     al, sil
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