• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# OpCodeType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OpCodeType的典型用法代码示例。如果您正苦于以下问题:C# OpCodeType类的具体用法?C# OpCodeType怎么用?C# OpCodeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OpCodeType类属于命名空间,在下文中一共展示了OpCodeType类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OpCode

		internal OpCode(string name, Code code, OperandType operandType, FlowControl flowControl, OpCodeType opCodeType, StackBehaviour push, StackBehaviour pop) {
			this.Name = name;
			this.Code = code;
			this.OperandType = operandType;
			this.FlowControl = flowControl;
			this.OpCodeType = opCodeType;
			this.StackBehaviourPush = push;
			this.StackBehaviourPop = pop;
			if (((ushort)code >> 8) == 0)
				OpCodes.OneByteOpCodes[(byte)code] = this;
			else if (((ushort)code >> 8) == 0xFE)
				OpCodes.TwoByteOpCodes[(byte)code] = this;
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:13,代码来源:OpCode.cs


示例2: OpCode

 internal OpCode(string name, byte op1, byte op2, int size, FlowControl flowControl,
     OpCodeType opCodeType, OperandType operandType,
     StackBehaviour pop, StackBehaviour push)
 {
     m_name = name;
     m_op1 = op1;
     m_op2 = op2;
     m_size = size;
     m_flowControl = flowControl;
     m_opCodeType = opCodeType;
     m_operandType = operandType;
     m_stackBehaviourPop = pop;
     m_stackBehaviourPush = push;
 }
开发者ID:leftouterjoin,项目名称:loj-prj1,代码行数:14,代码来源:OpCode.cs


示例3: OpCode

        internal OpCode(int x, int y)
        {
            m_op1 = (byte)((x >> 0) & 0xff);
            m_op2 = (byte)((x >> 8) & 0xff);
            m_code = (Code)((x >> 16) & 0xff);
            m_flowControl = (FlowControl)((x >> 24) & 0xff);
            m_size = 0;
            m_name = "";

            m_opCodeType = (OpCodeType)((y >> 0) & 0xff);
            m_operandType = (OperandType)((y >> 8) & 0xff);
            m_stackBehaviourPop = (StackBehaviour)((y >> 16) & 0xff);
            m_stackBehaviourPush = (StackBehaviour)((y >> 24) & 0xff);
        }
开发者ID:KenMacD,项目名称:deconfuser,代码行数:14,代码来源:OpCode.cs


示例4: OpCode

	internal OpCode(String stringname, StackBehaviour pop, StackBehaviour push, OperandType operand, OpCodeType type, int size, byte s1, byte s2, FlowControl ctrl, bool endsjmpblk, int stack)
	{
		m_stringname = stringname;
		m_pop = pop;
		m_push = push;
		m_operand = operand;
		m_type = type;
		m_size = size;
		m_s1 = s1;
		m_s2 = s2;
		m_ctrl = ctrl;
		m_endsUncondJmpBlk = endsjmpblk;
		m_stackChange = stack;

	}
开发者ID:ArildF,项目名称:masters,代码行数:15,代码来源:opcode.cs


示例5: VerifyOpCodeType

    private bool VerifyOpCodeType(OpCode op1, OpCodeType oct, string errNum)
    {
        bool retVal = true;

        try
        {
            if (op1.OpCodeType != oct)
            {
                TestLibrary.TestFramework.LogError(errNum, "Result is not the value as expected,OpCodeType is: " + op1.OpCodeType + ",Expected is: " + oct);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError(errNum, "Unexpected exception: " + e);
            retVal = false;
        }
        return retVal;
    }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:19,代码来源:opcodeopcodetype.cs


示例6: OpCode

	// Construct a new opcode.
	internal OpCode(String name, int value, FlowControl flowControl,
					OpCodeType opcodeType, OperandType operandType,
					StackBehaviour stackPop, StackBehaviour stackPush)
			{
				this.name = name;
				this.value = (short)value;
				this.flowControl = (byte)flowControl;
				this.opcodeType = (byte)opcodeType;
				this.operandType = (byte)operandType;
				if(value < 0x0100)
				{
					this.size = (byte)1;
				}
				else
				{
					this.size = (byte)2;
				}
				this.stackPop = (byte)stackPop;
				this.stackPush = (byte)stackPush;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:21,代码来源:OpCode.cs


示例7: OpCode

        internal OpCode(string name, byte op1, byte op2, int size,
			Code code, FlowControl flowControl,
			OpCodeType opCodeType, OperandType operandType,
			StackBehaviour pop, StackBehaviour push)
        {
            m_name = name;
            m_op1 = op1;
            m_op2 = op2;
            m_size = size;
            m_code = code;
            m_flowControl = flowControl;
            m_opCodeType = opCodeType;
            m_operandType = operandType;
            m_stackBehaviourPop = pop;
            m_stackBehaviourPush = push;

            if (op1 == 0xff)
                OpCodes.OneByteOpCode [op2] = this;
            else
                OpCodes.TwoBytesOpCode [op2] = this;
        }
开发者ID:NALSS,项目名称:Telegraph,代码行数:21,代码来源:OpCode.cs


示例8: CompareOpCode

 //verify the opcode fields
 //if not equal,retun the field name which contains error. 
 private CompareResult CompareOpCode(
     OpCode opcode,
     String stringname,
     StackBehaviour pop,
     StackBehaviour push,
     OperandType operand,
     OpCodeType type,
     int size,
     byte s1,
     byte s2,
     FlowControl ctrl)
 {
     CompareResult returnValue = CompareResult.Equal;
     if (opcode.Name != stringname) returnValue = returnValue | CompareResult.Name;
     if (opcode.StackBehaviourPop != pop) returnValue = returnValue | CompareResult.Pop;
     if (opcode.StackBehaviourPush != push) returnValue = returnValue | CompareResult.Push;
     if (opcode.OperandType != operand) returnValue = returnValue | CompareResult.OpenrandType;
     if (opcode.OpCodeType != type) returnValue = returnValue | CompareResult.OpCodeType;
     if (opcode.Size != size) returnValue = returnValue | CompareResult.Size;
     if (size == 2)
     {
         if (opcode.Value != ((short)(s1 << 8 | s2)))
         {
             returnValue = returnValue | CompareResult.Value;
         }
     }
     else
     {
         if (opcode.Value != ((short)s2))
         {
             returnValue = returnValue | CompareResult.Value;
         }
     }
     if (opcode.FlowControl != ctrl)
     {
         returnValue = returnValue | CompareResult.FlowControl;
     }
     return returnValue;
 }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:41,代码来源:opcodesstind_r4.cs


示例9: VerificationHelper

    private bool VerificationHelper(OpCode code,
        string name,
        StackBehaviour pop,
        StackBehaviour push,
        OperandType oprandType,
        OpCodeType type,
        int size,
        byte s1,
        byte s2,
        FlowControl ctrl,
        string errorno,
        string errordesp)
    {
        bool retVal = true;

        string actualName = code.Name;
        if (actualName != name)
        {
            TestLibrary.TestFramework.LogError(errorno + ".0", "Name returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualName = " + actualName + ", name = " + name);
            retVal = false;
        }

        StackBehaviour actualPop = code.StackBehaviourPop;
        if (actualPop != pop)
        {
            TestLibrary.TestFramework.LogError(errorno + ".1", "StackBehaviourPop returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualPop = " + actualPop + ", pop = " + pop);
            retVal = false;
        }

        StackBehaviour actualPush = code.StackBehaviourPush;
        if (actualPush != push)
        {
            TestLibrary.TestFramework.LogError(errorno + ".2", "StackBehaviourPush returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualPush = " + actualPush + ", push = " + push);
            retVal = false;
        }

        OperandType actualOperandType = code.OperandType;
        if (actualOperandType != oprandType)
        {
            TestLibrary.TestFramework.LogError(errorno + ".3", "OperandType returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualOperandType = " + actualOperandType + ", oprandType = " + oprandType);
            retVal = false;
        }

        OpCodeType actualOpCodeType = code.OpCodeType;
        if (actualOpCodeType != type)
        {
            TestLibrary.TestFramework.LogError(errorno + ".4", "OpCodeType returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualOpCodeType = " + actualOpCodeType + ", type = " + type);
            retVal = false;
        }

        int actualSize = code.Size;
        if (actualSize != size)
        {
            TestLibrary.TestFramework.LogError(errorno + ".5", "Size returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualSize = " + actualSize + ", size = " + size);
            retVal = false;
        }

        short expectedValue = 0;
        if (size == 2)
            expectedValue = (short)(s1 << 8 | s2);
        else
            expectedValue = (short)s2;

        short actualValue = code.Value;
        if (actualValue != expectedValue)
        {
            TestLibrary.TestFramework.LogError(errorno + ".6", "Value returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualValue = " + actualValue + ", s1 = " + s1 + ", s2 = " + s2 + ", expectedValue = " + expectedValue);
            retVal = false;
        }

        FlowControl actualCtrl = code.FlowControl;
        if (actualCtrl != ctrl)
        {
            TestLibrary.TestFramework.LogError(errorno + ".7", "FlowControl returns wrong value for OpCode " + errordesp);
            TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] actualCtrl = " + actualCtrl + ", ctrl = " + ctrl);
            retVal = false;
        }
        return retVal;
    }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:86,代码来源:opcodesprefix4.cs


示例10: VerifyAllTheFileds

    private bool VerifyAllTheFileds(OpCode opCode, 
                                    String opCodeName, 
                                    StackBehaviour pop, 
                                    StackBehaviour push, 
                                    OperandType operandType, 
                                    OpCodeType type, 
                                    int size, 
                                    byte s1, byte s2, 
                                    FlowControl ctrl, 
                                    string errorNum)
    {
        bool retVal = true;
        string errorDesc;

        string actualName = opCode.Name;
        if (actualName != opCodeName)
        {
            errorDesc = "Actual name of the specified MSIL instruction: \"" + actualName +
                        "\" does not equal expected name: \"" + opCodeName + "\"";
            TestLibrary.TestFramework.LogError( errorNum + ".1", errorDesc);
            retVal = false;
        }

        StackBehaviour actualStackBehaviourPop = opCode.StackBehaviourPop;
        if (actualStackBehaviourPop != pop)
        {
            errorDesc = "Actual pop statck behaviour of the specified MSIL instruction: (" + actualStackBehaviourPop +
                        ") does not equal expected pop stack behaviour: (" + pop + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".2", errorDesc);
            retVal = false;
        }

        StackBehaviour actualStackBehaviourPush = opCode.StackBehaviourPush;
        if (actualStackBehaviourPush != push)
        {
            errorDesc = "Actual push statck behaviour of the specified MSIL instruction: (" + actualStackBehaviourPush +
                        ") does not equal expected push stack behaviour: (" + push + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".3", errorDesc);
            retVal = false;
        }


        OperandType actualOperandType = opCode.OperandType;
        if (actualOperandType != operandType)
        {
            errorDesc = "Actual operand type of the specified MSIL instruction: (" + actualOperandType +
                        ") does not equal expected operand type: (" + operandType + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".4", errorDesc);
            retVal = false;
        }

        OpCodeType actualOpCodeType = opCode.OpCodeType;
        if (actualOpCodeType != type)
        {
            errorDesc = "Actual OpCode type of the specified MSIL instruction: (" + actualOpCodeType +
                        ") does not equal expected OpCode type: (" + type + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".5", errorDesc);
            retVal = false;
        }

        int actualSize = opCode.Size;
        if (actualSize != size)
        {
            errorDesc = "Actual size of the specified MSIL instruction: (" + actualSize +
                        ") does not equal expected size: (" + size + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".6", errorDesc);
            retVal = false;
        }

        short actualValue = opCode.Value;
        short expectedValue = (2 == size) ? (short)(s1 << 8 | s2) : s2;
        if (actualValue != expectedValue)
        {
            errorDesc = "Actual immediate operand value of the specified MSIL instruction: (" + actualValue +
                        ") does not equal expected immediate operand value: (" + expectedValue + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".7", errorDesc);
            retVal = false;
        }

        FlowControl actualCtrl = opCode.FlowControl;
        if (actualCtrl != ctrl)
        {
            errorDesc = "Actual flow control of the specified MSIL instruction: (" + actualCtrl +
                        ") does not equal expected flow control: (" + ctrl + ")";
            TestLibrary.TestFramework.LogError(errorNum + ".8", errorDesc);
            retVal = false;
        }

        return retVal;
    }
