SharpDisasm/Operand.cs
/// <summary>
/// Converts the key components of the operand to a string.
/// </summary>
/// <returns>The operand in string format suitable for diagnostics.</returns>
Converts the key components of the operand to a string.
Converts the key components of the operand to a string .
public override string ToString()
        {
            if (Type == ud_type.UD_OP_REG)
            {
                return String.Format("{0,-10}", String.Format("{0},", Base));
            }
            else if (Type == ud_type.UD_OP_MEM)
            {
                string memSize = "";
                switch (Size)
                {
                    case 8:
                        memSize = "BYTE ";
                        break;
                    case 16:
                        memSize = "WORD ";
                        break;
                    case 32:
                        memSize = "DWORD ";
                        break;
                    case 64:
                        memSize = "QWORD ";
                        break;
                }
                return String.Format("{0}{4}[{1}{2}{3:x}],", "", (Base == ud_type.UD_NONE ? "" : String.Format("{0}+", Base)), (Index == ud_type.UD_NONE ? "" : String.Format("({0}*{1})", Index, (Scale == 0 ? 1 : Scale))), PrintDisplacementAddress(), memSize);
            }
            else
                return String.Format("{0}{1}{2}{3:x},", "", (Base == ud_type.UD_NONE ? "" : String.Format("{0}+", Base)), (Index == ud_type.UD_NONE ? "" : String.Format("({0}*{1})", Index, (Scale == 0 ? 1 : Scale))), RawValue);
        }
public override string ToString ( ) { if ( Type == ud_type . UD_OP_REG ) { return String . Format ( " " , String . Format ( " " , Base ) ) ; } else if ( Type == ud_type . UD_OP_MEM ) { string memSize = " " ; switch ( Size ) { case 8 : memSize = " " ; break ; case 16 : memSize = " " ; break ; case 32 : memSize = " " ; break ; case 64 : memSize = " " ; break ; } return String . Format ( " " , " " , ( Base == ud_type . UD_NONE ? " " : String . Format ( " " , Base ) ) , ( Index == ud_type . UD_NONE ? " " : String . Format ( " " , Index , ( Scale == 0 ? 1 : Scale ) ) ) , PrintDisplacementAddress ( ) , memSize ) ; } else return String . Format ( " " , " " , ( Base == ud_type . UD_NONE ? " " : String . Format ( " " , Base ) ) , ( Index == ud_type . UD_NONE ? " " : String . Format ( " " , Index , ( Scale == 0 ? 1 : Scale ) ) ) , RawValue ) ; }
Converts the key components of the operand to a string.
Converts the key components of the operand to a string .
The operand in string format suitable for diagnostics.
The operand in string format suitable for diagnostics .