Example #1
0
        public InstructionFunc UnregisterNarrow(uint basecode)
        {
            InstructionFunc f = registry[basecode];

            registry[basecode] = defaultInstruction;
            return(f);
        }
Example #2
0
 private void RegisterNarrow(IEnumerable <uint> narrow_opcodes, InstructionFunc handler, string name = "")
 {
     foreach (uint i in narrow_opcodes)
     {
         RegisterNarrow(i, handler, name);
     }
 }
Example #3
0
 public void RegisterOpCode(IEnumerable <uint> opCodes, InstructionFunc handler, string name = "")
 {
     foreach (uint i in opCodes)
     {
         RegisterNarrow(Narrow(i), handler, name);
     }
 }
Example #4
0
 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;
 }
Example #5
0
 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)";
     }
 }
Example #6
0
        //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);
        }
Example #7
0
 public void RegisterOpCode(uint opCode, InstructionFunc handler, string name = "")
 {
     RegisterNarrow(Narrow(opCode), handler, name);
 }
Example #8
0
 public void RegisterOpCode(uint opCode, uint wildcard_mask, InstructionFunc handler, string name = "")
 {
     RegisterNarrow(Narrow(opCode), Narrow(wildcard_mask), handler, name);
 }
Example #9
0
 internal void RegisterOpcode(uint opcode, uint wildcard_mask, InstructionFunc handler, string name)
 {
     ARMInstructionRegistry.RegisterOpCode(opcode, wildcard_mask, handler, name);
 }
Example #10
0
            protected override void FinishBuild()
            {
                InstructionFunc handler = owner.GenerateAWCDataOp(EvaluateOperand2, opHandler, SaveResult, SetFlags);

                Register(handler);
            }
Example #11
0
 protected virtual void Register(InstructionFunc BuiltHandler)
 {
     owner.RegisterOpcode(opcode, wildcard_mask, BuiltHandler, name);
 }
Example #12
0
 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);
        }