Index: trunk/src/VBox/Disassembler/DisasmCore.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8333)
+++ trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8336)
@@ -1222,4 +1222,19 @@
     }
     else
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        Assert(OP_PARM_VSUBTYPE(pParam->param) != OP_PARM_p);
+        /* near 64 bits pointer */
+        /*
+         * Note: used only in "mov al|ax|eax, [Addr]" and "mov [Addr], al|ax|eax"
+         * so we treat it like displacement.
+         */
+        pParam->disp64 = DISReadQWord(pCpu, lpszCodeBlock);
+        pParam->flags |= USE_DISPLACEMENT64;
+
+        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "[0%08X%08Xh]", (uint32_t)(pParam->disp64 >> 32), (uint32_t)pParam->disp64);
+        return sizeof(uint32_t);
+    }
+    else
     {
         if (OP_PARM_VSUBTYPE(pParam->param) == OP_PARM_p)
@@ -1260,4 +1275,8 @@
         }
     }
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        return sizeof(uint64_t);
+    }
     else
     {
@@ -1286,5 +1305,5 @@
     }
 
-    if (pParam->param < OP_PARM_REG_SEG_START)
+    if (pParam->param <= OP_PARM_REG_GEN32_END)
     {
         /* 32-bit EAX..EDI registers. */
@@ -1296,4 +1315,16 @@
             pParam->flags |= USE_REG_GEN32;
             pParam->size   = 4;
+        }
+        else
+        if (pCpu->opmode == CPUMODE_64BIT)
+        {
+            /* Use 64-bit registers. */
+            pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN32_START;
+            if (    (pCpu->prefix & PREFIX_REX)
+                &&  (pCpu->prefix_rex & PREFIX_REX_FLAGS))
+                pParam->base.reg_gen += 8;
+
+            pParam->flags |= USE_REG_GEN64;
+            pParam->size   = 8;
         }
         else
@@ -1307,5 +1338,5 @@
     }
     else
-    if (pParam->param < OP_PARM_REG_GEN16_START)
+    if (pParam->param <= OP_PARM_REG_SEG_END)
     {
         /* Segment ES..GS registers. */
@@ -1315,5 +1346,5 @@
     }
     else
-    if (pParam->param < OP_PARM_REG_GEN8_START)
+    if (pParam->param <= OP_PARM_REG_GEN16_END)
     {
         /* 16-bit AX..DI registers. */
@@ -1323,5 +1354,5 @@
     }
     else
-    if (pParam->param < OP_PARM_REG_FP_START)
+    if (pParam->param <= OP_PARM_REG_GEN8_END)
     {
         /* 8-bit AL..DL, AH..DH registers. */
@@ -1331,5 +1362,5 @@
     }
     else
-    if (pParam->param <= OP_PARM_REGFP_7)
+    if (pParam->param <= OP_PARM_REG_FP_END)
     {
         /* FPU registers. */
@@ -1356,4 +1387,10 @@
     }
     else
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        pParam->base.reg_gen = USE_REG_RSI;
+        pParam->flags |= USE_REG_GEN64;
+    }
+    else
     {
         pParam->base.reg_gen = USE_REG_SI;
@@ -1375,4 +1412,10 @@
     }
     else
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        pParam->base.reg_gen = USE_REG_RSI;
+        pParam->flags |= USE_REG_GEN64;
+    }
+    else
     {
         pParam->base.reg_gen = USE_REG_SI;
@@ -1395,4 +1438,10 @@
     }
     else
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        pParam->base.reg_gen = USE_REG_RDI;
+        pParam->flags |= USE_REG_GEN64;
+    }
+    else
     {
         pParam->base.reg_gen = USE_REG_DI;
@@ -1412,4 +1461,10 @@
         pParam->base.reg_gen = USE_REG_EDI;
         pParam->flags |= USE_REG_GEN32;
+    }
+    else
+    if (pCpu->addrmode == CPUMODE_64BIT)
+    {
+        pParam->base.reg_gen = USE_REG_RDI;
+        pParam->flags |= USE_REG_GEN64;
     }
     else
@@ -1506,7 +1561,5 @@
     //little hack to make sure the ModRM byte is included in the returned size
     if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
-    {
         size = sizeof(uint8_t); //ModRM byte
-    }
 
     size += ParseInstruction(lpszCodeBlock, pOp, pCpu);
@@ -1861,4 +1914,5 @@
 #if !defined(DIS_CORE_ONLY) && defined(LOG_ENABLED)
 const char *szModRMReg8[]      = {"AL", "CL", "DL", "BL", "AH", "CH", "DH", "BH"};
+const char *szModRMReg8_64[]   = {"AL", "CL", "DL", "BL", "AH", "CH", "DH", "BH", "R8L", "R9L", "R10L", "R11L", "R12L", "R13L", "R14L", "R15L"};
 const char *szModRMReg16[]     = {"AX", "CX", "DX", "BX", "SP", "BP", "SI", "DI"};
 const char *szModRMReg32[]     = {"EAX", "ECX", "EDX", "EBX", "ESP", "EBP", "ESI", "EDI"};
