Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Neg"/> class.
        /// </summary>
        /// <param name="value">The value.</param>
        private Neg(Operand value)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(value != null);
            Contract.Requires<InvalidCastException>(
                    value is EffectiveAddress ||
                    value is RegisterOperand);
            #endregion

            this.value = value;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JmpFar"/> class.
        /// </summary>
        /// <param name="target">The operand.</param>
        public JmpFar(Operand target)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(target != null);
            Contract.Requires<InvalidCastException>(
                    target is EffectiveAddress ||
                    target is FarPointer);
            #endregion

            this.target = target;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Mul"/> class.
        /// </summary>
        /// <param name="multiplier">The multiplier.</param>
        private Mul(Operand multiplier)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(multiplier != null);
            Contract.Requires<InvalidCastException>(
                    multiplier is EffectiveAddress ||
                    multiplier is RegisterOperand);
            #endregion

            this.multiplier = multiplier;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Inc"/> class.
        /// </summary>
        /// <param name="subject">The subject operand.</param>
        private Inc(Operand subject)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(subject != null);
            Contract.Requires<InvalidCastException>(
                    subject is EffectiveAddress ||
                    subject is RegisterOperand);
            #endregion

            this.subject = subject;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Cmpxchg"/> class.
        /// </summary>
        /// <param name="compared">The operand being compared.</param>
        /// <param name="source">The source operand.</param>
        private Cmpxchg(Operand compared, RegisterOperand source)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(compared != null);
            Contract.Requires<InvalidCastException>(
                    compared is EffectiveAddress ||
                    compared is RegisterOperand);
            Contract.Requires<ArgumentNullException>(source != null);
            #endregion

            this.compared = compared;
            this.source = source;
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Popcnt"/> class.
        /// </summary>
        /// <param name="destination">The register in which the bit's index will be stored.</param>
        /// <param name="subject">The register or memory operand which is checked.</param>
        private Popcnt(RegisterOperand destination, Operand subject)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(destination != null);
            Contract.Requires<ArgumentNullException>(subject != null);
            Contract.Requires<InvalidCastException>(
                    subject is EffectiveAddress ||
                    subject is RegisterOperand);
            #endregion

            this.destination = destination;
            this.subject = subject;
        }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Xadd"/> class.
        /// </summary>
        /// <param name="destination">The destination operand.</param>
        /// <param name="source">The source operand.</param>
        private Xadd(Operand destination, RegisterOperand source)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(destination != null);
            Contract.Requires<InvalidCastException>(
                    destination is EffectiveAddress ||
                    destination is RegisterOperand);
            Contract.Requires<ArgumentNullException>(source != null);
            #endregion

            this.destination = destination;
            this.source = source;
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shr"/> class.
        /// </summary>
        /// <param name="value">The value to change.</param>
        /// <param name="positions">The number of positions to adjust;
        /// or <see langword="null"/> to adjust one position.</param>
        private Shr(Operand value, Operand positions)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(value != null);
            Contract.Requires<InvalidCastException>(
                    value is EffectiveAddress ||
                    value is RegisterOperand);
            Contract.Requires<InvalidCastException>(positions != null || (
                    positions is Immediate ||
                    positions is EffectiveAddress ||
                    positions is RegisterOperand));
            #endregion

            this.value = value;
            this.positions = positions;
        }
Example #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Set"/> class.
        /// </summary>
        /// <param name="destination">The destination operand.</param>
        /// <param name="condition">The condition on which this instruction executes.</param>
        private Set(Operand destination, InstructionCondition condition)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(destination != null);
            Contract.Requires<InvalidCastException>(
                    destination is EffectiveAddress ||
                    destination is RegisterOperand);
            Contract.Requires<InvalidEnumArgumentException>(Enum.IsDefined(typeof(InstructionCondition), condition));
            Contract.Requires<ArgumentException>(condition != InstructionCondition.None);
            #endregion

            this.destination = destination;
            this.condition = condition;
        }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Bt"/> class.
        /// </summary>
        /// <param name="subject">The register or memory operand whose bit is copied.</param>
        /// <param name="bitindex">The index of the bit to copy.</param>
        private Bt(Operand subject, Operand bitindex)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(subject != null);
            Contract.Requires<InvalidCastException>(
                    subject is EffectiveAddress ||
                    subject is RegisterOperand);
            Contract.Requires<ArgumentNullException>(bitindex != null);
            Contract.Requires<InvalidCastException>(
                    bitindex is Immediate ||
                    bitindex is RegisterOperand);
            #endregion

            this.subject = subject;
            this.bitIndex = bitindex;
        }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="In"/> class.
        /// </summary>
        /// <param name="port">The port.</param>
        private In(Operand port)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(port != null);
            Contract.Requires<InvalidCastException>(
                    port is EffectiveAddress ||
                    port is RegisterOperand);
            #endregion

            this.port = port;
        }
