Example #1
0
        public ArmRegisterCollection CurrentRegisters()
        {
            // Combine all relevant register values into a complete register collection
            ArmRegisterCollection currentBank = CurrentBank;

            // Standard regs
            ArmRegisterCollection ret = CreateCollection(TArmRegisterBank.ETypeUnknown);

            foreach (ArmRegister reg in currentBank)
            {
                ret.Add(reg.OriginalName, reg.Value);
            }

            // Co-processor
            ArmRegisterCollection cop = this[TArmRegisterBank.ETypeCoProcessor];

            foreach (ArmRegister reg in cop)
            {
                ret.Add(reg.OriginalName, reg.Value);
            }

            // Exception
            ArmRegisterCollection exc = this[TArmRegisterBank.ETypeException];

            foreach (ArmRegister reg in exc)
            {
                ret.Add(reg.OriginalName, reg.Value);
            }

            return(ret);
        }
Example #2
0
        private ArmRegisterCollection AddBank(TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith, params TArmRegisterType[] aExtraRegs)
        {
            ArmRegisterCollection regSet = CreateCollection(aBank, aLinkedWith);

            iBanks.Add(aBank, regSet);

            // Create bank specific registers
            string bankName = ArmRegisterBankUtils.BankAsString(aBank);

            regSet.Add("R13_" + bankName, 0);
            regSet.Add("R14_" + bankName, 0);
            regSet.Add("SPSR_" + bankName, 0);

            // Create custom registers
            foreach (TArmRegisterType custom in aExtraRegs)
            {
                string name = ArmRegister.GetTypeName(custom) + "_" + bankName;
                regSet.Add(name, 0);
            }

            return(regSet);
        }