Changeset 61135 in vbox for trunk/src/VBox/Disassembler
- Timestamp:
- May 23, 2016 2:52:07 PM (9 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmReg.cpp
r57358 r61135 204 204 { 205 205 unsigned subtype = OP_PARM_VSUBTYPE(pParam->fParam); 206 207 if (subtype == OP_PARM_v)208 {209 switch (pDis->uOpMode)210 {211 case DISCPUMODE_32BIT:212 subtype = OP_PARM_d;213 break;214 case DISCPUMODE_64BIT:215 subtype = OP_PARM_q;216 break;217 case DISCPUMODE_16BIT:218 subtype = OP_PARM_w;219 break;220 default:221 /* make gcc happy */222 break;223 }224 }225 226 206 switch (subtype) 227 207 { 228 case OP_PARM_b: 229 return 1; 230 231 case OP_PARM_w: 232 return 2; 233 234 case OP_PARM_d: 235 return 4; 236 237 case OP_PARM_q: 238 case OP_PARM_dq: 239 return 8; 240 241 case OP_PARM_p: /* far pointer */ 242 if (pDis->uAddrMode == DISCPUMODE_32BIT) 243 return 6; /* 16:32 */ 244 else 245 if (pDis->uAddrMode == DISCPUMODE_64BIT) 246 return 12; /* 16:64 */ 247 else 248 return 4; /* 16:16 */ 249 250 default: 251 if (pParam->cb) 252 return pParam->cb; 253 else //@todo dangerous!!! 208 case OP_PARM_v: 209 switch (pDis->uOpMode) 210 { 211 case DISCPUMODE_32BIT: 212 return 4; 213 case DISCPUMODE_64BIT: 214 return 8; 215 case DISCPUMODE_16BIT: 216 return 2; 217 default: AssertFailed(); /* make gcc happy */ return 4; 218 } 219 break; 220 221 case OP_PARM_b: 222 return 1; 223 224 case OP_PARM_w: 225 return 2; 226 227 case OP_PARM_d: 228 return 4; 229 230 case OP_PARM_q: 231 return 8; 232 233 case OP_PARM_dq: 234 return 16; 235 236 case OP_PARM_qq: 237 return 32; 238 239 case 0: /* nop, pause, lea, wrmsr, rdmsr, etc. Most of these due to DISOPPARAM::cb being initialized in the wrong place 240 (disParseInstruction) where it will be called on intermediate stuff like IDX_ParseTwoByteEsc. The parameter 241 parsers should do it instead, though I see the potential filtering issue. */ 242 //Assert( pDis->pCurInstr 243 // && ( pDis->pCurInstr->uOpcode == OP_NOP 244 // || pDis->pCurInstr->uOpcode == OP_LEA )); 245 return 0; 246 247 case OP_PARM_p: /* far pointer */ 248 if (pDis->uAddrMode == DISCPUMODE_32BIT) 249 return 6; /* 16:32 */ 250 if (pDis->uAddrMode == DISCPUMODE_64BIT) 251 return 12; /* 16:64 */ 252 return 4; /* 16:16 */ 253 254 case OP_PARM_s: /* lgdt, sgdt, lidt, sidt */ 255 return pDis->uCpuMode == DISCPUMODE_64BIT ? 2 + 8 : 2 + 4; 256 257 case OP_PARM_a: 258 return pDis->uOpMode == DISCPUMODE_16BIT ? 2 + 2 : 4 + 4; 259 260 case OP_PARM_pi: 261 return 8; 262 263 case OP_PARM_sd: 264 case OP_PARM_ss: 265 return 16; 266 267 case OP_PARM_x: 268 case OP_PARM_pd: 269 case OP_PARM_ps: 270 return VEXREG_IS256B(pDis->bVexDestReg) ? 32 : 16; //?? 271 272 case OP_PARM_y: 273 return pDis->uOpMode == DISCPUMODE_64BIT ? 4 : 8; //?? 274 275 case OP_PARM_z: 276 return pDis->uOpMode == DISCPUMODE_16BIT ? 2 : 4; //?? 277 278 default: 279 if (pParam->cb) 280 return pParam->cb; 281 /// @todo dangerous!!! 282 AssertMsgFailed(("subtype=%#x fParam=%#x fUse=%#RX64 op=%#x\n", subtype, pParam->fParam, pParam->fUse, 283 pDis->pCurInstr ? pDis->pCurInstr->uOpcode : 0)); 254 284 return 4; 255 285 } -
trunk/src/VBox/Disassembler/DisasmTables.cpp
r61017 r61135 696 696 OP("movupd %Vpd,%Wpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOVUPD, OP_PARM_Vpd, OP_PARM_Wpd, OP_PARM_NONE, DISOPTYPE_HARMLESS), 697 697 OP("movupd %Wpd,%Vpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOVUPD, OP_PARM_Wpd, OP_PARM_Vpd, OP_PARM_NONE, DISOPTYPE_HARMLESS), 698 OP("movlpd %Vq,%Ws", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOVLPD, OP_PARM_Vq, OP_PARM_Ws, OP_PARM_NONE, DISOPTYPE_HARMLESS),699 698 OP("movlpd %Vq,%Wq", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOVLPD, OP_PARM_Vq, OP_PARM_Wq, OP_PARM_NONE, DISOPTYPE_HARMLESS), 699 OP("movlpd %Wq,%Vq", IDX_ParseModRM, IDX_UseModRM, 0, OP_MOVLPD, OP_PARM_Wq, OP_PARM_Vq, OP_PARM_NONE, DISOPTYPE_HARMLESS), 700 700 OP("unpcklpd %Vpd,%Wq", IDX_ParseModRM, IDX_UseModRM, 0, OP_UNPCKLPD,OP_PARM_Vpd, OP_PARM_Wq, OP_PARM_NONE, DISOPTYPE_HARMLESS), 701 701 OP("unpckhpd %Vpd,%Wq", IDX_ParseModRM, IDX_UseModRM, 0, OP_UNPCKHPD,OP_PARM_Vpd, OP_PARM_Wq, OP_PARM_NONE, DISOPTYPE_HARMLESS), … … 762 762 OP("mulpd %Vpd,%Wpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MULPD, OP_PARM_Vpd, OP_PARM_Wpd, OP_PARM_NONE, DISOPTYPE_HARMLESS), 763 763 OP("cvtpd2ps %Vps,%Wpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_CVTPD2PS,OP_PARM_Vps, OP_PARM_Wpd, OP_PARM_NONE, DISOPTYPE_HARMLESS), 764 OP("cvtps2dq %V pq,%Wps", IDX_ParseModRM, IDX_UseModRM, 0, OP_CVTPS2DQ,OP_PARM_Vpq, OP_PARM_Wps, OP_PARM_NONE, DISOPTYPE_HARMLESS),764 OP("cvtps2dq %Vdq,%Wps", IDX_ParseModRM, IDX_UseModRM, 0, OP_CVTPS2DQ,OP_PARM_Vdq, OP_PARM_Wps, OP_PARM_NONE, DISOPTYPE_HARMLESS), 765 765 OP("subpd %Vpd,%Wpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_SUBPD, OP_PARM_Vpd, OP_PARM_Wpd, OP_PARM_NONE, DISOPTYPE_HARMLESS), 766 766 OP("minpd %Vpd,%Wpd", IDX_ParseModRM, IDX_UseModRM, 0, OP_MINPD, OP_PARM_Vpd, OP_PARM_Wpd, OP_PARM_NONE, DISOPTYPE_HARMLESS),
Note:
See TracChangeset
for help on using the changeset viewer.