本文整理汇总了C#中RegisterStorage类的典型用法代码示例。如果您正苦于以下问题:C# RegisterStorage类的具体用法?C# RegisterStorage怎么用?C# RegisterStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegisterStorage类属于命名空间,在下文中一共展示了RegisterStorage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRegister
public override Constant GetRegister(RegisterStorage r)
{
if (((isValid >> r.Number) & 1) != 0)
return Constant.Word32(regData[r.Number]);
else
return Constant.Invalid;
}
示例2: GetRegister
public override Constant GetRegister(RegisterStorage r)
{
if (valid[r.Number])
return Constant.Byte(regs[r.Number]);
else
return Constant.Invalid;
}
示例3: GetRegister
public override Constant GetRegister(RegisterStorage reg)
{
if (reg != null && isValid[(int)reg.Domain])
return Constant.Create(reg.DataType, registerFile[(int)reg.Domain]);
else
return Constant.Invalid;
}
示例4: PowerPcArchitecture
/// <summary>
/// Creates an instance of PowerPcArchitecture.
/// </summary>
/// <param name="wordWidth">Supplies the word width of the PowerPC architecture.</param>
public PowerPcArchitecture(PrimitiveType wordWidth)
{
this.wordWidth = wordWidth;
this.ptrType = PrimitiveType.Create(Domain.Pointer, wordWidth.Size);
this.lr = new RegisterStorage("lr", 0x68, wordWidth);
this.cr = new RegisterStorage("cr", 0x69, wordWidth);
this.ctr = new RegisterStorage("ctr", 0x6A, wordWidth);
this.xer = new RegisterStorage("xer", 0x6B, wordWidth);
this.fpscr = new RegisterStorage("fpscr", 0x6C, wordWidth);
regs = new ReadOnlyCollection<RegisterStorage>(
Enumerable.Range(0, 0x20)
.Select(n => new RegisterStorage("r" + n, n, wordWidth))
.Concat(Enumerable.Range(0, 0x20)
.Select(n => new RegisterStorage("f" + n, n + 0x20, PrimitiveType.Word64)))
.Concat(Enumerable.Range(0, 0x20)
.Select(n => new RegisterStorage("v" + n, n + 0x40, PrimitiveType.Word128)))
.Concat(Enumerable.Range(0, 8)
.Select(n => new RegisterStorage("cr" + n, n + 0x60, PrimitiveType.Byte)))
.Concat(new[] { lr, cr, ctr, xer })
.ToList());
fpregs = new ReadOnlyCollection<RegisterStorage>(
regs.Skip(0x20).Take(0x20).ToList());
vregs = new ReadOnlyCollection<RegisterStorage>(
regs.Skip(0x40).Take(0x20).ToList());
cregs = new ReadOnlyCollection<RegisterStorage>(
regs.Skip(0x60).Take(0x8).ToList());
}
示例5: GetRegister
public override Constant GetRegister(RegisterStorage reg)
{
if (valid[reg.Number])
return Constant.Create(reg.DataType, regs[reg.Number]);
else
return Constant.Invalid;
}
示例6: ArmMemoryOperand
public ArmMemoryOperand(PrimitiveType width, RegisterStorage regBase, MachineOperand offset) : base(width)
{
if (width == null)
throw new ArgumentNullException("width");
Base = regBase;
Offset = offset;
}
示例7: Create
public void Create()
{
RegisterStorage reg = new RegisterStorage("eax", 0, PrimitiveType.Word32);
Assert.AreEqual("eax", reg.Name);
Assert.AreEqual(0, reg.Number);
Assert.AreEqual("word32", reg.DataType.ToString());
}
示例8: Mem32
private MachineOperand Mem32(RegisterStorage baseReg, int off)
{
var mem = new MemoryOperand(PrimitiveType.Word32);
mem.Base = baseReg;
mem.Offset = Constant.Word32(off);
return mem;
}
示例9: MemoryOperand
public MemoryOperand(PrimitiveType width, RegisterStorage @base, RegisterStorage index, byte scale, Constant off) : base(width)
{
SegOverride = RegisterStorage.None;
Base = @base;
Offset = off;
Index = index;
Scale = scale;
}
示例10: Reg8
private Identifier Reg8(string name)
{
var mr = new RegisterStorage(name, ssaIds.Count, 0, PrimitiveType.Byte);
Identifier id = new Identifier(mr.Name, mr.DataType, mr);
SsaIdentifier sid = new SsaIdentifier(id, id, null, null, false);
ssaIds.Add(id, sid);
return sid.Identifier;
}
示例11: FakeArchitecture
static FakeArchitecture()
{
registers = new RegisterStorage[RegisterCount];
for (int i = 0; i < registers.Length; ++i)
{
registers[i] = new RegisterStorage("r" + i, i, 0, PrimitiveType.Word32);
}
}
示例12: GetRegister
public override Constant GetRegister(RegisterStorage r)
{
Z80Register reg = r as Z80Register;
if (reg != null && isValid[reg.FileSlot])
return Constant.Create(reg.DataType, registerFile[reg.FileSlot]);
else
return Constant.Invalid;
}
示例13: A32Registers
static A32Registers()
{
r0 = new RegisterStorage("r0", 0, PrimitiveType.Word32);
r1 = new RegisterStorage("r1", 1, PrimitiveType.Word32);
r2 = new RegisterStorage("r2", 2, PrimitiveType.Word32);
r3 = new RegisterStorage("r3", 3, PrimitiveType.Word32);
r4 = new RegisterStorage("r4", 4, PrimitiveType.Word32);
r5 = new RegisterStorage("r5", 5, PrimitiveType.Word32);
r6 = new RegisterStorage("r6", 6, PrimitiveType.Word32);
r7 = new RegisterStorage("r7", 7, PrimitiveType.Word32);
r8 = new RegisterStorage("r8", 8, PrimitiveType.Word32);
r9 = new RegisterStorage("r9", 9, PrimitiveType.Word32);
r10 = new RegisterStorage("r10", 10, PrimitiveType.Word32);
r11 = new RegisterStorage("fp", 11, PrimitiveType.Word32);
ip = new RegisterStorage("ip", 12, PrimitiveType.Word32);
sp = new RegisterStorage("sp", 13, PrimitiveType.Word32);
lr = new RegisterStorage("lr", 14, PrimitiveType.Word32);
pc = new RegisterStorage("pc", 15, PrimitiveType.Word32);
GpRegs = new RegisterStorage[] {
r0,
r1,
r2,
r3,
r4,
r5,
r6,
r7,
r8,
r9,
r10,
r11,
ip,
sp,
lr,
pc,
};
RegistersByName = new Dictionary<string, RegisterStorage>(StringComparer.InvariantCultureIgnoreCase)
{
{ "r0", r0 },
{ "r1", r1 },
{ "r2", r2 },
{ "r3", r3 },
{ "r4", r4 },
{ "r5", r5 },
{ "r6", r6 },
{ "r7", r7 },
{ "r8", r8 },
{ "r9", r9 },
{ "r10", r10 },
{ "r11", r11 },
{ "ip", ip },
{ "sp", sp },
{ "lr", lr },
{ "pc", pc },
};
}
示例14: CreateOutArgumentRegister
public void CreateOutArgumentRegister()
{
RegisterStorage mr = new RegisterStorage("r1", 1, 0, PrimitiveType.Word32);
Identifier oarg = new Identifier("r1Out", PrimitiveType.Word32, new OutArgumentStorage(
new Identifier(mr.Name, PrimitiveType.Word32, mr)));
StringWriter w = new StringWriter();
oarg.Write(true, w);
Assert.AreEqual("Register out word32 r1Out", w.ToString());
}
示例15: OperandParser
public OperandParser(Lexer lexer, SymbolTable symtab, Address addrBase, PrimitiveType defaultWordWidth, PrimitiveType defaultAddressWidth)
{
this.lexer = lexer;
this.symtab = symtab;
this.addrBase = addrBase;
this.defaultWordWidth = defaultWordWidth;
this.defaultAddressWidth = defaultAddressWidth;
this.segOverride = RegisterStorage.None;
}