示例#1
0
        protected int NotLong(int opcode)
        {
            IOperand op = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      s  = op.GetLong();
            int      r  = ~s;

            op.SetLong(r);
            cpu.CalcFlags(InstructionType.NOT, s, 0, r, Size.SizeLong);
            return(op.IsRegisterMode() ? 6 : 12 + op.GetTiming());
        }
示例#2
0
        protected int MoveLong(int opcode)
        {
            IOperand src = cpu.ResolveSrcEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);
            IOperand dst = cpu.ResolveDstEA((opcode >> 6) & 0x07, (opcode >> 9) & 0x07, Size.SizeLong);
            int      s   = src.GetLong();

            dst.SetLong(s);
            cpu.CalcFlags(InstructionType.MOVE, s, s, s, Size.SizeLong);
            return(LongExecutionTime[src.Index()][dst.Index()]);
        }
示例#3
0
        protected int NegxLong(int opcode)
        {
            IOperand op = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      s  = op.GetLong();
            int      r  = (0 - (s + (cpu.IsFlagSet(cpu.XFlag) ? 1 : 0)));

            op.SetLong(r);
            cpu.CalcFlags(InstructionType.NEGX, s, 0, r, Size.SizeLong);
            return(op.IsRegisterMode() ? 6 : 12 + op.GetTiming());
        }
示例#4
0
        protected int EorLong(int opcode)
        {
            int      s   = cpu.GetDataRegisterLong((opcode >> 9) & 0x07);
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);
            int      d   = dst.GetLong();
            int      r   = s ^ d;

            dst.SetLong(r);
            cpu.CalcFlags(InstructionType.EOR, s, d, r, Size.SizeLong);
            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }
示例#5
0
        protected int SubiLong(int opcode)
        {
            int      s   = cpu.FetchPCLong();
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);
            int      d   = dst.GetLong();
            int      r   = d - s;

            dst.SetLong(r);
            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.SizeLong);
            return(dst.IsRegisterMode() ? 16 : 20 + dst.GetTiming());
        }
示例#6
0
        protected int SubLongEaDest(int opcode)
        {
            int      s   = cpu.GetDataRegisterLong((opcode >> 9) & 0x07);
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);
            int      d   = dst.GetLong();
            int      r   = d - s;

            dst.SetLong(r);
            int time = 12 + dst.GetTiming();

            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.SizeLong);
            return(time);
        }
示例#7
0
        protected int ClrLong(int opcode)
        {
            IOperand op = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);

            op.GetLong();
            op.SetLong(0);
            int flags = cpu.GetCCRegister();

            flags &= ~(cpu.NFlag | cpu.CFlag | cpu.VFlag);
            flags |= cpu.ZFlag;
            cpu.SetCCRegister(flags);
            return(op.IsRegisterMode() ? 6 : 12 + op.GetTiming());
        }
示例#8
0
        protected int SubqLong(int opcode)
        {
            int s = (opcode >> 9 & 0x07);

            if (s == 0)
            {
                s = 8;
            }
            int      mode = (opcode >> 3) & 0x07;
            IOperand dst  = cpu.ResolveDstEA(mode, (opcode & 0x07), Size.SizeLong);
            int      d    = dst.GetLong();
            int      r    = d - s;

            dst.SetLong(r);
            if (mode != 1)
            {
                cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.SizeLong);
            }
            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }
示例#9
0
        protected int BsetDynLong(int opcode)
        {
            var bit = cpu.GetDataRegisterLong((opcode >> 9) & 0x07) & 31;

            bit = 1 << bit;
            IOperand op  = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      val = op.GetLong();

            if ((val & bit) != 0)
            {
                cpu.ClrFlags(cpu.ZFlag);
            }
            else
            {
                cpu.SetFlags(cpu.ZFlag);
            }

            val |= (bit);
            op.SetLong(val);
            return(10);
        }
示例#10
0
        protected int BsetStaticLong(int opcode)
        {
            var bit = cpu.FetchPCWord() & 31;

            bit = 1 << bit;
            IOperand op  = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      val = op.GetLong();

            if ((val & bit) != 0)
            {
                cpu.ClrFlags(cpu.ZFlag);
            }
            else
            {
                cpu.SetFlags(cpu.ZFlag);
            }

            val |= (bit);
            op.SetLong(val);
            return(14);
        }