示例#1
0
        protected int MoveaLong(int opcode)
        {
            IOperand src = cpu.ResolveSrcEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);

            cpu.SetAddrRegisterLong((opcode >> 9) & 0x07, src.GetLong());
            return(MOVE.LongExecutionTime[src.Index()][1]);
        }
示例#2
0
        protected int TstLong(int opcode)
        {
            int      mode = (opcode >> 3) & 0x07;
            int      reg  = (opcode & 0x07);
            IOperand op   = cpu.ResolveSrcEA(mode, reg, Size.SizeLong);
            int      v    = op.GetLong();

            if (v == 0)
            {
                cpu.SetFlags(cpu.ZFlag);
            }
            else
            {
                cpu.ClrFlags(cpu.ZFlag);
            }

            if ((v & 0x80000000) != 0)
            {
                cpu.SetFlags(cpu.NFlag);
            }
            else
            {
                cpu.ClrFlags(cpu.NFlag);
            }

            cpu.ClrFlags(cpu.CFlag | cpu.VFlag);
            return(4 + op.GetTiming());
        }
示例#3
0
        protected int AddaLong(int opcode)
        {
            IOperand src = cpu.ResolveSrcEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      s   = src.GetLong();
            int      reg = (opcode >> 9) & 0x07;

            cpu.SetAddrRegisterLong(reg, cpu.GetAddrRegisterLong(reg) + s);
            return(6 + src.GetTiming());
        }
示例#4
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());
        }
示例#5
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());
        }
示例#6
0
        protected int CmpLong(int opcode)
        {
            IOperand op = cpu.ResolveSrcEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      s  = op.GetLong();
            int      d  = cpu.GetDataRegisterLong((opcode >> 9) & 0x07);
            int      r  = d - s;

            cpu.CalcFlags(InstructionType.CMP, s, d, r, Size.SizeLong);
            return(6 + op.GetTiming());
        }
示例#7
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()]);
        }
示例#8
0
        protected int CmpiLong(int opcode)
        {
            int      s  = cpu.FetchPCLong();
            IOperand op = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.SizeLong);
            int      d  = op.GetLong();
            int      r  = d - s;

            cpu.CalcFlags(InstructionType.CMP, s, d, r, Size.SizeLong);
            return(op.IsRegisterMode() ? 14 : 12 + op.GetTiming());
        }
示例#9
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());
        }
示例#10
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());
        }
示例#11
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);
        }
示例#12
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());
        }
示例#13
0
        protected int SubLongDnDest(int opcode)
        {
            IOperand src = cpu.ResolveSrcEA((opcode >> 3) & 0x07, opcode & 0x07, Size.SizeLong);
            int      s   = src.GetLong();
            int      reg = (opcode >> 9) & 0x07;
            int      d   = cpu.GetDataRegisterLong(reg);
            int      r   = d - s;

            cpu.SetDataRegisterLong(reg, r);
            int time = 6 + src.GetTiming();

            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.SizeLong);
            return(time);
        }
示例#14
0
        protected int BtstDynLong(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);
            }

            return(6);
        }
示例#15
0
        protected int BtstStaticLong(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);
            }

            return(10);
        }
示例#16
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());
        }