开发者ID:l1183479157,项目名称:coreclr,代码行数:90,代码来源:opcodesclt.cs


示例11: OpCodeByType

        /// <summary>
        ///		Chooses the correct byte code based on the data type.
        /// </summary>
        /// <param name="type">Type to find operation code from.</param>
        /// <returns>The correct opcode based on the data type.</returns>
        private OpCode OpCodeByType(DataTypeValue type, OpCodeType opCodeType)
        {
            switch (opCodeType)
            {
                case OpCodeType.ALLOCATE_HEAP:
                    switch (type.DataType)
                    {
                        case DataType.Null: return OpCode.ALLOCATE_HEAP_NULL;
                        case DataType.Bool: return OpCode.ALLOCATE_HEAP_BOOL;
                        case DataType.Byte: return OpCode.ALLOCATE_HEAP_BYTE;
                        case DataType.Double: return OpCode.ALLOCATE_HEAP_DOUBLE;
                        case DataType.Object: return OpCode.ALLOCATE_HEAP_Object;
                        case DataType.Float: return OpCode.ALLOCATE_HEAP_FLOAT;
                        case DataType.Int: return OpCode.ALLOCATE_HEAP_INT;
                        case DataType.Long: return OpCode.ALLOCATE_HEAP_LONG;
                        case DataType.Short: return OpCode.ALLOCATE_HEAP_SHORT;
                        case DataType.String: return OpCode.ALLOCATE_HEAP_STRING;
                    }
                    break;
                case OpCodeType.CAST:
                    switch (type.DataType)
                    {
                        case DataType.Null: return OpCode.CAST_NULL;
                        case DataType.Bool: return OpCode.CAST_BOOL;
                        case DataType.Byte: return OpCode.CAST_BYTE;
                        case DataType.Double: return OpCode.CAST_DOUBLE;
                        case DataType.Object: return OpCode.CAST_Object;
                        case DataType.Float: return OpCode.CAST_FLOAT;
                        case DataType.Int: return OpCode.CAST_INT;
                        case DataType.Long: return OpCode.CAST_LONG;
                        case DataType.Short: return OpCode.CAST_SHORT;
                        case DataType.String: return OpCode.CAST_STRING;
                    }
                    break;
                case OpCodeType.CMP:

                    // If its an array or reference we need to compare the
                    // memory index not the value.
                    if (type.IsArray == true || type.IsReference == true)
                    {
                        return OpCode.CMP_MEMORY_INDEX;
                    }

                    switch (type.DataType)
                    {
                        case DataType.Null: return OpCode.CMP_NULL;
                        case DataType.Bool: return OpCode.CMP_BOOL;
                        case DataType.Byte: return OpCode.CMP_BYTE;
                        case DataType.Double: return OpCode.CMP_DOUBLE;
                        case DataType.Object: return OpCode.CMP_Object;
                        case DataType.Float: return OpCode.CMP_FLOAT;
                        case DataType.Int: return OpCode.CMP_INT;
                        case DataType.Long: return OpCode.CMP_LONG;
                        case DataType.Short: return OpCode.CMP_SHORT;
                        case DataType.String: return OpCode.CMP_STRING;
                    }
                    break;
                case OpCodeType.PUSH:

                    // If its an array or reference we need to push the
                    // memory index not the value.
                    if (type.IsArray == true || type.IsReference == true)
                    {
                        return OpCode.PUSH_MEMORY_INDEX;
                    }

                    switch (type.DataType)
                    {
                        case DataType.Null: return OpCode.PUSH_NULL;
                        case DataType.Bool: return OpCode.PUSH_BOOL;
                        case DataType.Byte: return OpCode.PUSH_BYTE;
                        case DataType.Double: return OpCode.PUSH_DOUBLE;
                        case DataType.Object: return OpCode.PUSH_OBJECT;
                        case DataType.Float: return OpCode.PUSH_FLOAT;
                        case DataType.Int: return OpCode.PUSH_INT;
                        case DataType.Long: return OpCode.PUSH_LONG;
                        case DataType.Short: return OpCode.PUSH_SHORT;
                        case DataType.String: return OpCode.PUSH_STRING;
                    }
                    break;
                case OpCodeType.POP:

                    // If its an array or reference we need to pop the
                    // memory index not the value.
                    if (type.IsArray == true || type.IsReference == true)
                    {
                        return OpCode.POP_MEMORY_INDEX;
                    }

                    switch (type.DataType)
                    {
                        case DataType.Null: return OpCode.POP_NULL;
                        case DataType.Bool: return OpCode.POP_BOOL;
                        case DataType.Byte: return OpCode.POP_BYTE;
                        case DataType.Double: return OpCode.POP_DOUBLE;
//.........这里部分代码省略.........
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:101,代码来源:Compiler.cs


示例12: OpCode

 internal OpCode(OpCodeValues value, int flags)
 {
     m_stringname = null; // computed lazily
     m_pop = (StackBehaviour)((flags >> StackBehaviourPopShift) & StackBehaviourMask);
     m_push = (StackBehaviour)((flags >> StackBehaviourPushShift) & StackBehaviourMask);
     m_operand = (OperandType)(flags & OperandTypeMask);
     m_type = (OpCodeType)((flags >> OpCodeTypeShift) & OpCodeTypeMask);
     m_size = (flags >> SizeShift) & SizeMask;
     m_s1 = (byte)((int)value >> 8);
     m_s2 = (byte)(int)value;
     m_ctrl = (FlowControl)((flags >> FlowControlShift) & FlowControlMask);
     m_endsUncondJmpBlk = (flags & EndsUncondJmpBlkFlag) != 0;
     m_stackChange = (flags >> StackChangeShift);
 }
开发者ID:ChuangYang,项目名称:coreclr,代码行数:14,代码来源:Opcode.cs


示例13: OpCode

		internal OpCode (byte op1, byte op2,
			Code code, FlowControl flowControl,
			OpCodeType opCodeType, OperandType operandType,
			StackBehaviour pop, StackBehaviour push)
		{
			m_value = (short) ((op1 << 8) | op2);
			m_code = (byte) code;
			m_flowControl = (byte) flowControl;
			m_opCodeType = (byte) opCodeType;
			m_operandType = (byte) operandType;
			m_stackBehaviourPop = (byte) pop;
			m_stackBehaviourPush = (byte) push;

			if (op1 == 0xff)
				OpCodes.OneByteOpCode [op2] = this;
			else
				OpCodes.TwoBytesOpCode [op2] = this;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:18,代码来源:OpCode.cs



注:本文中的OpCodeType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OpType类代码示例发布时间:2022-05-24
下一篇:
C# OpCode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap