Esempio n. 1
0
        public Mem()
        {
            _type = MemoryType.Native;
            _segmentPrefix = SegmentPrefix.None;

            _base = RegIndex.Invalid;
            _index = RegIndex.Invalid;
            _scalingFactor = ScalingFactor.Times1;

            _target = IntPtr.Zero;
            _displacement = IntPtr.Zero;
        }
Esempio n. 2
0
        public Mem(IntPtr target, IntPtr displacement, SegmentPrefix segmentPrefix, int size = 0)
            : base(size: size)
        {
            Contract.EndContractBlock();

            _type = MemoryType.Absolute;
            _segmentPrefix = segmentPrefix;

            _base = RegIndex.Invalid;
            _index = RegIndex.Invalid;
            _scalingFactor = ScalingFactor.Times1;

            _target = target;
            _displacement = displacement;
        }
Esempio n. 3
0
        public Mem(GPReg @base, IntPtr displacement, int size = 0)
            : base(size: size)
        {
            if (@base == null)
                throw new ArgumentNullException("base");
            Contract.EndContractBlock();

            _type = MemoryType.Native;
            _segmentPrefix = SegmentPrefix.None;

            _sizePrefix = @base.Size != IntPtr.Size;

            _base = @base.RegisterIndex;
            _index = RegIndex.Invalid;
            _scalingFactor = ScalingFactor.Times1;

            _target = IntPtr.Zero;
            _displacement = displacement;
        }
Esempio n. 4
0
        private static Mem MemPtrAbs(IntPtr target, GPVar index, ScalingFactor scalingFactor, int displacement, SegmentPrefix segmentPrefix, Size size)
        {
            Contract.Requires(index != null);
            Contract.Requires(scalingFactor >= ScalingFactor.Times1 && scalingFactor <= ScalingFactor.Times8);

            return new Mem(target, index, scalingFactor, (IntPtr)displacement, segmentPrefix, (int)size);
        }
Esempio n. 5
0
 private static Mem MemPtrAbs(IntPtr target, int displacement, SegmentPrefix segmentPrefix, Size size)
 {
     return new Mem(target, (IntPtr)displacement, segmentPrefix, (int)size);
 }
Esempio n. 6
0
        public static Mem word_ptr(IntPtr target, GPVar index, ScalingFactor scalingFactor, int displacement = 0, SegmentPrefix segmentPrefix = SegmentPrefix.None)
        {
            Contract.Requires(index != null);
            Contract.Ensures(Contract.Result<Mem>() != null);

            return MemPtrAbs(target, index, scalingFactor, displacement, segmentPrefix, NAsmJit.Size.WORD);
        }
Esempio n. 7
0
        public static Mem word_ptr(IntPtr target, int displacement = 0, SegmentPrefix segmentPrefix = SegmentPrefix.None)
        {
            Contract.Ensures(Contract.Result<Mem>() != null);

            return MemPtrAbs(target, displacement, segmentPrefix, NAsmJit.Size.WORD);
        }
Esempio n. 8
0
        public Mem(Label label, IntPtr displacement, int size = 0)
            : base(size: size)
        {
            if (label == null)
                throw new ArgumentNullException("label");

            _type = MemoryType.Label;
            _label = label;
            _segmentPrefix = SegmentPrefix.None;

            _base = (RegIndex)label.Id;
            _index = RegIndex.Invalid;
            _scalingFactor = ScalingFactor.Times1;

            _target = IntPtr.Zero;
            _displacement = displacement;
        }
Esempio n. 9
0
        public Mem(GPVar @base, GPVar index, ScalingFactor scalingFactor, IntPtr displacement, int size = 0)
            : base(size: size)
        {
            if (@base == null)
                throw new ArgumentNullException("base");
            if (index == null)
                throw new ArgumentNullException("index");
            if (scalingFactor < ScalingFactor.Times1 || scalingFactor > ScalingFactor.Times8)
                throw new ArgumentOutOfRangeException("scalingFactor");
            Contract.EndContractBlock();

            _type = MemoryType.Native;
            _segmentPrefix = SegmentPrefix.None;

            _sizePrefix = @base.Size != IntPtr.Size || index.Size != IntPtr.Size;

            _base = (RegIndex)@base.Id;
            _index = (RegIndex)index.Id;
            _scalingFactor = scalingFactor;

            _target = IntPtr.Zero;
            _displacement = displacement;
        }
Esempio n. 10
0
        public Mem(IntPtr target, GPVar index, ScalingFactor scalingFactor, IntPtr displacement, SegmentPrefix segmentPrefix, int size = 0)
            : base(size: size)
        {
            if (index == null)
                throw new ArgumentNullException("index");
            if (scalingFactor < ScalingFactor.Times1 || scalingFactor > ScalingFactor.Times8)
                throw new ArgumentOutOfRangeException("scalingFactor");
            Contract.EndContractBlock();

            _type = MemoryType.Absolute;
            _segmentPrefix = segmentPrefix;

            _sizePrefix = index.Size != IntPtr.Size;

            _base = RegIndex.Invalid;
            _index = (RegIndex)index.Id;
            _scalingFactor = scalingFactor;

            _target = target;
            _displacement = displacement;
        }