private static string getCP0RegName(CP0_REGISTER reg)
 {
     if (usingArmipsCP0Names)
     {
         return(ARMIPS_CP0_NAMES[(int)reg]);
     }
     else
     {
         return(reg.ToString());
     }
 }
        private static string decodeCOP0Operation(uint operation)
        {
            string       str = "Unimplemented (COP0 operation)";
            byte         mt  = (byte)((operation >> 21) & 0x1F);
            GP_REGISTER  rt  = (GP_REGISTER)((operation >> 16) & 0x1F);
            CP0_REGISTER rd  = (CP0_REGISTER)((operation >> 11) & 0x1F);

            switch (mt)
            {
            case 0x00:     // MFC0
                str = "mfc0 " + getGRPRegName(rt) + ", " + getCP0RegName(rd);
                break;

            case 0x04:     // MTC0
                str = "mtc0 " + getGRPRegName(rt) + ", " + getCP0RegName(rd);
                break;
            }

            return(str);
        }