当前位置: 首页>>代码示例>>C#>>正文


C# Opcode类代码示例

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


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

示例1: Instruction

 public Instruction(Location location, Opcode opcode)
     : this()
 {
     OperationCode = opcode;
     Argument = 0;
     Location = location;
 }
开发者ID:iwatakeshi,项目名称:Iodine,代码行数:7,代码来源:Instruction.cs

示例2: WithOpcode

        public IFrameBuilder WithOpcode(Opcode opcode)
        {
            switch(opcode)
            {
                case(Opcode.Binary):
                    _opcode = new byte[] { 0, 0, 1, 0 };
                    break;
                case(Opcode.ConnectionClose):
                    _opcode = new byte[] { 1, 0, 0, 0 };
                    break;
                case (Opcode.Continuation):
                    _isFinal = 0;
                    _opcode = new byte[] { 0, 0, 0, 0 };
                    break;
                case (Opcode.Ping):
                    _opcode = new byte[] { 1, 0, 0, 1 };
                    break;
                case (Opcode.Pong):
                    _opcode = new byte[] { 1, 0, 1, 0 };
                    break;
                case (Opcode.Text):
                    _opcode = new byte[] { 0, 0, 0, 1 };
                    break;
                default:
                    _isFinal = 1;
                    break;
            }

            return this;
        }
开发者ID:roffster,项目名称:WuSS,代码行数:30,代码来源:Hybi10ControlFrameBuilder.cs

示例3: Decode

        public void Decode()
        {
            Opcode = (Opcode)_machine.Memory[_machine.IP++];

            var b1 = _machine.Memory[_machine.IP++];
            var b2 = _machine.Memory[_machine.IP++];
            var b3 = _machine.Memory[_machine.IP++];

            var left = b1 >> 4;
            var leftPtr = (b3 & 0x80) != 0;
            var leftOffset = (b3 & 0x40) != 0;
            var leftOffsetReg = b2 >> 4;
            var leftType = (b3 >> 4) & 0x03;
            var leftPayload = ReadPayload(left);

            var right = b1 & 0x0F;
            var rightPtr = (b3 & 0x08) != 0;
            var rightOffset = (b3 & 0x04) != 0;
            var rightOffsetReg = b2 & 0x0F;
            var rightType = b3 & 0x03;
            var rightPayload = ReadPayload(right);

            Left.Change(left, leftType, leftPtr, leftOffset, leftOffsetReg, leftPayload);
            Right.Change(right, rightType, rightPtr, rightOffset, rightOffsetReg, rightPayload);
        }
开发者ID:Rohansi,项目名称:LoonyVM,代码行数:25,代码来源:Instruction.cs

示例4: unchecked

		/// <summary>
		/// push simple value (this, null, false, ...)
		/// </summary>
		void Parser.IGenerator.Push( Opcode opcode )
		{
			var start = ValsAt;
			Vneed( 5 );
			Vpush( unchecked((byte)opcode) );
			Vpush( start );
		}//Parser.IGenerator.Push
开发者ID:firda-cze,项目名称:bee,代码行数:10,代码来源:code-vals.cs

示例5: Instruction

		public Instruction (SourceLocation location, Opcode opcode, int arg)
			: this ()
		{
			OperationCode = opcode;
			Argument = arg;
			Location = location;
		}
开发者ID:GruntTheDivine,项目名称:Iodine,代码行数:7,代码来源:Instruction.cs

示例6: ParserAttribute

 // [addedInVersion, removedInVersion[
 public ParserAttribute(Opcode opcode, ClientVersionBuild addedInVersion, ClientVersionBuild removedInVersion)
 {
     if (ClientVersion.AddedInVersion(addedInVersion) && ClientVersion.RemovedInVersion(removedInVersion))
         Opcode = Opcodes.GetOpcode(opcode);
     else
         Opcode = 0;
 }
开发者ID:kandera,项目名称:WowPacketParser,代码行数:8,代码来源:ParserAttribute.cs

示例7: AssemblerInstruction

 public AssemblerInstruction()
 {
     Line = -1;
     Opcode = Opcode.None;
     Left = null;
     Right = null;
 }
