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

MUL() private method

private MUL ( ushort operand ) : void
operand ushort
return void
        private void MUL(ushort operand)
        {
            ushort value;
            RegGeneral destination;
            try {
                BitPatternALU(operand, out value, out destination);
                int result = R[(int)destination] * value;
                R[(int)RegGeneral.R0] = (ushort)(result >> 16);
                FL_C = R[(int)RegGeneral.R0] != 0;
                R[(int)destination] = (ushort)(result & 0x0000FFFF);
                FL_N = false; // Always cleared.
                FL_Z = result == 0;
                // V [Overflow] Not effected.
            }
            catch (SegFaultException e) {
                Interrupt_SegFault(e.SegmentType, operand, e.Address);
            }
        }