Changeset 41720 in vbox for trunk/src/VBox/Disassembler
- Timestamp:
- Jun 14, 2012 6:18:10 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp
r41719 r41720 668 668 669 669 PUT_FAR(); 670 if (DISUSE_IS_EFFECTIVE_ADDR(pParam->fUse)) 670 uint32_t const fUse = pParam->fUse; 671 if (DISUSE_IS_EFFECTIVE_ADDR(fUse)) 671 672 { 672 673 /* Work around mov seg,[mem16] and mov [mem16],seg as these always make a 16-bit mem … … 680 681 } 681 682 if ( (fFlags & DIS_FMT_FLAGS_STRICT) 682 && ( pParam->fUse & (DISUSE_DISPLACEMENT8 | DISUSE_DISPLACEMENT16 | DISUSE_DISPLACEMENT32 | DISUSE_DISPLACEMENT64 | DISUSE_RIPDISPLACEMENT32)))683 && (fUse & (DISUSE_DISPLACEMENT8 | DISUSE_DISPLACEMENT16 | DISUSE_DISPLACEMENT32 | DISUSE_DISPLACEMENT64 | DISUSE_RIPDISPLACEMENT32))) 683 684 { 684 if ( ( pParam->fUse & DISUSE_DISPLACEMENT8)685 if ( (fUse & DISUSE_DISPLACEMENT8) 685 686 && !pParam->uDisp.i8) 686 687 PUT_SZ("byte "); 687 else if ( ( pParam->fUse & DISUSE_DISPLACEMENT16)688 else if ( (fUse & DISUSE_DISPLACEMENT16) 688 689 && (int8_t)pParam->uDisp.i16 == (int16_t)pParam->uDisp.i16) 689 690 PUT_SZ("word "); 690 else if ( ( pParam->fUse & DISUSE_DISPLACEMENT32)691 else if ( (fUse & DISUSE_DISPLACEMENT32) 691 692 && (int16_t)pParam->uDisp.i32 == (int32_t)pParam->uDisp.i32) //?? 692 693 PUT_SZ("dword "); 693 else if ( ( pParam->fUse & DISUSE_DISPLACEMENT64)694 else if ( (fUse & DISUSE_DISPLACEMENT64) 694 695 && (pCpu->SIB.Bits.Base != 5 || pCpu->ModRM.Bits.Mod != 0) 695 696 && (int32_t)pParam->uDisp.i64 == (int64_t)pParam->uDisp.i64) //?? 696 697 PUT_SZ("qword "); 697 698 } 698 if (DISUSE_IS_EFFECTIVE_ADDR( pParam->fUse))699 if (DISUSE_IS_EFFECTIVE_ADDR(fUse)) 699 700 PUT_SEGMENT_OVERRIDE(); 700 701 701 bool fBase = (pParam->fUse & DISUSE_BASE) /* When exactly is DISUSE_BASE supposed to be set? disasmModRMReg doesn't set it. */ 702 || ( (pParam->fUse & ( DISUSE_REG_GEN8 703 | DISUSE_REG_GEN16 704 | DISUSE_REG_GEN32 705 | DISUSE_REG_GEN64 706 | DISUSE_REG_FP 707 | DISUSE_REG_MMX 708 | DISUSE_REG_XMM 709 | DISUSE_REG_CR 710 | DISUSE_REG_DBG 711 | DISUSE_REG_SEG 712 | DISUSE_REG_TEST 713 )) 714 && !DISUSE_IS_EFFECTIVE_ADDR(pParam->fUse)); 702 bool fBase = (fUse & DISUSE_BASE) /* When exactly is DISUSE_BASE supposed to be set? disasmModRMReg doesn't set it. */ 703 || ( (fUse & ( DISUSE_REG_GEN8 704 | DISUSE_REG_GEN16 705 | DISUSE_REG_GEN32 706 | DISUSE_REG_GEN64 707 | DISUSE_REG_FP 708 | DISUSE_REG_MMX 709 | DISUSE_REG_XMM 710 | DISUSE_REG_CR 711 | DISUSE_REG_DBG 712 | DISUSE_REG_SEG 713 | DISUSE_REG_TEST )) 714 && !DISUSE_IS_EFFECTIVE_ADDR(fUse)); 715 715 if (fBase) 716 716 { … … 720 720 } 721 721 722 if ( pParam->fUse & DISUSE_INDEX)722 if (fUse & DISUSE_INDEX) 723 723 { 724 724 if (fBase) … … 729 729 PUT_STR(pszReg, cchReg); 730 730 731 if ( pParam->fUse & DISUSE_SCALE)731 if (fUse & DISUSE_SCALE) 732 732 { 733 733 PUT_C('*'); … … 736 736 } 737 737 else 738 Assert(!( pParam->fUse & DISUSE_SCALE));739 740 if ( pParam->fUse & (DISUSE_DISPLACEMENT8 | DISUSE_DISPLACEMENT16 | DISUSE_DISPLACEMENT32 | DISUSE_DISPLACEMENT64 | DISUSE_RIPDISPLACEMENT32))738 Assert(!(fUse & DISUSE_SCALE)); 739 740 if (fUse & (DISUSE_DISPLACEMENT8 | DISUSE_DISPLACEMENT16 | DISUSE_DISPLACEMENT32 | DISUSE_DISPLACEMENT64 | DISUSE_RIPDISPLACEMENT32)) 741 741 { 742 742 int64_t off2; 743 if ( pParam->fUse & DISUSE_DISPLACEMENT8)743 if (fUse & DISUSE_DISPLACEMENT8) 744 744 off2 = pParam->uDisp.i8; 745 else if ( pParam->fUse & DISUSE_DISPLACEMENT16)745 else if (fUse & DISUSE_DISPLACEMENT16) 746 746 off2 = pParam->uDisp.i16; 747 else if ( pParam->fUse & (DISUSE_DISPLACEMENT32 | DISUSE_RIPDISPLACEMENT32))747 else if (fUse & (DISUSE_DISPLACEMENT32 | DISUSE_RIPDISPLACEMENT32)) 748 748 off2 = pParam->uDisp.i32; 749 else if ( pParam->fUse & DISUSE_DISPLACEMENT64)749 else if (fUse & DISUSE_DISPLACEMENT64) 750 750 off2 = pParam->uDisp.i64; 751 751 else … … 755 755 } 756 756 757 if (fBase || ( pParam->fUse & DISUSE_INDEX))757 if (fBase || (fUse & DISUSE_INDEX)) 758 758 { 759 759 PUT_C(off2 >= 0 ? '+' : '-'); … … 761 761 off2 = -off2; 762 762 } 763 if ( pParam->fUse & DISUSE_DISPLACEMENT8)763 if (fUse & DISUSE_DISPLACEMENT8) 764 764 PUT_NUM_8( off2); 765 else if ( pParam->fUse & DISUSE_DISPLACEMENT16)765 else if (fUse & DISUSE_DISPLACEMENT16) 766 766 PUT_NUM_16(off2); 767 else if ( pParam->fUse & DISUSE_DISPLACEMENT32)767 else if (fUse & DISUSE_DISPLACEMENT32) 768 768 PUT_NUM_32(off2); 769 else if ( pParam->fUse & DISUSE_DISPLACEMENT64)769 else if (fUse & DISUSE_DISPLACEMENT64) 770 770 PUT_NUM_64(off2); 771 771 else … … 776 776 } 777 777 778 if (DISUSE_IS_EFFECTIVE_ADDR( pParam->fUse))778 if (DISUSE_IS_EFFECTIVE_ADDR(fUse)) 779 779 PUT_C(']'); 780 780 break;
Note:
See TracChangeset
for help on using the changeset viewer.