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

SBI() private method

private SBI ( ushort operand ) : void
operand ushort
return void
        private void SBI(ushort operand)
        {
            ushort value;
            RegGeneral destination;
            BitPatternIMM(operand, out value, out destination);
            int u_result = R[(int)destination] - value;
            int s_result = (short)R[(int)destination] - value;
            R[(int)destination] = (ushort)(u_result & 0x0000FFFF);
            FL_N = (u_result & 0x8000) != 0;
            FL_Z = u_result == 0x0000;
            FL_C = (u_result & 0xFFFF0000) != 0;
            FL_V = (s_result < -0x8000) | (s_result > 0x7FFF);
        }