Example #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Pop"/> class.
        /// </summary>
        /// <param name="destination">The destination operand.</param>
        private Pop(Operand destination)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(destination != null);
            Contract.Requires<InvalidCastException>(
                    destination is EffectiveAddress ||
                    destination is RegisterOperand);
            #endregion

            this.destination = destination;
        }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Call"/> class.
        /// </summary>
        /// <param name="target">The target <see cref="RelativeOffset"/>, or the address specified at the
        /// <see cref="RegisterOperand"/> or <see cref="EffectiveAddress"/>.</param>
        private Call(Operand target)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(target != null);
            Contract.Requires<InvalidCastException>(
                target is RegisterOperand ||
                target is EffectiveAddress ||
                target is RelativeOffset ||
                target is FarPointer);
            #endregion

            this.target = target;
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Xchg"/> class.
        /// </summary>
        /// <param name="first">The first operand.</param>
        /// <param name="second">The second operand.</param>
        private Xchg(Operand first, RegisterOperand second)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(first != null);
            Contract.Requires<InvalidCastException>(
                    first is EffectiveAddress ||
                    first is RegisterOperand);
            Contract.Requires<ArgumentNullException>(second != null);
            #endregion

            this.first = first;
            this.second = second;
        }
Example #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Push"/> class.
        /// </summary>
        /// <param name="source">The destination operand.</param>
        private Push(Operand source)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(source != null);
            Contract.Requires<InvalidCastException>(
                    source is Immediate ||
                    source is EffectiveAddress ||
                    source is RegisterOperand);
            #endregion

            this.source = source;
        }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Mov"/> class.
        /// </summary>
        /// <param name="destination">The destination operand.</param>
        /// <param name="source">The source operand.</param>
        private Mov(Operand destination, Operand source)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(destination != null);
            Contract.Requires<InvalidCastException>(
                    destination is EffectiveAddress ||
                    destination is MemoryOffset ||
                    destination is RegisterOperand);
            Contract.Requires<ArgumentNullException>(source != null);
            Contract.Requires<InvalidCastException>(
                    source is Immediate ||
                    source is MemoryOffset ||
                    source is EffectiveAddress ||
                    source is RegisterOperand);
            #endregion

            this.destination = destination;
            this.source = source;
        }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FAdd"/> class.
 /// </summary>
 /// <param name="destination">The x87 register being modified.</param>
 /// <param name="source">The value to add.</param>
 private FAdd(RegisterOperand destination, Operand source)
 {
     this.destination = destination;
     this.source = source;
 }
Example #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Imul"/> class.
        /// </summary>
        /// <param name="destination">The destination operand.</param>
        /// <param name="source">The source operand.</param>
        /// <param name="multiplier">The multiplier.</param>
        private Imul(RegisterOperand destination, Operand source, Operand multiplier)
        {
            #region Contract
            Contract.Requires<ArgumentNullException>(multiplier != null);
            Contract.Requires<InvalidCastException>(
                    multiplier is Immediate ||
                    multiplier is EffectiveAddress ||
                    multiplier is RegisterOperand);
            Contract.Requires<InvalidCastException>(source == null || (
                    source is EffectiveAddress ||
                    source is RegisterOperand));
            #endregion

            this.destination = destination;
            this.source = source;
            this.multiplier = multiplier;
        }
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="And"/> class.
 /// </summary>
 /// <param name="destination">The destination operand.</param>
 /// <param name="source">The source operand.</param>
 private And(Operand destination, Operand source)
 {
     this.destination = destination;
     this.source = source;
 }