Ejemplo n.º 1
0
        /// <summary>
        /// Adjusts this <see cref="Operand"/> based on the specified <see cref="X86Instruction.OperandDescriptor"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> used to adjust.</param>
        /// <remarks>
        /// Only <see cref="X86Instruction.OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
        /// <see langword="true"/> may be used as a parameter to this method.
        /// </remarks>
        internal override void Adjust(X86Instruction.OperandDescriptor descriptor)
        {
            this.asExtraImmediate = (descriptor.OperandEncoding == X86Instruction.OperandEncoding.ExtraImmediate);

            Contract.Assume(this.PreferredSize == DataSize.None || this.PreferredSize <= descriptor.Size);
            this.PreferredSize = descriptor.Size;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case X86Instruction.OperandType.FarPointer:
                return(this.Size == descriptor.Size);

            default:
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case X86Instruction.OperandType.Immediate:
                return(this.Size == DataSize.None || this.Size <= descriptor.Size);

            default:
                return(false);
            }
        }
Ejemplo n.º 4
0
		/// <summary>
		/// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
		/// <see cref="Operand"/>.
		/// </summary>
		/// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
		/// <returns><see langword="true"/> when the specified descriptor matches this operand;
		/// otherwise, <see langword="false"/>.</returns>
		internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
		{
			switch (descriptor.OperandType)
			{
				case X86Instruction.OperandType.RegisterOrMemoryOperand:
					return this.Size == descriptor.RegisterType.GetSize();
				case X86Instruction.OperandType.MemoryOperand:
					return this.Size == descriptor.Size;
				default:
					return false;
			}
		}
Ejemplo n.º 5
0
        /// <summary>
        /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case X86Instruction.OperandType.RegisterOperand:
                return(descriptor.RegisterType.HasFlag(this.Register.GetRegisterType()));

            case X86Instruction.OperandType.FixedRegister:
                return(this.Register == descriptor.FixedRegister);

            default:
                return(false);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
        {
            throw new NotImplementedException();
#if false
            switch (descriptor.OperandType)
            {
            case Instruction.OperandType.RegisterOperand:
                break;

            default:
                return(false);
            }
#endif
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified
 /// <see cref="X86Instruction.OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> used to
 /// adjust.</param>
 /// <remarks>
 /// Only <see cref="X86Instruction.OperandDescriptor"/> instances for which <see cref="IsMatch"/>
 /// returns <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 internal override void Adjust(X86Instruction.OperandDescriptor descriptor)
 {
     // When the operand needs to be added to the opcode, set it as such.
     if (descriptor.OperandEncoding == X86Instruction.OperandEncoding.OpcodeAdd)
     {
         this.Encoding = OperandEncoding.AddToOpcode;
     }
     else if (descriptor.OperandType == X86Instruction.OperandType.FixedRegister)
     {
         this.Encoding = OperandEncoding.Ignore;
     }
     else
     {
         this.Encoding = OperandEncoding.Default;
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="X86Instruction.OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="X86Instruction.OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 internal abstract void Adjust(X86Instruction.OperandDescriptor descriptor);
Ejemplo n.º 9
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="X86Instruction.OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="X86Instruction.OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 void IConstructableOperand.Adjust(X86Instruction.OperandDescriptor descriptor)
 {
     this.Adjust(descriptor);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 internal abstract bool IsMatch(X86Instruction.OperandDescriptor descriptor);
Ejemplo n.º 11
0
 /// <summary>
 /// Determines whether the specified <see cref="X86Instruction.OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 bool IConstructableOperand.IsMatch(X86Instruction.OperandDescriptor descriptor)
 {
     return(this.IsMatch(descriptor));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="X86Instruction.OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="X86Instruction.OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="X86Instruction.OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 internal override void Adjust(X86Instruction.OperandDescriptor descriptor)
 {
     // Nothing to do.
 }
 public void Adjust(X86Instruction.OperandDescriptor descriptor)
 {
     Contract.Requires <ArgumentNullException>(descriptor != null);
     Contract.Requires <ArgumentException>(IsMatch(descriptor));
 }
            public bool IsMatch(X86Instruction.OperandDescriptor descriptor)
            {
                Contract.Requires <ArgumentNullException>(descriptor != null);

                return(default(bool));
            }
Ejemplo n.º 15
0
 internal override void Adjust(X86Instruction.OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 16
0
 internal override bool IsMatch(X86Instruction.OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }