Index: trunk/src/VBox/Disassembler/DisasmCore.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 8999)
@@ -112,5 +112,6 @@
     ParseEscFP,
     ParseNopPause,
-    ParseImmByteSX
+    ParseImmByteSX,
+    ParseImmZ
 };
 
@@ -153,5 +154,6 @@
     ParseEscFP,
     ParseNopPause,
-    ParseImmByteSX_SizeOnly
+    ParseImmByteSX_SizeOnly,
+    ParseImmZ_SizeOnly
 };
 
@@ -1227,4 +1229,13 @@
     }
     else
+    if (pCpu->opmode == CPUMODE_64BIT)
+    {
+        pParam->parval = DISReadQWord(pCpu, lpszCodeBlock);
+        pParam->flags |= USE_IMMEDIATE64;
+
+        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%VX64h", pParam->parval);
+        return sizeof(uint64_t);
+    }
+    else
     {
         pParam->parval = DISReadWord(pCpu, lpszCodeBlock);
@@ -1241,6 +1252,42 @@
     if (pCpu->opmode == CPUMODE_32BIT)
         return sizeof(uint32_t);
+    else
+    if (pCpu->opmode == CPUMODE_64BIT)
+        return sizeof(uint64_t);
+
     return sizeof(uint16_t);
 }
+//*****************************************************************************
+//*****************************************************************************
+unsigned ParseImmZ(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
+{
+    /* Word for 16-bit operand-size or doubleword for 32 or 64-bit operand-size. */
+    if (pCpu->opmode == CPUMODE_16BIT)
+    {
+        pParam->parval = DISReadWord(pCpu, lpszCodeBlock);
+        pParam->flags |= USE_IMMEDIATE16;
+
+        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%04Xh", (uint32_t)pParam->parval);
+        return sizeof(uint16_t);
+    }
+    else
+    {
+        pParam->parval = DISReadDWord(pCpu, lpszCodeBlock);
+        pParam->flags |= USE_IMMEDIATE32;
+
+        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%08Xh", (uint32_t)pParam->parval);
+        return sizeof(uint32_t);
+    }
+}
+//*****************************************************************************
+//*****************************************************************************
+unsigned ParseImmZ_SizeOnly(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
+{
+    /* Word for 16-bit operand-size or doubleword for 32 or 64-bit operand-size. */
+    if (pCpu->opmode == CPUMODE_16BIT)
+        return sizeof(uint16_t);
+    return sizeof(uint32_t);
+}
+
 //*****************************************************************************
 // Relative displacement for branches (rel. to next instruction)
@@ -1275,4 +1322,13 @@
     }
     else
+    if (pCpu->opmode == CPUMODE_64BIT)
+    {
+        pParam->parval = DISReadQWord(pCpu, lpszCodeBlock);
+        pParam->flags |= USE_IMMEDIATE64_REL;
+
+        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), " (0%VX64h)", pParam->parval);
+        return sizeof(int64_t);
+    }
+    else
     {
         pParam->parval = DISReadWord(pCpu, lpszCodeBlock);
@@ -1290,4 +1346,7 @@
     if (pCpu->opmode == CPUMODE_32BIT)
         return sizeof(int32_t);
+    else
+    if (pCpu->opmode == CPUMODE_64BIT)
+        return sizeof(int64_t);
     return sizeof(uint16_t);
 }
Index: trunk/src/VBox/Disassembler/DisasmInternal.h
===================================================================
--- trunk/src/VBox/Disassembler/DisasmInternal.h	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmInternal.h	(revision 8999)
@@ -69,5 +69,6 @@
 #define IDX_ParseNopPause           35
 #define IDX_ParseImmByteSX          36
-#define IDX_ParseMax                (IDX_ParseImmByteSX+1)
+#define IDX_ParseImmZ               37
+#define IDX_ParseMax                (IDX_ParseImmZ+1)
 
 #ifdef IN_RING0
