• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CPUx86类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CPUx86的典型用法代码示例。如果您正苦于以下问题:C# CPUx86类的具体用法?C# CPUx86怎么用?C# CPUx86使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CPUx86类属于命名空间,在下文中一共展示了CPUx86类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            uint address = GetAddress(cpu, instruction.Operand2);
            int size = instruction.Operand1.Size;

            StoreValue(cpu, instruction.Operand1, address, size);
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:7,代码来源:Lea.cs


示例2: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			if (IsSign(cpu.EAX.Value))
				cpu.EDX.Value = ~(uint)0;
			else
				cpu.EDX.Value = 0;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Cdq.cs


示例3: Execute

 public override void Execute(CPUx86 cpu, SimInstruction instruction)
 {
     if (!cpu.EFLAGS.Zero)
     {
         StoreValue(cpu, instruction.Operand1, 1, 8);
     }
 }
开发者ID:tea,项目名称:MOSA-Project,代码行数:7,代码来源:Setnz.cs


示例4: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			if (!cpu.EFLAGS.Parity)
			{
				cpu.EIP.Value = ResolveBranch(cpu, instruction.Operand1);
			}
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Jnp.cs


示例5: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			var a = LoadFloatValue(cpu, instruction.Operand2, instruction.Operand1.Size);
			int size = instruction.Operand1.Size;

			StoreFloatValue(cpu, instruction.Operand1, a, size);
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Cvtss2sd.cs


示例6: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			var a = LoadFloatValue(cpu, instruction.Operand1, instruction.Size).Low;
			var b = LoadFloatValue(cpu, instruction.Operand2, instruction.Size).Low;
			int size = instruction.Size;

			if (double.IsNaN(a) || double.IsNaN(b))
			{
				cpu.EFLAGS.Zero = true;
				cpu.EFLAGS.Parity = true;
				cpu.EFLAGS.Carry = true;
			}
			else if (a == b)
			{
				cpu.EFLAGS.Zero = true;
				cpu.EFLAGS.Parity = false;
				cpu.EFLAGS.Carry = false;
			}
			else if (a > b)
			{
				cpu.EFLAGS.Zero = false;
				cpu.EFLAGS.Parity = false;
				cpu.EFLAGS.Carry = false;
			}
			else
			{
				cpu.EFLAGS.Zero = false;
				cpu.EFLAGS.Parity = false;
				cpu.EFLAGS.Carry = true;
			}

			cpu.EFLAGS.Overflow = false;
			cpu.EFLAGS.Adjust = false;
			cpu.EFLAGS.Sign = false;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:35,代码来源:Ucomisd.cs


示例7: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			var r = LoadFloatValue(cpu, instruction.Operand1, instruction.Operand1.Size);
			int size = instruction.Operand1.Size;

			cpu.ST0.Value = r;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Fld.cs


示例8: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			if (cpu.EFLAGS.Carry || cpu.EFLAGS.Zero)
			{
				cpu.EIP.Value = ResolveBranch(cpu, instruction.Operand1);
			}
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Jbe.cs


示例9: Execute

 public override void Execute(CPUx86 cpu, SimInstruction instruction)
 {
     if (cpu.EFLAGS.Sign != cpu.EFLAGS.Overflow)
     {
         StoreValue(cpu, instruction.Operand1, 1, 8);
     }
 }
开发者ID:tea,项目名称:MOSA-Project,代码行数:7,代码来源:Setle.cs


示例10: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			int a = (int)LoadValue(cpu, instruction.Operand2);
			int size = instruction.Operand1.Size;

			StoreFloatValue(cpu, instruction.Operand1, (double)a, size);
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Cvtsi2sd.cs


示例11: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            double a = LoadFloatValue(cpu, instruction.Operand1);
            double b = LoadFloatValue(cpu, instruction.Operand2);
            int size = instruction.Operand1.Size;

            if (double.IsNaN(a) || double.IsNaN(b))
            {
                cpu.EFLAGS.Zero = true;
                cpu.EFLAGS.Parity = true;
                cpu.EFLAGS.Carry = true;
            }
            else if (a == b)
            {
                cpu.EFLAGS.Zero = true;
                cpu.EFLAGS.Parity = false;
                cpu.EFLAGS.Carry = false;
            }
            else if (a > b)
            {
                cpu.EFLAGS.Zero = false;
                cpu.EFLAGS.Parity = false;
                cpu.EFLAGS.Carry = false;
            }
            else
            {
                cpu.EFLAGS.Zero = false;
                cpu.EFLAGS.Parity = false;
                cpu.EFLAGS.Carry = true;
            }
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:31,代码来源:Comisd.cs


