Пример #1
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     if (descriptor.OperandType == OperandType.FarPointer)
     {
         return(Size == descriptor.Size);
     }
     return(false);
 }
Пример #2
0
        /// <summary>
        /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        public override bool IsMatch(OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case OperandType.RelativeOffset:
                return(Size == DataSize.None || Size <= descriptor.Size);

            default:
                return(false);
            }
        }
        /// <summary>
        /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        public override bool IsMatch(OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case OperandType.RegisterOrMemoryOperand:
                return(Size == descriptor.RegisterType.GetSize());

            case OperandType.MemoryOperand:
                return(Size == descriptor.Size);

            default:
                return(false);
            }
        }
        /// <summary>
        /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
        /// <see cref="Operand"/>.
        /// </summary>
        /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
        /// <returns><see langword="true"/> when the specified descriptor matches this operand;
        /// otherwise, <see langword="false"/>.</returns>
        public override bool IsMatch(OperandDescriptor descriptor)
        {
            switch (descriptor.OperandType)
            {
            case OperandType.RegisterOrMemoryOperand:
            case OperandType.RegisterOperand:
                return(descriptor.RegisterType.HasFlag(Register.Type));

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

            default:
                return(false);
            }
        }
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified
 /// <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to
 /// adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/>
 /// returns <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public override void Adjust(OperandDescriptor descriptor)
 {
     // When the operand needs to be added to the opcode, set it as such.
     if (descriptor.OperandEncoding == X86.OperandEncoding.OpcodeAdd)
     {
         Encoding = OperandEncoding.AddToOpcode;
     }
     else if (descriptor.OperandType == OperandType.RegisterOrMemoryOperand)
     {
         Encoding = OperandEncoding.ModRm;
     }
     else if (descriptor.OperandType == OperandType.FixedRegister)
     {
         Encoding = OperandEncoding.Ignore;
     }
     else
     {
         Encoding = OperandEncoding.Default;
     }
 }
Пример #6
0
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public override void Adjust(OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     switch (descriptor.OperandType)
     {
         case OperandType.RegisterOrMemoryOperand:
         case OperandType.RegisterOperand:
             return descriptor.RegisterType.HasFlag(Register.Type);
         case OperandType.FixedRegister:
             return Register == descriptor.FixedRegister;
         default:
             return false;
     }
 }
Пример #9
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified
 /// <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to
 /// adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/>
 /// returns <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public override void Adjust(OperandDescriptor descriptor)
 {
     // When the operand needs to be added to the opcode, set it as such.
     if (descriptor.OperandEncoding == X86.OperandEncoding.OpcodeAdd)
         Encoding = OperandEncoding.AddToOpcode;
     else if (descriptor.OperandType == OperandType.RegisterOrMemoryOperand)
         Encoding = OperandEncoding.ModRm;
     else if (descriptor.OperandType == OperandType.FixedRegister)
         Encoding = OperandEncoding.Ignore;
     else
         Encoding = OperandEncoding.Default;
 }
Пример #10
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public override void Adjust(OperandDescriptor descriptor)
 {
     asExtraImmediate = (descriptor.OperandEncoding == OperandEncoding.ExtraImmediate);
     PreferredSize    = descriptor.Size;
 }
Пример #11
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     switch (descriptor.OperandType)
     {
         case OperandType.Immediate:
             return Size == DataSize.None || Size <= descriptor.Size;
         default:
             return false;
     }
 }
Пример #12
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public virtual void Adjust(OperandDescriptor descriptor)
 {
 }
Пример #13
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     if (descriptor.OperandType == OperandType.FarPointer)
         return Size == descriptor.Size;
     return false;
 }
Пример #14
0
 public override void Adjust(OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }
Пример #15
0
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     throw new NotImplementedException();
 }
Пример #16
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public override void Adjust(OperandDescriptor descriptor)
 {
     // Nothing to do.
 }
Пример #17
0
 /// <summary>
 /// Adjusts this <see cref="Operand"/> based on the specified <see cref="OperandDescriptor"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> used to adjust.</param>
 /// <remarks>
 /// Only <see cref="OperandDescriptor"/> instances for which <see cref="IsMatch"/> returns
 /// <see langword="true"/> may be used as a parameter to this method.
 /// </remarks>
 public override void Adjust(OperandDescriptor descriptor)
 {
     asExtraImmediate = (descriptor.OperandEncoding == OperandEncoding.ExtraImmediate);
     PreferredSize = descriptor.Size;
 }
Пример #18
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public override bool IsMatch(OperandDescriptor descriptor)
 {
     switch (descriptor.OperandType)
     {
         case OperandType.RegisterOrMemoryOperand:
             return Size == descriptor.RegisterType.GetSize();
         case OperandType.MemoryOperand:
             return Size == descriptor.Size;
         default:
             return false;
     }
 }
Пример #19
0
 /// <summary>
 /// Determines whether the specified <see cref="OperandDescriptor"/> matches this
 /// <see cref="Operand"/>.
 /// </summary>
 /// <param name="descriptor">The <see cref="OperandDescriptor"/> to match.</param>
 /// <returns><see langword="true"/> when the specified descriptor matches this operand;
 /// otherwise, <see langword="false"/>.</returns>
 public abstract bool IsMatch(OperandDescriptor descriptor);