Ypsilon.Emulation.Processor.YCPU.LSR C# (CSharp) Method

LSR() private method

private LSR ( ushort operand ) : void
operand ushort
return void
        private void LSR(ushort operand)
        {
            ushort value;
            RegGeneral destination;
            BitPatternSHF(operand, out value, out destination);
            uint register = (uint)R[(int)destination] >> value;
            uint mask = (uint)Math.Pow(2, value) - 1;
            FL_C = (mask & register) != 0;
            R[(int)destination] = (ushort)(register & 0x0000FFFF);
            FL_N = (R[(int)destination] & 0x8000) != 0;
            FL_Z = register == 0x0000;
            // V [Overflow]    Not effected.
        }