示例12: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            var a = LoadFloatValue(cpu, instruction.Operand1, instruction.Size);
            uint p = LoadValue(cpu, instruction.Operand2);
            int size = instruction.Size;

            float r;
            if ((p & 0x3) == 0x3)
            {
                r = (float)Math.Truncate(a.LowF);
            }
            else if ((p & 0x2) == 0x2)
            {
                r = (float)Math.Ceiling(a.LowF);
            }
            else if ((p & 0x1) == 0x1)
            {
                r = (float)Math.Floor(a.LowF);
            }
            else
            {
                r = (float)Math.Round(a.LowF);
            }

            StoreFloatValue(cpu, instruction.Operand1, r, size);
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:26,代码来源:Roundss.cs


示例13: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			uint a = LoadValue(cpu, instruction.Operand2);
			int size = instruction.Operand1.Size;

			StoreValue(cpu, instruction.Operand1, a, size);
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:7,代码来源:Movzx.cs


示例14: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            uint a = LoadValue(cpu, instruction.Operand1);
            uint b = LoadValue(cpu, instruction.Operand2);
            int size = instruction.Operand1.Size;

            int shift = ((int)b) & 0x1F;

            if (shift == 0)
                return; // no changes

            uint u = a << shift;
            bool sign = IsSign(a, size);

            //if (cpu.FLAGS.Carry)
            //{
            //	u = u | 0x1;
            //}

            StoreValue(cpu, instruction.Operand1, u, size);

            UpdateFlags(cpu, size, u, u, true, true, true, false, false);

            cpu.EFLAGS.Overflow = sign ^ IsSign(u, size);
            cpu.EFLAGS.Carry = sign;
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:26,代码来源:Shl.cs


示例15: Execute

 public override void Execute(CPUx86 cpu, SimInstruction instruction)
 {
     if (cpu.EFLAGS.Sign != cpu.EFLAGS.Overflow)
     {
         cpu.EIP.Value = ResolveBranch(cpu, instruction.Operand1);
     }
 }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:7,代码来源:Jl.cs


示例16: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			uint a = LoadValue(cpu, instruction.Operand1);
			uint b = LoadValue(cpu, instruction.Operand2);
			int size = instruction.Operand1.Size;

			int shift = ((int)b) & 0x1F;

			if (shift == 0)
				return; // no changes

			// TODO: for sizes other than 32
			Debug.Assert(size == 32);

			uint u = (a << 1);

			if (cpu.EFLAGS.Carry)
				u = u | 0x1;

			shift--;

			u = u << shift;

			u = u | (a >> (size - shift));

			StoreValue(cpu, instruction.Operand1, (uint)u, size);

			cpu.EFLAGS.Overflow = cpu.EFLAGS.Carry ^ IsSign(a, size);
			cpu.EFLAGS.Carry = ((a >> (size - shift)) & 0x1) == 1;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:30,代码来源:Rcl.cs


示例17: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            uint a = LoadValue(cpu, instruction.Operand1);
            uint b = LoadValue(cpu, instruction.Operand2);
            int size = instruction.Operand1.Size;

            int shift = ((int)b) & 0x1F;

            if (shift == 0)
                return; // no changes

            bool sign = IsSign(a, size);
            uint u = a >> shift;

            if (sign)
            {
                uint m = (uint.MaxValue << (int)(32 - shift));
                u = u | m;
            }

            StoreValue(cpu, instruction.Operand1, (uint)u, size);

            UpdateFlags(cpu, size, (long)u, u, true, true, false, false, false);

            cpu.EFLAGS.Overflow = (shift != 1);
            cpu.EFLAGS.Carry = ((a >> (shift - 1)) & 0x1) == 1;
            cpu.EFLAGS.Sign = sign;
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:28,代码来源:Sar.cs


示例18: Execute

		public override void Execute(CPUx86 cpu, SimInstruction instruction)
		{
			int size = 32;
			uint value = Read(cpu, cpu.ESP.Value, size);

			cpu.ESP.Value = (uint)(cpu.ESP.Value + (size / 8));
			cpu.EIP.Value = value;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:8,代码来源:Ret.cs


示例19: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            var a = LoadFloatValue(cpu, instruction.Operand2, instruction.Operand2.Size);
            int size = instruction.Operand1.Size;

            uint r = (uint)a.LowF;
            StoreValue(cpu, instruction.Operand1, r, size);
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:8,代码来源:Cvttss2si.cs


示例20: Execute

        public override void Execute(CPUx86 cpu, SimInstruction instruction)
        {
            if (instruction.Operand1 == null)
                return;

            uint v1 = LoadValue(cpu, instruction.Operand1);

            cpu.EIP.Value = (uint)(cpu.EIP.Value + (int)v1);
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:9,代码来源:FarJmp.cs



注:本文中的CPUx86类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CPV类代码示例发布时间:2022-05-24
下一篇:
C# CPPTargetPlatform类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap