public static Mem xmmword_ptr(GPVar @base, int displacement = 0) { Contract.Requires(@base != null); Contract.Ensures(Contract.Result<Mem>() != null); return MemPtrBuild(@base, displacement, NAsmJit.Size.DQWORD); }
public static Mem xmmword_ptr(GPVar @base, GPVar index, ScalingFactor scalingFactor, int displacement = 0) { Contract.Requires(@base != null); Contract.Requires(index != null); Contract.Requires(scalingFactor >= ScalingFactor.Times1 && scalingFactor <= ScalingFactor.Times8); Contract.Ensures(Contract.Result<Mem>() != null); return MemPtrBuild(@base, index, scalingFactor, displacement, NAsmJit.Size.DQWORD); }
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); }
public Mem(GPVar @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 = (RegIndex)@base.Id; _index = RegIndex.Invalid; _scalingFactor = ScalingFactor.Times1; _target = IntPtr.Zero; _displacement = displacement; }
public static Mem ptr(GPVar @base, int displacement = 0) { Contract.Requires(@base != null); Contract.Ensures(Contract.Result<Mem>() != null); return MemPtrBuild(@base, displacement, 0); }
public static Mem sysint_ptr(GPVar @base, int displacement = 0) { Contract.Requires(@base != null); Contract.Ensures(Contract.Result<Mem>() != null); return MemPtrBuild(@base, displacement, (NAsmJit.Size)IntPtr.Size); }
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; }
private static void GenerateNewException(Compiler c, GPVar dst, Imm code) { GPVar var = c.NewGP(); c.Mov(var, code); CompilerFunctionCall call = c.Call(AllocateExceptionFunction, CallingConvention.Default, typeof(Func<int, IntPtr>)); call.SetArgument(0, var); call.SetReturn(dst); }
private static Mem MemPtrBuild(GPVar @base, int displacement, Size size) { Contract.Requires(@base != null); Contract.Ensures(Contract.Result<Mem>() != null); return new Mem(@base, (IntPtr)displacement, (int)size); }
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; }
private static void GenerateLoadExceptionMessage(Compiler c, GPVar dst, GPVar exceptionVariable) { c.Mov(dst, Mem.dword_ptr(exceptionVariable, ExceptionData_CodeOffset)); }
private static void GenerateLoadCurrentException(Compiler c, GPVar dst, GPVar threadDataVariable) { GenerateLoadThreadData(c, dst, threadDataVariable); c.Mov(dst, Mem.sysint_ptr(dst, ThreadData_ExceptionDataOffset)); }
private static void GenerateLoadThreadData(Compiler c, GPVar dst, GPVar threadDataVariable) { c.Mov(dst, threadDataVariable); }
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); }
public Mem(Label label, GPVar index, ScalingFactor scalingFactor, IntPtr displacement, int size = 0) : this(label, displacement, size) { if (index == null) throw new ArgumentNullException("index"); if (scalingFactor < ScalingFactor.Times1 || scalingFactor > ScalingFactor.Times8) throw new ArgumentOutOfRangeException("scalingFactor"); Contract.EndContractBlock(); _index = (RegIndex)index.Id; _scalingFactor = scalingFactor; }
private static Mem MemPtrBuild(Label label, GPVar index, ScalingFactor scalingFactor, int displacement, Size size) { Contract.Requires(label != null); Contract.Requires(index != null); Contract.Requires(scalingFactor >= ScalingFactor.Times1 && scalingFactor <= ScalingFactor.Times8); Contract.Ensures(Contract.Result<Mem>() != null); return new Mem(label, index, scalingFactor, (IntPtr)displacement, (int)size); }
private static void GenerateWriteLine(Compiler c, GPVar value) { CompilerFunctionCall call = c.Call(WriteIntegerFunction, CallingConvention.Default, typeof(Action<int>)); call.SetArgument(0, value); }