本文整理汇总了C#中RegisterStorage类的典型用法代码示例。如果您正苦于以下问题:C# RegisterStorage类的具体用法?C# RegisterStorage怎么用?C# RegisterStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegisterStorage类属于命名空间,在下文中一共展示了RegisterStorage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:ArmProcessorState.cs
示例2: GetRegister
public override Constant GetRegister(RegisterStorage r)
{
if (valid[r.Number])
return Constant.Byte(regs[r.Number]);
else
return Constant.Invalid;
}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:7,代码来源:Mos6502ProcessorState.cs
示例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;
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:Z80ProcessorState.cs
示例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());
}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:37,代码来源:PowerPcArchitecture.cs
示例5: GetRegister
public override Constant GetRegister(RegisterStorage reg)
{
if (valid[reg.Number])
return Constant.Create(reg.DataType, regs[reg.Number]);
else
return Constant.Invalid;
}
开发者ID:killbug2004,项目名称:reko,代码行数:7,代码来源:PowerPcState.cs
示例6: ArmMemoryOperand
public ArmMemoryOperand(PrimitiveType width, RegisterStorage regBase, MachineOperand offset) : base(width)
{
if (width == null)
throw new ArgumentNullException("width");
Base = regBase;
Offset = offset;
}
开发者ID:melbcat,项目名称:reko,代码行数:7,代码来源:ArmMemoryOperand.cs
示例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());
}
开发者ID:nemerle,项目名称:reko,代码行数:7,代码来源:RegisterTests.cs
示例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;
}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:7,代码来源:X86InstructionComparer.Tests.cs
示例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;
}
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:MemoryOperand.cs
示例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;
}
开发者ID:uxmal,项目名称:reko,代码行数:8,代码来源:ValuePropagationTests.cs
示例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);
}
}
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:FakeArchitecture.cs
示例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;
}
开发者ID:nemerle,项目名称:reko,代码行数:8,代码来源:Z80ProcessorState.cs
示例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 },
};
}
开发者ID:melbcat,项目名称:reko,代码行数:58,代码来源:A32Registers.cs
示例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());
}
开发者ID:gitter-badger,项目名称:reko,代码行数:9,代码来源:VariableTests.cs
示例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;
}
开发者ID:nemerle,项目名称:reko,代码行数:9,代码来源:OperandParser.cs
示例16: Instr
private FakeInstruction Instr(uint addr)
{
var reg = new RegisterStorage("r2", 2, 0, PrimitiveType.Word32);
return new FakeInstruction(Operation.Add, new RegisterOperand(reg), new RegisterOperand(reg))
{
Address = Address.Ptr32(addr),
Length = 2,
};
}
开发者ID:relaxar,项目名称:reko,代码行数:9,代码来源:MixedCodeDataModelTests.cs
示例17: UseCreateWithArg
public void UseCreateWithArg()
{
var reg_edx = new RegisterStorage("edx",1,PrimitiveType.Word32);
var id2 = new Identifier("bar", PrimitiveType.Word32, new TemporaryStorage("bar", -1, PrimitiveType.Word32));
var r = new Identifier(reg_edx.Name, reg_edx.DataType, reg_edx);
var arg = new Identifier("barOut", PrimitiveType.Pointer32, new OutArgumentStorage(r));
var use2 = new UseInstruction(id2, arg);
Assert.AreSame(id2, use2.Expression);
Assert.AreEqual("barOut", use2.OutArgument.Name);
}
开发者ID:nemerle,项目名称:reko,代码行数:10,代码来源:UseInstructionTests.cs
示例18: AddressFromSegOffset
public Address AddressFromSegOffset(RegisterStorage seg, uint offset)
{
Constant c = GetRegister(seg);
if (c.IsValid)
{
return arch.ProcessorMode.CreateSegmentedAddress((ushort) c.ToUInt32(), offset & 0xFFFF);
}
else
return null;
}
开发者ID:relaxar,项目名称:reko,代码行数:10,代码来源:X86State.cs
示例19: GetRegister
public override Constant GetRegister(RegisterStorage reg)
{
if ((valid[reg.Number] & reg.BitMask) == reg.BitMask)
{
var val = (regs[reg.Number] & reg.BitMask) >> (int)reg.BitAddress;
return Constant.Create(reg.DataType, val);
}
else
return Constant.Invalid;
}
开发者ID:gitter-badger,项目名称:reko,代码行数:10,代码来源:PowerPcState.cs
示例20: AddressFromSegOffset
public Address AddressFromSegOffset(RegisterStorage seg, uint offset)
{
Constant c = GetRegister(seg);
if (c.IsValid)
{
return Address.SegPtr((ushort) c.ToUInt32(), offset & 0xFFFF);
}
else
return null;
}
开发者ID:killbug2004,项目名称:reko,代码行数:10,代码来源:X86State.cs
注:本文中的RegisterStorage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论