public InstructionFunc UnregisterNarrow(uint basecode) { InstructionFunc f = registry[basecode]; registry[basecode] = defaultInstruction; return(f); }
private void RegisterNarrow(IEnumerable <uint> narrow_opcodes, InstructionFunc handler, string name = "") { foreach (uint i in narrow_opcodes) { RegisterNarrow(i, handler, name); } }
public void RegisterOpCode(IEnumerable <uint> opCodes, InstructionFunc handler, string name = "") { foreach (uint i in opCodes) { RegisterNarrow(Narrow(i), handler, name); } }
private void RegisterNarrow(uint basecode, InstructionFunc handler, string name = "") { if (registry[basecode] != defaultInstruction) { System.Diagnostics.Debug.Assert(registry[basecode] == defaultInstruction, "Attempting to register " + name + " into slot taken by " + registeredNames[basecode]); } registry[basecode] = handler; registeredNames[basecode] = name; }
protected InstructionRegistry(int width, InstructionFunc defaultInstruction) { registry = new InstructionFunc[1 << width]; registeredNames = new string[1 << width]; this.defaultInstruction = defaultInstruction; for (int i = 0; i < registry.Length; i++) { registry[i] = defaultInstruction; registeredNames[i] = "(none)"; } }
//Register a range of opcodes to be handled by a specific handler. //The basecode gives the first opcode in the range and mask contains the //set of free bits in the range (whose value can be either 0 or 1). Note //that basecode and mask should be relative to the narrowed range (i.e. the width //of the registry), not actual opcodes) private void RegisterNarrow(uint basecode, uint wildcard_mask, InstructionFunc handler, string name = "") { RegisterNarrow(BitStringWildcard(basecode, wildcard_mask), handler, name); }
public void RegisterOpCode(uint opCode, InstructionFunc handler, string name = "") { RegisterNarrow(Narrow(opCode), handler, name); }
public void RegisterOpCode(uint opCode, uint wildcard_mask, InstructionFunc handler, string name = "") { RegisterNarrow(Narrow(opCode), Narrow(wildcard_mask), handler, name); }
internal void RegisterOpcode(uint opcode, uint wildcard_mask, InstructionFunc handler, string name) { ARMInstructionRegistry.RegisterOpCode(opcode, wildcard_mask, handler, name); }
protected override void FinishBuild() { InstructionFunc handler = owner.GenerateAWCDataOp(EvaluateOperand2, opHandler, SaveResult, SetFlags); Register(handler); }
protected virtual void Register(InstructionFunc BuiltHandler) { owner.RegisterOpcode(opcode, wildcard_mask, BuiltHandler, name); }
public InstructionData(byte opcode, string mnemonic, AddressingMode addressingMode, int cycles, InstructionType type, InstructionFunc implementation) { this.Opcode = opcode; this.Mnemonic = mnemonic; this.AddressingMode = addressingMode; this.Cycles = cycles; this.IsRead = (type & InstructionType.Read) == InstructionType.Read; this.IsWrite = (type & InstructionType.Write) == InstructionType.Write; this.IsUnofficial = (type & InstructionType.Unofficial) == InstructionType.Unofficial; this.Implementation = implementation; this.Size = InstructionData.SizeMap[addressingMode]; }
internal void FinishBuildingLoadStoreOp(LoadStoreBuilder b) { InstructionFunc handler = GenerateLoadStoreInstruction(b.ComputeOffset, b.ComputeOffsetAddress, b.ComputeFinalAddress, b.WritebackAddress, b.memorySize, b.LoadStoreMemory); RegisterOpcode(b.opcode, b.wildcard_mask, handler, b.name); }