Index: trunk/src/VBox/Disassembler/DisasmCore.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8168)
+++ trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8234)
@@ -532,5 +532,5 @@
 
         pParam->flags |= USE_BASE | USE_REG_GEN32;
-        pParam->base.reg_gen32 = base;
+        pParam->base.reg_gen = base;
     }
     return;   /* Already fetched everything in ParseSIB; no size returned */
@@ -1240,5 +1240,5 @@
         {
             /* Use 32-bit registers. */
-            pParam->base.reg_gen32 = pParam->param - OP_PARM_REG_GEN32_START;
+            pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN32_START;
             pParam->flags |= USE_REG_GEN32;
             pParam->size   = 4;
@@ -1247,5 +1247,5 @@
         {
             /* Use 16-bit registers. */
-            pParam->base.reg_gen16 = pParam->param - OP_PARM_REG_GEN32_START;
+            pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN32_START;
             pParam->flags |= USE_REG_GEN16;
             pParam->size   = 2;
@@ -1265,5 +1265,5 @@
     {
         /* 16-bit AX..DI registers. */
-        pParam->base.reg_gen16 = pParam->param - OP_PARM_REG_GEN16_START;
+        pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN16_START;
         pParam->flags |= USE_REG_GEN16;
         pParam->size   = 2;
@@ -1273,5 +1273,5 @@
     {
         /* 8-bit AL..DL, AH..DH registers. */
-        pParam->base.reg_gen8 = pParam->param - OP_PARM_REG_GEN8_START;
+        pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN8_START;
         pParam->flags |= USE_REG_GEN8;
         pParam->size   = 1;
@@ -1299,10 +1299,10 @@
     if (pCpu->addrmode == CPUMODE_32BIT)
     {
-        pParam->base.reg_gen32 = USE_REG_ESI;
+        pParam->base.reg_gen = USE_REG_ESI;
         pParam->flags |= USE_REG_GEN32;
     }
     else
     {
-        pParam->base.reg_gen16 = USE_REG_SI;
+        pParam->base.reg_gen = USE_REG_SI;
         pParam->flags |= USE_REG_GEN16;
     }
@@ -1318,10 +1318,10 @@
     if (pCpu->addrmode == CPUMODE_32BIT)
     {
-        pParam->base.reg_gen32 = USE_REG_ESI;
+        pParam->base.reg_gen = USE_REG_ESI;
         pParam->flags |= USE_REG_GEN32;
     }
     else
     {
-        pParam->base.reg_gen16 = USE_REG_SI;
+        pParam->base.reg_gen = USE_REG_SI;
         pParam->flags |= USE_REG_GEN16;
     }
@@ -1338,10 +1338,10 @@
     if (pCpu->addrmode == CPUMODE_32BIT)
     {
-        pParam->base.reg_gen32 = USE_REG_EDI;
+        pParam->base.reg_gen = USE_REG_EDI;
         pParam->flags |= USE_REG_GEN32;
     }
     else
     {
-        pParam->base.reg_gen16 = USE_REG_DI;
+        pParam->base.reg_gen = USE_REG_DI;
         pParam->flags |= USE_REG_GEN16;
     }
@@ -1357,10 +1357,10 @@
     if (pCpu->addrmode == CPUMODE_32BIT)
     {
-        pParam->base.reg_gen32 = USE_REG_EDI;
+        pParam->base.reg_gen = USE_REG_EDI;
         pParam->flags |= USE_REG_GEN32;
     }
     else
     {
-        pParam->base.reg_gen16 = USE_REG_DI;
+        pParam->base.reg_gen = USE_REG_DI;
         pParam->flags |= USE_REG_GEN16;
     }
@@ -1826,5 +1826,5 @@
         disasmAddString(pParam->szParam, szModRMReg8[idx]);
         pParam->flags |= USE_REG_GEN8;
-        pParam->base.reg_gen8 = idx;
+        pParam->base.reg_gen = idx;
         break;
 
@@ -1832,5 +1832,5 @@
         disasmAddString(pParam->szParam, szModRMReg16[idx]);
         pParam->flags |= USE_REG_GEN16;
-        pParam->base.reg_gen16 = idx;
+        pParam->base.reg_gen = idx;
         break;
 
@@ -1838,5 +1838,5 @@
         disasmAddString(pParam->szParam, szModRMReg32[idx]);
         pParam->flags |= USE_REG_GEN32;
-        pParam->base.reg_gen32 = idx;
+        pParam->base.reg_gen = idx;
         break;
 
@@ -1860,5 +1860,5 @@
     disasmAddString(pParam->szParam, szModRMReg1616[idx]);
     pParam->flags |= USE_REG_GEN16;
-    pParam->base.reg_gen16 = BaseModRMReg16[idx];
+    pParam->base.reg_gen = BaseModRMReg16[idx];
     if (idx < 4)
     {
Index: trunk/src/VBox/Disassembler/DisasmReg.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmReg.cpp	(revision 8168)
+++ trunk/src/VBox/Disassembler/DisasmReg.cpp	(revision 8234)
@@ -207,9 +207,12 @@
         return 8;
 
-    case OP_PARM_p:
+    case OP_PARM_p: /* far pointer */
         if (pCpu->addrmode == CPUMODE_32BIT)
-            return 8;
-        else
-            return 4;
+            return 6;   /* 16:32 */
+        else
+        if (pCpu->addrmode == CPUMODE_64BIT)
+            return 12;  /* 16:64 */
+        else
+            return 4;   /* 16:16 */
 
     default:
@@ -232,13 +235,11 @@
     {
         /* Guess segment register by parameter type. */
-        if (pParam->flags & USE_REG_GEN32)
-        {
-            if (pParam->base.reg_gen32 == USE_REG_ESP || pParam->base.reg_gen32 == USE_REG_EBP)
-                return USE_REG_SS;
-        }
-        else
-        if (pParam->flags & USE_REG_GEN16)
-        {
-            if (pParam->base.reg_gen16 == USE_REG_SP || pParam->base.reg_gen16 == USE_REG_BP)
+        if (pParam->flags & (USE_REG_GEN32|USE_REG_GEN64|USE_REG_GEN16))
+        {
+            AssertCompile(USE_REG_ESP == USE_REG_RSP);
+            AssertCompile(USE_REG_EBP == USE_REG_RBP);
+            AssertCompile(USE_REG_ESP == USE_REG_SP);
+            AssertCompile(USE_REG_EBP == USE_REG_BP);
+            if (pParam->base.reg_gen == USE_REG_ESP || pParam->base.reg_gen == USE_REG_EBP)
                 return USE_REG_SS;
         }
@@ -486,5 +487,5 @@
             {
                 pParamVal->flags |= PARAM_VAL8;
-                if (VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen8, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;
+                if (VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;
             }
             else
@@ -492,5 +493,5 @@
             {
                 pParamVal->flags |= PARAM_VAL16;
-                if (VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen16, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;
+                if (VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;
             }
             else
@@ -498,5 +499,5 @@
             {
                 pParamVal->flags |= PARAM_VAL32;
-                if (VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen32, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;
+                if (VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;
             }
             else
@@ -504,5 +505,5 @@
             {
                 pParamVal->flags |= PARAM_VAL64;
-                if (VBOX_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen64, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER;
+                if (VBOX_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER;
             }
             else {
@@ -581,5 +582,5 @@
             pParamVal->flags |= PARAM_VAL8;
             pParamVal->size   = sizeof(uint8_t);
-            if (VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen8, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;
+            if (VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;
         }
         else
@@ -588,5 +589,5 @@
             pParamVal->flags |= PARAM_VAL16;
             pParamVal->size   = sizeof(uint16_t);
-            if (VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen16, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;
+            if (VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;
         }
         else
@@ -595,5 +596,5 @@
             pParamVal->flags |= PARAM_VAL32;
             pParamVal->size   = sizeof(uint32_t);
-            if (VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen32, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;
+            if (VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;
         }
         else
@@ -602,5 +603,5 @@
             pParamVal->flags |= PARAM_VAL64;
             pParamVal->size   = sizeof(uint64_t);
-            if (VBOX_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen64, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER;
+            if (VBOX_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER;
         }
         else
@@ -698,5 +699,5 @@
         {
             uint8_t *pu8Reg;
-            if (VBOX_SUCCESS(DISPtrReg8(pCtx, pParam->base.reg_gen8, &pu8Reg)))
+            if (VBOX_SUCCESS(DISPtrReg8(pCtx, pParam->base.reg_gen, &pu8Reg)))
             {
                 *pcbSize = sizeof(uint8_t);
@@ -709,5 +710,5 @@
         {
             uint16_t *pu16Reg;
-            if (VBOX_SUCCESS(DISPtrReg16(pCtx, pParam->base.reg_gen16, &pu16Reg)))
+            if (VBOX_SUCCESS(DISPtrReg16(pCtx, pParam->base.reg_gen, &pu16Reg)))
             {
                 *pcbSize = sizeof(uint16_t);
@@ -720,5 +721,5 @@
         {
             uint32_t *pu32Reg;
-            if (VBOX_SUCCESS(DISPtrReg32(pCtx, pParam->base.reg_gen32, &pu32Reg)))
+            if (VBOX_SUCCESS(DISPtrReg32(pCtx, pParam->base.reg_gen, &pu32Reg)))
             {
                 *pcbSize = sizeof(uint32_t);
@@ -731,5 +732,5 @@
         {
             uint64_t *pu64Reg;
-            if (VBOX_SUCCESS(DISPtrReg64(pCtx, pParam->base.reg_gen64, &pu64Reg)))
+            if (VBOX_SUCCESS(DISPtrReg64(pCtx, pParam->base.reg_gen, &pu64Reg)))
             {
                 *pcbSize = sizeof(uint64_t);
