当前位置: 首页>>代码示例>>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;未经允许,请勿转载。