@@ -104,4 +105,6 @@
 unsigned ParseImmVRel(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
 unsigned ParseImmVRel_SizeOnly(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
+unsigned ParseImmZ(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
+unsigned ParseImmZ_SizeOnly(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
 
 unsigned ParseImmAddr(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
Index: trunk/src/VBox/Disassembler/DisasmTables.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmTables.cpp	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmTables.cpp	(revision 8999)
@@ -309,7 +309,7 @@
     OP("les %Gv,%Mp",        IDX_ParseModRM,     IDX_UseModRM,      0,          OP_LES,         OP_PARM_Gv,      OP_PARM_Mp,     OP_PARM_NONE,   OPTYPE_HARMLESS | OPTYPE_INVALID_64),
     OP("lds %Gv,%Mp",        IDX_ParseModRM,     IDX_UseModRM,      0,          OP_LDS,         OP_PARM_Gv,      OP_PARM_Mp,     OP_PARM_NONE,   OPTYPE_HARMLESS | OPTYPE_RRM_DANGEROUS | OPTYPE_INVALID_64),
-    /* @todo these two are groups */
+    /* @todo these two are actually group11 */
     OP("mov %Eb,%Ib",        IDX_ParseModRM,     IDX_ParseImmByte,  0,          OP_MOV,         OP_PARM_Eb,      OP_PARM_Ib,     OP_PARM_NONE,   OPTYPE_HARMLESS),
-    OP("mov %Ev,%Iv",        IDX_ParseModRM,     IDX_ParseImmV,     0,          OP_MOV,         OP_PARM_Ev,      OP_PARM_Iv,     OP_PARM_NONE,   OPTYPE_HARMLESS),
+    OP("mov %Ev,%Iz",        IDX_ParseModRM,     IDX_ParseImmZ,     0,          OP_MOV,         OP_PARM_Ev,      OP_PARM_Iz,     OP_PARM_NONE,   OPTYPE_HARMLESS),
     OP("enter %Iw,%Ib",      IDX_ParseImmUshort, IDX_ParseImmByte,  0,          OP_ENTER,       OP_PARM_Iw,      OP_PARM_Ib,     OP_PARM_NONE,   OPTYPE_HARMLESS),
     OP("leave",              0,                  0,                 0,          OP_LEAVE,       OP_PARM_NONE,    OP_PARM_NONE,   OP_PARM_NONE,   OPTYPE_HARMLESS | OPTYPE_DEFAULT_64_OP_SIZE),
@@ -2295,5 +2295,5 @@
     INVALID_OPCODE,
     /* 0F C7 */
-    OP("mov %Ev,%Iv",        IDX_ParseModRM,     IDX_ParseImmV,      0,          OP_MOV,     OP_PARM_Ev,         OP_PARM_Iz ,    OP_PARM_NONE,   OPTYPE_HARMLESS),
+    OP("mov %Ev,%Iz",        IDX_ParseModRM,     IDX_ParseImmZ,      0,          OP_MOV,     OP_PARM_Ev,         OP_PARM_Iz ,    OP_PARM_NONE,   OPTYPE_HARMLESS),
     INVALID_OPCODE,
     INVALID_OPCODE,
Index: trunk/src/VBox/Disassembler/DisasmTablesX64.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmTablesX64.cpp	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmTablesX64.cpp	(revision 8999)
@@ -309,6 +309,7 @@
     INVALID_OPCODE,
     INVALID_OPCODE,
+    /* @todo these two are actually group11 */
     OP("mov %Eb,%Ib",        IDX_ParseModRM,     IDX_ParseImmByte,  0,          OP_MOV,         OP_PARM_Eb,      OP_PARM_Ib,     OP_PARM_NONE,   OPTYPE_HARMLESS),
-    OP("mov %Ev,%Iv",        IDX_ParseModRM,     IDX_ParseImmV,     0,          OP_MOV,         OP_PARM_Ev,      OP_PARM_Iv,     OP_PARM_NONE,   OPTYPE_HARMLESS),
+    OP("mov %Ev,%Iz",        IDX_ParseModRM,     IDX_ParseImmZ,     0,          OP_MOV,         OP_PARM_Ev,      OP_PARM_Iz,     OP_PARM_NONE,   OPTYPE_HARMLESS),
     OP("enter %Iw,%Ib",      IDX_ParseImmUshort, IDX_ParseImmByte,  0,          OP_ENTER,       OP_PARM_Iw,      OP_PARM_Ib,     OP_PARM_NONE,   OPTYPE_HARMLESS),
     OP("leave",              0,                  0,                 0,          OP_LEAVE,       OP_PARM_NONE,    OP_PARM_NONE,   OP_PARM_NONE,   OPTYPE_HARMLESS | OPTYPE_DEFAULT_64_OP_SIZE),
Index: trunk/src/VBox/Disassembler/DisasmTest.cpp
===================================================================
--- trunk/src/VBox/Disassembler/DisasmTest.cpp	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmTest.cpp	(revision 8999)
@@ -77,5 +77,5 @@
             memset(&cpu, 0, sizeof(cpu));
             cpu.mode = CPUMODE_64BIT;
-//__debugbreak();
+__debugbreak();
             if (VBOX_SUCCESS(DISInstr(&cpu, pInstr, 0, &cb, szOutput)))
                 printf(szOutput);
Index: trunk/src/VBox/Disassembler/DisasmTestA.asm
===================================================================
--- trunk/src/VBox/Disassembler/DisasmTestA.asm	(revision 8998)
+++ trunk/src/VBox/Disassembler/DisasmTestA.asm	(revision 8999)
@@ -70,4 +70,9 @@
 align 16
 BEGINPROC TestProc64
+      ;incorrectly assembled by yasm; REX.W should not be added!
+      ;test rax, dword 0cc90cc90h
+      mov rax, dword 0cc90cc90h
+      mov rax, qword 0ffffcc90cc90h
+
       movzx rax,byte  [edx]
       movzx rax,word  [edx]
@@ -91,4 +96,5 @@
       movss xmm0, xmm14
       movsd xmm6, xmm1
+
       ret
 ENDPROC   TestProc64
