/// <summary> /// Instantiates a base PIC disassembler. /// </summary> /// <param name="arch">The PIC architecture.</param> /// <param name="rdr">The memory reader.</param, Mnemonic> protected PICDisassemblerBase(PICArchitecture arch, EndianImageReader rdr) { this.arch = arch; this.rdr = rdr; this.instrCur = null !; this.addrCur = null !; }
/// <summary> /// Copy Constructor. /// </summary> /// <param name="st">The PIC18 state to copy.</param> public PICProcessorState(PICProcessorState st) : base(st) { arch = st.arch; HWStackItems = st.HWStackItems; ValidRegsValues = new Dictionary <PICRegisterStorage, PICRegisterContent>(st.ValidRegsValues); ValidRegs = new HashSet <RegisterStorage>(st.ValidRegs); }
private PICProgramPostprocessor(Program prog, PICArchitecture arch) { program = prog; architecture = arch; newMap = new SegmentMap(PICProgAddress.Ptr(0)); renamingCounter = null !; }
protected Identifier Bsr; // cached BSR register identifier protected PICRewriter(PICArchitecture arch, PICDisassemblerBase disasm, PICProcessorState state, IStorageBinder binder, IRewriterHost host) { this.arch = arch; this.state = state; this.binder = binder; this.host = host; this.disasm = disasm; dasm = disasm.GetEnumerator(); Wreg = GetWReg; Bsr = GetBsr; }
/// <summary> /// Postprocess the program which has been loaded. /// </summary> /// <param name="program">The program.</param> /// <param name="arch">The architecture of the processor.</param> public virtual void PostprocessProgram(Program program, PICArchitecture arch) { PICProgramPostprocessor.Validate(program, arch); }
/// <summary> /// Creates the processor state. /// </summary> /// <param name="arch">The architecture of the processor.</param> /// <returns> /// The new processor state. /// </returns> public abstract PICProcessorState CreateProcessorState(PICArchitecture arch);
/// <summary> /// Creates the instructions IL rewriter for the target processor. /// </summary> /// <param name="arch">The architecture of the processor.</param> /// <param name="dasm">The disassembler.</param> /// <param name="state">The processor state.</param> /// <param name="binder">The storage binder.</param> /// <param name="host">The host.</param> /// <returns> /// The new rewriter. /// </returns> public abstract PICRewriter CreateRewriter(PICArchitecture arch, PICDisassemblerBase dasm, PICProcessorState state, IStorageBinder binder, IRewriterHost host);
/// <summary> /// Creates an emulator for the target processor. /// </summary> /// <param name="arch">The architecture of the processor.</param> /// <param name="segmentMap">The memory of the program to be emulated.</param> /// <param name="envEmulator">Emulated environment.</param> /// <returns>The created emulator.</returns> public virtual IProcessorEmulator CreateEmulator(PICArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) => throw new NotImplementedException();
/// <summary> /// Creates a disassembler for the target processor. /// </summary> /// <param name="arch">The architecture of the processor.</param> /// <param name="rdr">The memory image reader.</param> /// <returns> /// The new disassembler. /// </returns> public abstract PICDisassemblerBase CreateDisassembler(PICArchitecture arch, EndianImageReader rdr);
protected HashSet <RegisterStorage> ValidRegs; // Validity of registers. Note: if not valid, there is no corresponding entry in 'regs'. /// <summary> /// Constructor. /// </summary> /// <param name="arch">The PIC18 target architecture.</param> public PICProcessorState(PICArchitecture arch) { this.arch = arch; ValidRegsValues = new Dictionary <PICRegisterStorage, PICRegisterContent>(); ValidRegs = new HashSet <RegisterStorage>(); }
/// <summary> /// Instantiates a base PIC disassembler. /// </summary> /// <param name="arch">The PIC architecture.</param> /// <param name="rdr">The memory reader.</param, Mnemonic> protected PICDisassemblerBase(PICArchitecture arch, EndianImageReader rdr) { this.arch = arch; this.rdr = rdr; }
public static Program Validate(Program prog, PICArchitecture arch) => new PICProgramPostprocessor(prog ?? throw new ArgumentNullException(nameof(prog)),
public PICOperandConfigBits(PICArchitecture arch, PICProgAddress addr, ushort config) : base(config) { this.arch = arch; this.addr = addr; }