开发者ID:Rohansi,项目名称:Programe,代码行数:7,代码来源:AssemblerInstruction.cs

示例8: Binary

		}//Literal
		
		protected override void Binary( Opcode op, byte[] code, ref int at )
		{
			var paren = Parens;
			if( paren )
			{
				Write( '(' );
			}
			if( op == Opcode.Cast )
			{
				Typeref( code, ref at );
				Write( "! " );
				Expression( code, ref at );
				if( paren )
				{
					Write( ')' );
				}
				return;
			}
			Expression( code, ref at );
			Write( ' ' );
			Write( op.Text() );
			Write( ' ' );
			if( (op == Opcode.LogicAnd) || (op == Opcode.LogicOr) )
			{
				at += 4;
			}
			Expression( code, ref at );
			if( paren )
			{
				Write( ')' );
			}
		}//Binary
开发者ID:firda-cze,项目名称:bee,代码行数:34,代码来源:bsgen-expr.cs

示例9: Unary

		}//Binary
		
		protected override void Unary( Opcode op, byte[] code, ref int at )
		{
			var paren = Parens;
			if( paren )
			{
				Write( '(' );
			}
			var text = op.Text();
			var post = op.Postfix();
			if( !post )
			{
				Write( text );
				if( text.Length > 2 )
				{
					Write( ' ' );
				}
			}
			Expression( code, ref at );
			if( post )
			{
				Write( text );
			}
			if( paren )
			{
				Write( ')' );
			}
		}//Unary
开发者ID:firda-cze,项目名称:bee,代码行数:29,代码来源:bsgen-expr.cs

示例10: ShiftOperand

 public ShiftOperand(MachineOperand op, Opcode opcode, MachineOperand shAmt)
     : base(op.Width)
 {
     this.Operand = op;
     this.Opcode = opcode;
     this.Shift = shAmt;
 }
开发者ID:killbug2004,项目名称:reko,代码行数:7,代码来源:ShiftOperand.cs

示例11: Literal

		}//Parens
		
		protected override void Literal( Opcode op, byte[] code, ref int at )
		{
			if( op != Opcode.Ident )
			{
				base.Literal( op, code, ref at );
				return;
			}
			var n = code[at++];
			var s = Encoding.UTF8.GetString( code, at, n );
			at += n;
			if( Aliasing == Alias.None )
			{
				if( s[0] == '$' )
				{
					s = s.Substring( 1 );
				}
				if( HasBuiltin( s ) )
				{
					Write( '@' );
				}
				Write( s );
				return;
			}
			if( Inside == Opcode.Dot )
			{
				Name.Append( s );
				return;
			}
			Write( Unalias( s ) );
		}//Literal
开发者ID:firda-cze,项目名称:bee,代码行数:32,代码来源:csgen-expr.cs

示例12: Request

        public Request()
        {
            _recursionDesired = true;
            Opcode = Opcode.StandardQuery;

            _questions = new List<Query>();
        }
开发者ID:nnikos123,项目名称:sharppjsip,代码行数:7,代码来源:Request.cs

示例13: IsServerMessage

		public static bool IsServerMessage(Opcode opcode)
		{
			if ((ushort)opcode > 10000 && (ushort)opcode < 20000)
			{
				return true;
			}
			return false;
		}
开发者ID:adan830,项目名称:Egametang,代码行数:8,代码来源:OpcodeHelper.cs

示例14: Packet

 public Packet(Opcode opc)
 {
     Opcode = opc;
     Length = 0;  // whole packet size
     Buffer  = new byte[4096];
     currentByteCount = 4;
     currentReadIndex = 4;
 }
开发者ID:gdpaulmil,项目名称:WPF_ServerClient,代码行数:8,代码来源:Packet.cs

示例15: StorageCommand

 public StorageCommand(Opcode cmdType, string key, uint flags, long expirationTimeInSeconds, int dataSize)
     : base(cmdType)
 {
     _key = key;
     _flags = flags;
     _expirationTimeInSeconds = expirationTimeInSeconds;
     _dataSize = dataSize;
 }
开发者ID:javithalion,项目名称:NCache,代码行数:8,代码来源:StorageCommand.cs


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