GetName() публичный статический Метод

Gets the name.
public static GetName ( object value ) : string
value object The value.
Результат string
Пример #1
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static TRType GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is TRType)
            {
                return(value as TRType);
            }

            switch (Register.GetName(value))
            {
            case "TR3":
                return(TR.TR3);

            case "TR4":
                return(TR.TR4);

            case "TR5":
                return(TR.TR5);

            case "TR6":
                return(TR.TR6);

            case "TR7":
                return(TR.TR7);

            default:
                throw new EngineException("Unknown TR Register '" + value.ToString() + "'");
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static CRType GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is CRType)
            {
                return(value as CRType);
            }

            switch (Register.GetName(value))
            {
            case "CR0":
                return(CR.CR0);

            case "CR2":
                return(CR.CR2);

            case "CR3":
                return(CR.CR3);

            case "CR4":
                return(CR.CR4);

            default:
                throw new EngineException("Unknown CR Register '" + value.ToString() + "'");
            }
        }
Пример #3
0
        /// <summary>
        /// Given the name of an x86 32-bit register, this function returns the constant
        /// object that represents that register to the AOT
        /// </summary>
        /// <param name="value">The name of the x86 32-bit register to retrieve or a R32Type value</param>
        /// <returns>Returns an instance of R32Type that represents an x86 32-bit register</returns>
        public static R32Type GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is R32Type)
            {
                return(value as R32Type);
            }

            switch (Register.GetName(value))
            {
            case "EAX":
                return(R32.EAX);

            case "EBX":
                return(R32.EBX);

            case "ECX":
                return(R32.ECX);

            case "EDX":
                return(R32.EDX);

            case "ESP":
                return(R32.ESP);

            case "EBP":
                return(R32.EBP);

            case "ESI":
                return(R32.ESI);

            case "EDI":
                return(R32.EDI);

            default:
                throw new EngineException("Unknown R32 Register '" + value.ToString() + "'");
            }
        }
Пример #4
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static R16Type GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is R16Type)
            {
                return(value as R16Type);
            }

            switch (Register.GetName(value))
            {
            case "AX":
                return(R16.AX);

            case "BX":
                return(R16.BX);

            case "CX":
                return(R16.CX);

            case "DX":
                return(R16.DX);

            case "SP":
                return(R16.SP);

            case "BP":
                return(R16.BP);

            case "SI":
                return(R16.SI);

            case "DI":
                return(R16.DI);

            default:
                throw new EngineException("Unknown R16 Register '" + value.ToString() + "'");
            }
        }
Пример #5
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static FPType GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is FPType)
            {
                return(value as FPType);
            }

            switch (Register.GetName(value))
            {
            case "ST0":
                return(FP.ST0);

            case "ST1":
                return(FP.ST1);

            case "ST2":
                return(FP.ST2);

            case "ST3":
                return(FP.ST3);

            case "ST4":
                return(FP.ST4);

            case "ST5":
                return(FP.ST5);

            case "ST6":
                return(FP.ST6);

            case "ST7":
                return(FP.ST7);

            default:
                throw new EngineException("Unknown FP Register '" + value.ToString() + "'");
            }
        }
Пример #6
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static R8Type GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is R8Type)
            {
                return(value as R8Type);
            }

            switch (Register.GetName(value))
            {
            case "AL":
                return(R8.AL);

            case "AH":
                return(R8.AH);

            case "BL":
                return(R8.BL);

            case "BH":
                return(R8.BH);

            case "CL":
                return(R8.CL);

            case "CH":
                return(R8.CH);

            case "DL":
                return(R8.DL);

            case "DH":
                return(R8.DH);

            default:
                throw new EngineException("Unknown R8 Register '" + value.ToString() + "'");
            }
        }
Пример #7
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static DRType GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is DRType)
            {
                return(value as DRType);
            }

            switch (Register.GetName(value))
            {
            case "DR0":
                return(DR.DR0);

            case "DR1":
                return(DR.DR1);

            case "DR2":
                return(DR.DR2);

            case "DR3":
                return(DR.DR3);

            case "DR4":
                return(DR.DR4);

            case "DR6":
                return(DR.DR6);

            case "DR7":
                return(DR.DR7);

            default:
                throw new EngineException("Unknown DR Register '" + value.ToString() + "'");
            }
        }
Пример #8
0
        /// <summary>
        /// Gets the by ID.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static SegType GetByID(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is SegType)
            {
                return(value as SegType);
            }

            switch (Register.GetName(value))
            {
            case "DS":
                return(Seg.DS);

            case "ES":
                return(Seg.ES);

            case "CS":
                return(Seg.CS);

            case "SS":
                return(Seg.SS);

            case "FS":
                return(Seg.FS);

            case "GS":
                return(Seg.GS);

            default:
                throw new EngineException("Unknown Seg Register '" + value.ToString() + "'");
            }
        }