コード例 #1
0
ファイル: EORI.cs プロジェクト: maximilien-noal/m68k
        protected int EoriWord(int opcode)
        {
            int      s   = cpu.FetchPCWord();
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.Word);
            int      d   = dst.GetWord();
            int      r   = s ^ d;

            if (dst.IsSR())
            {
                if (cpu.IsSupervisorMode())
                {
                    cpu.SetSR(r);
                }
                else
                {
                    cpu.RaiseSRException();
                    return(34);
                }
            }
            else
            {
                dst.SetWord(r);
                cpu.CalcFlags(InstructionType.EOR, s, d, r, Size.Word);
            }

            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }
コード例 #2
0
ファイル: EORI.cs プロジェクト: maximilien-noal/m68k
        protected int EoriByte(int opcode)
        {
            int      s   = cpu.FetchPCWord() & 0x00ff;
            IOperand dst = cpu.ResolveDstEA((opcode >> 3) & 0x07, opcode & 0x07, Size.Byte);
            int      d   = dst.GetByte();
            int      r   = s ^ d;

            dst.SetByte(r);
            if (!dst.IsSR())
            {
                cpu.CalcFlags(InstructionType.EOR, s, d, r, Size.Byte);
            }
            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }
コード例 #3
0
        protected int OriByte(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   = s | d;

            dst.SetByte(r);
            if (!dst.IsSR())
            {
                cpu.CalcFlags(InstructionType.OR, s, d, r, Size.Byte);
            }
            return(dst.IsRegisterMode() ? 8 : 12 + dst.GetTiming());
        }