Пример #1
0
        /// <summary>
        ///     Move to Coprocessor from Register.
        /// </summary>
        private void ARM_MCR()
        {
            int  CRm              = (int)(Opcode & 0xf);
            uint Opcode2          = (Opcode >> 5) & 7;
            uint CoprocessorIndex = (Opcode >> 8) & 0xf;
            int  Rd      = (int)((Opcode >> 12) & 0xf);
            int  CRn     = (int)((Opcode >> 16) & 0xf);
            uint Opcode1 = (Opcode >> 21) & 7;

            if (CoprocessorIndex == 15)
            {
                CP15.Write(CRn, Opcode1, CRm, Opcode2, Registers[Rd]);
            }
        }
Пример #2
0
        /// <summary>
        ///     Move to Register from Coprocessor.
        /// </summary>
        private void ARM_MRC()
        {
            int  CRm              = (int)(Opcode & 0xf);
            uint Opcode2          = (Opcode >> 5) & 7;
            uint CoprocessorIndex = (Opcode >> 8) & 0xf;
            int  Rd      = (int)((Opcode >> 12) & 0xf);
            int  CRn     = (int)((Opcode >> 16) & 0xf);
            uint Opcode1 = (Opcode >> 21) & 7;

            if (CoprocessorIndex == 15)
            {
                uint Value = CP15.Read(CRn, Opcode1, CRm, Opcode2);

                if (Rd == 15)
                {
                    Registers.CPSR = (Registers.CPSR & 0xfffffff) | (Value & 0xf0000000);
                }
                else
                {
                    Registers[Rd] = Value;
                }
            }
        }