Example #1
0
        protected int CmpiByte(int opcode)
        {
            int      s  = CpuUtils.SignExtendByte(cpu.FetchPCWord());
            IOperand op = cpu.ResolveDstEA((opcode >> 3) & 0x07, (opcode & 0x07), Size.Byte);
            int      d  = op.GetByteSigned();
            int      r  = d - s;

            cpu.CalcFlags(InstructionType.CMP, s, d, r, Size.Byte);
            return(op.IsRegisterMode() ? 8 : 8 + op.GetTiming());
        }
Example #2
0
        protected int SubiByte(int opcode)
        {
            int      s   = CpuUtils.SignExtendByte(cpu.FetchPCWord());
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.Byte);
            int      d   = dst.GetByteSigned();
            int      r   = d - s;

            dst.SetByte(r);
            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.Byte);
            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }
Example #3
0
        protected int SubByteEaDest(int opcode)
        {
            int      s   = cpu.GetDataRegisterByteSigned((opcode >> 9) & 0x07);
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.Byte);
            int      d   = dst.GetByteSigned();
            int      r   = d - s;

            dst.SetByte(r);
            int time = 8 + dst.GetTiming();

            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.Byte);
            return(time);
        }
Example #4
0
        protected int SubByteDnDest(int opcode)
        {
            IOperand src = cpu.ResolveSrcEA((opcode >> 3) & 0x07, opcode & 0x07, Size.Byte);
            int      s   = src.GetByteSigned();
            int      reg = (opcode >> 9) & 0x07;
            int      d   = cpu.GetDataRegisterByteSigned(reg);
            int      r   = d - s;

            cpu.SetDataRegisterByte(reg, r);
            int time = 4 + src.GetTiming();

            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.Byte);
            return(time);
        }
Example #5
0
        protected int SubqByte(int opcode)
        {
            int s = (opcode >> 9 & 0x07);

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

            dst.SetByte(r);
            cpu.CalcFlags(InstructionType.SUB, s, d, r, Size.Byte);
            return(dst.IsRegisterMode() ? 4 : 8 + dst.GetTiming());
        }