public void LDIR()
    {
        z80_ICount[0] -= 5; 
        Z80.PC.AddD(-2);
        do
        {
            LDI();
            if(Z80.BC.D !=0)
            {
                if(z80_ICount[0] >0)
                {
                    Z80.R = (Z80.R + 2) & 0xFF; /* increment R twice */
                    z80_ICount[0] -= 21;
                }
                else break;
            }
            else
            {
                    Z80.PC.AddD(2);//PC += 2;
                    z80_ICount[0] += 5;
                    break;
            }
        }while( z80_ICount[0] > 0 );
    }