當前位置: 首頁>>代碼示例>>C#>>正文


C# MipsR4300.MipsInstruction類代碼示例

本文整理匯總了C#中Soft64.MipsR4300.MipsInstruction的典型用法代碼示例。如果您正苦於以下問題:C# MipsInstruction類的具體用法?C# MipsInstruction怎麽用?C# MipsInstruction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MipsInstruction類屬於Soft64.MipsR4300命名空間,在下文中一共展示了MipsInstruction類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Inst_Dmfc1

        private void Inst_Dmfc1(MipsInstruction inst)
        {
            if (!CheckCop1Usable())
            {
                CauseException = ExceptionCode.CopUnstable;
                return;
            }

            if (!CheckEvenOddAllowed(inst.Fs))
            {
                CauseFPUException(FPUExceptionType.Unimplemented);
                return;
            }

            UInt64 value = 0;

            if (MipsState.CP0Regs.StatusReg.AdditionalFPR)
            {
                value = MipsState.Fpr.ReadFPRUnsigned(inst.Fs);
            }
            else
            {
                value = MipsState.Fpr.ReadFPR32Unsigned(inst.Fs + 1) << 32;
                value |= MipsState.Fpr.ReadFPR32Unsigned(inst.Fs);
            }

            MipsState.WriteGPRUnsigned(inst.Rt, value);
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:28,代碼來源:Interpreter_FPU.cs

示例2: Inst_Add

        private void Inst_Add(MipsInstruction inst)
        {
            if (!MipsState.Operating64BitMode)
            {
                try
                {
                    MipsState.WriteGPR32Signed(inst.Rd, MipsState.ReadGPR32Signed(inst.Rs) + MipsState.ReadGPR32Signed(inst.Rt));
                }
                catch (OverflowException)
                {
                    CauseException = ExceptionCode.OverFlow;
                }

            }
            else
            {
                if (MipsState.ReadGPRUnsigned(inst.Rs).IsSigned32() && MipsState.ReadGPRUnsigned(inst.Rt).IsSigned32())
                {
                    try
                    {
                        MipsState.WriteGPRSigned(inst.Rd, MipsState.ReadGPRSigned(inst.Rs) + MipsState.ReadGPRSigned(inst.Rt));
                    }
                    catch (OverflowException)
                    {
                        CauseException = ExceptionCode.OverFlow;
                    }
                }
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:29,代碼來源:Interpreter_ALU.cs

示例3: Inst_Addi

 private void Inst_Addi(MipsInstruction inst)
 {
     if (!MipsState.Operating64BitMode)
     {
         try
         {
             MipsState.WriteGPR32Signed(inst.Rt, MipsState.ReadGPR32Signed(inst.Rs) + (Int32)(Int16)inst.Immediate);
         }
         catch (OverflowException)
         {
             CauseException = ExceptionCode.OverFlow;
         }
     }
     else
     {
         try
         {
             MipsState.WriteGPRSigned(inst.Rt, MipsState.ReadGPRSigned(inst.Rs) + (Int64)(Int16)inst.Immediate);
         }
         catch (OverflowException)
         {
             CauseException = ExceptionCode.OverFlow;
         }
     }
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:25,代碼來源:Interpreter_ALU.cs

示例4: Inst_Bgez

 private void Inst_Bgez(MipsInstruction inst)
 {
     if (!MipsState.Operating64BitMode)
     {
         DoBranch(MipsState.ReadGPR32Signed(inst.Rs) >= 0, inst);
     }
     else
     {
         DoBranch(MipsState.ReadGPRSigned(inst.Rs) >= 0, inst);
     }
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:11,代碼來源:Interpreter_Branch.cs

示例5: Inst_Beql

 private void Inst_Beql(MipsInstruction inst)
 {
     if (!MipsState.Operating64BitMode)
     {
         DoBranchLikely(MipsState.ReadGPR32Unsigned(inst.Rs) == MipsState.ReadGPR32Unsigned(inst.Rt), inst);
     }
     else
     {
         DoBranchLikely(MipsState.ReadGPRUnsigned(inst.Rs) == MipsState.ReadGPRUnsigned(inst.Rt), inst);
     }
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:11,代碼來源:Interpreter_Branch.cs

示例6: Inst_Teq

        private void Inst_Teq(MipsInstruction inst)
        {
            Boolean condition;

            if (!MipsState.Operating64BitMode)
                condition = MipsState.ReadGPR32Unsigned(inst.Rs) == MipsState.ReadGPR32Unsigned(inst.Rt);
            else
                condition = MipsState.ReadGPRUnsigned(inst.Rs) == MipsState.ReadGPRUnsigned(inst.Rt);

            if (condition)
                CauseException = ExceptionCode.Trap;
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:12,代碼來源:Interpreter_Main.cs

示例7: Inst_Eret

        private void Inst_Eret(MipsInstruction inst)
        {
            if (MipsState.CP0Regs.StatusReg.CopUsable0)
                CauseException = ExceptionCode.CopUnstable;

            if (MipsState.CP0Regs.StatusReg.ExceptionLevel)
            {
                MipsState.PC = (Int64)MipsState.CP0Regs.ErrorEPC;
                MipsState.CP0Regs.StatusReg.ExceptionLevel = false;
            }
            else
            {
                MipsState.PC = (Int64)MipsState.CP0Regs.EPC;
                MipsState.CP0Regs.StatusReg.ExceptionLevel = false;
            }

            MipsState.LLBit = false;
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:18,代碼來源:Interpreter_TLB.cs

示例8: Inst_Cfc1

        private void Inst_Cfc1(MipsInstruction inst)
        {
            if (!CheckCop1Usable())
            {
                CauseException = ExceptionCode.CopUnstable;
                return;
            }

            if (inst.Rd == 0)
            {
                MipsState.WriteGPRUnsigned(inst.Rd, MipsState.FCR0);
            }

            if (inst.Rd == 31)
            {
                MipsState.WriteGPRUnsigned(inst.Rd, MipsState.FCR31.RegisterValue);
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:18,代碼來源:Interpreter_FPU.cs

示例9: Inst_Ctc1

        private void Inst_Ctc1(MipsInstruction inst)
        {
            if (!CheckCop1Usable())
            {
                CauseException = ExceptionCode.CopUnstable;
                return;
            }

            if (inst.Fs == 0)
            {
                MipsState.FCR0 = MipsState.ReadGPR32Unsigned(inst.Rt);
            }

            if (inst.Fs == 31)
            {
                MipsState.FCR31.RegisterValue = MipsState.ReadGPR32Unsigned(inst.Rt);
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:18,代碼來源:Interpreter_FPU.cs

示例10: Inst_Lbu

 private void Inst_Lbu(MipsInstruction inst)
 {
     try
     {
         if (!MipsState.Operating64BitMode)
         {
             MipsState.WriteGPR32Signed(inst.Rt, DataManipulator.LoadByteUnsigned(ComputeAddress32(inst)));
         }
         else
         {
             MipsState.WriteGPRSigned(inst.Rt, DataManipulator.LoadByteUnsigned(ComputeAddress64(inst)));
         }
     }
     catch (TLBException tlbe)
     {
         switch (tlbe.ExceptionType)
         {
             case TLBExceptionType.Invalid: CauseException = ExceptionCode.Invalid; break;
             case TLBExceptionType.Mod: CauseException = ExceptionCode.TlbMod; break;
             case TLBExceptionType.Refill: CauseException = ExceptionCode.TlbStore; break;
             default: break;
         }
     }
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:24,代碼來源:Interpreter_Load.cs

示例11: Inst_Syscall

 private void Inst_Syscall(MipsInstruction inst)
 {
     CauseException = ExceptionCode.Syscall;
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:4,代碼來源:Interpreter_Main.cs

示例12: Inst_Sync

 private void Inst_Sync(MipsInstruction inst)
 {
     /* LOL Just ignore this, we know loads and stores always finish before SYNC opcode */
     return;
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:5,代碼來源:Interpreter_Main.cs

示例13: Inst_Mtlo

 private void Inst_Mtlo(MipsInstruction inst)
 {
     MipsState.Lo = MipsState.ReadGPRUnsigned(inst.Rs);
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:4,代碼來源:Interpreter_Main.cs

示例14: Inst_Mflo

 private void Inst_Mflo(MipsInstruction inst)
 {
     MipsState.WriteGPRUnsigned(inst.Rd, MipsState.Lo);
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:4,代碼來源:Interpreter_Main.cs

示例15: Inst_Cache

 private void Inst_Cache(MipsInstruction inst)
 {
     logger.Debug("Cache instruction ignored");
 }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:4,代碼來源:Interpreter_Main.cs


注:本文中的Soft64.MipsR4300.MipsInstruction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。