本文整理汇总了C#中Constant.ToUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Constant.ToUInt32方法的具体用法?C# Constant.ToUInt32怎么用?C# Constant.ToUInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constant
的用法示例。
在下文中一共展示了Constant.ToUInt32方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyConstants
public override Constant ApplyConstants(Constant c1, Constant c2)
{
if (!ValidArgs(c1, c2))
return Constant.Invalid;
if (c2.IsIntegerZero)
return Constant.Invalid;
return BuildConstant(c1.DataType, c2.DataType, (int) (c1.ToUInt32() / c2.ToUInt32()));
}
示例2: ApplyConstants
public override Constant ApplyConstants(Constant c1, Constant c2)
{
if (!ValidArgs(c1, c2))
return Constant.Invalid;
uint v1 = c1.ToUInt32();
uint v2 = c2.ToUInt32();
return Constant.Bool(v1 <= v2);
}
示例3: SetRegister
public override void SetRegister(RegisterStorage reg, Constant c)
{
if (c == null || !c.IsValid)
{
valid[reg.Number] = false;
}
else
{
reg.SetRegisterFileValues(regs, c.ToUInt32(), valid); //$REVIEW: AsUint64 for PPC-64?
}
}
示例4: ApplyConstants
public override Constant ApplyConstants(Constant c1, Constant c2)
{
try
{
return BuildConstant(c1.DataType, c2.DataType, unchecked((int) (c1.ToUInt32() * c2.ToUInt32())));
}
catch //$HACK: sometimes we get -ive numbers here, at which point .NET casts fail; attempt to use signed integers instead.
{
return BuildConstant(c1.DataType, c2.DataType, c1.ToInt32() * c1.ToInt32());
}
}
示例5: SetRegister
public override void SetRegister(RegisterStorage r, Constant v)
{
if (v.IsValid)
{
isValid |= 1u << r.Number;
regData[r.Number] = v.ToUInt32();
}
else
{
isValid &= ~(1u << r.Number);
regData[r.Number] = 0xCCCCCCCC;
}
}
示例6: SetRegister
public override void SetRegister(RegisterStorage r, Constant v)
{
int rn = r.Number;
if (0 <= rn && rn < 32)
{
// Integer register.
if (v.IsValid)
{
iregs[rn] = v.ToUInt32();
valid[rn] = true;
return;
}
else
{
valid[rn] = false;
}
}
}
示例7: MakeAddressFromConstant
public override Address MakeAddressFromConstant(Constant c)
{
return Address.Ptr32(c.ToUInt32());
}
示例8: ApplyConstants
public override Constant ApplyConstants(Constant c1, Constant c2)
{
return BuildConstant(c1.DataType, c2.DataType, (int) (c1.ToUInt32() >> c2.ToInt32()));
}
示例9: ApplyConstants
public override Constant ApplyConstants(Constant c1, Constant c2)
{
uint v1 = (uint) c1.ToUInt32();
uint v2 = (uint) c2.ToUInt32();
return Constant.Bool(v1 >= v2);
}
示例10: GetSliceImpl
protected override Expression GetSliceImpl(Constant c)
{
return Constant.Word32(c.ToUInt32());
}
示例11: MakeSegmentedAddress
public override Address MakeSegmentedAddress(Constant seg, Constant offset)
{
return mode.CreateSegmentedAddress(seg.ToUInt16(), offset.ToUInt32());
}
示例12: EmitLeImmediate
public void EmitLeImmediate(Constant c, PrimitiveType dt)
{
switch (dt.Size)
{
case 1: EmitByte(c.ToInt32()); return;
case 2: EmitLeUInt16(c.ToInt32()); return;
case 4: EmitLeUInt32(c.ToUInt32()); return;
default: throw new NotSupportedException(string.Format("Unsupported type: {0}", dt));
}
}