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

MDI() private method

private MDI ( ushort operand ) : void
operand ushort
return void
        private void MDI(ushort operand)
        {
            ushort value;
            RegGeneral destination;
            try {
                BitPatternALU(operand, out value, out destination);
                if (value == 0) {
                    Interrupt_DivZeroFault(operand);
                    return;
                }
                int s_result = (short)R[(int)destination] % (short)value;
                ushort r = (ushort)(s_result & 0x0000FFFF);
                R[(int)destination] = r;
                FL_N = (r & 0x8000) != 0;
                FL_Z = r == 0x0000;
                // C [Carry] Not effected.
                // V [Overflow] Not effected.
            }
            catch (SegFaultException e) {
                Interrupt_SegFault(e.SegmentType, operand, e.Address);
            }
        }