- Timestamp:
- Jul 3, 2009 9:49:33 AM (16 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore.cpp
r20961 r21187 415 415 bool fFiltered = false; 416 416 417 Assert(lpszCodeBlock && pOp && pCpu); 418 417 419 // Store the opcode format string for disasmPrintf 418 420 #ifndef DIS_CORE_ONLY … … 450 452 && !(pCpu->prefix & PREFIX_OPSIZE)) 451 453 pCpu->opmode = CPUMODE_64BIT; 454 } 455 else 456 if (pOp->optype & OPTYPE_FORCED_32_OP_SIZE_X86) 457 { 458 /* Forced 32 bits operand size for certain instructions (mov crx, mov drx). */ 459 Assert(pCpu->mode != CPUMODE_64BIT); 460 pCpu->opmode = CPUMODE_32BIT; 452 461 } 453 462 … … 1105 1114 pCpu->ModRM.Bits.Reg = MODRM_REG(ModRM); 1106 1115 1116 /* Disregard the mod bits for certain instructions (mov crx, mov drx). 1117 * 1118 * From the AMD manual: 1119 * This instruction is always treated as a register-to-register (MOD = 11) instruction, regardless of the 1120 * encoding of the MOD field in the MODR/M byte. 1121 */ 1122 if (pOp->optype & OPTYPE_MOD_FIXED_11) 1123 pCpu->ModRM.Bits.Mod = 3; 1124 1107 1125 if (pCpu->prefix & PREFIX_REX) 1108 1126 { … … 1141 1159 pCpu->ModRM.Bits.Mod = MODRM_MOD(ModRM); 1142 1160 pCpu->ModRM.Bits.Reg = MODRM_REG(ModRM); 1161 1162 /* Disregard the mod bits for certain instructions (mov crx, mov drx). 1163 * 1164 * From the AMD manual: 1165 * This instruction is always treated as a register-to-register (MOD = 11) instruction, regardless of the 1166 * encoding of the MOD field in the MODR/M byte. 1167 */ 1168 if (pOp->optype & OPTYPE_MOD_FIXED_11) 1169 pCpu->ModRM.Bits.Mod = 3; 1143 1170 1144 1171 if (pCpu->prefix & PREFIX_REX) -
trunk/src/VBox/Disassembler/DisasmTables.cpp
r18768 r21187 430 430 431 431 /* 2 */ 432 OP("mov %Rd,%Cd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_CR, OP_PARM_Rd, OP_PARM_Cd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED ),433 OP("mov %Rd,%Dd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_DR, OP_PARM_Rd, OP_PARM_Dd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED ),434 OP("mov %Cd,%Rd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_CR, OP_PARM_Cd, OP_PARM_Rd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED ),435 OP("mov %Dd,%Rd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_DR, OP_PARM_Dd, OP_PARM_Rd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED ),432 OP("mov %Rd,%Cd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_CR, OP_PARM_Rd, OP_PARM_Cd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED | OPTYPE_MOD_FIXED_11 | OPTYPE_FORCED_32_OP_SIZE_X86), 433 OP("mov %Rd,%Dd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_DR, OP_PARM_Rd, OP_PARM_Dd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED | OPTYPE_MOD_FIXED_11 | OPTYPE_FORCED_32_OP_SIZE_X86), 434 OP("mov %Cd,%Rd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_CR, OP_PARM_Cd, OP_PARM_Rd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED | OPTYPE_MOD_FIXED_11 | OPTYPE_FORCED_32_OP_SIZE_X86), 435 OP("mov %Dd,%Rd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_DR, OP_PARM_Dd, OP_PARM_Rd, OP_PARM_NONE, OPTYPE_DANGEROUS | OPTYPE_PRIVILEGED | OPTYPE_MOD_FIXED_11 | OPTYPE_FORCED_32_OP_SIZE_X86), 436 436 /* only valid for Pentium Pro & Pentium II */ 437 437 OP("mov %Rd,%Td", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOV_TR, OP_PARM_Rd, OP_PARM_Td, OP_PARM_NONE, OPTYPE_PRIVILEGED), -
trunk/src/VBox/Disassembler/DisasmTestA.asm
r20041 r21187 34 34 align 16 35 35 BEGINPROC TestProc 36 xor eax, eax 37 mov al, 4 38 lea edx, [4] 39 mov edx, 4 40 mov eax, 4 41 shl eax, 4 42 shl edx, 4 43 shr edx, 4 44 mov eax, edx 45 mov eax, ecx 46 mov edx, eax 47 mov ecx, eax 36 48 DB 0xF0, 0x0F, 0x22, 0xC0 37 49 DB 0xF0, 0x0F, 0x20, 0xC0
Note:
See TracChangeset
for help on using the changeset viewer.