public void LDI()
    {
    	int io = cpu_readmem16(Z80.HL.D) & 0xFF; 										
    	cpu_writemem16(Z80.DE.D, io );												
    	Z80.AF.SetL(Z80.AF.L & (SF | ZF | CF)); 										
    	if(( (Z80.AF.H + io) & 0x02 )!=0)
            Z80.AF.SetL(Z80.AF.L | YF); /* bit 1 -> flag 5 */		
        if(( (Z80.AF.H + io) & 0x08 )!=0)
            Z80.AF.SetL(Z80.AF.L | XF); /* bit 3 -> flag 3 */      
        Z80.HL.AddD(1);
        Z80.DE.AddD(1);
        Z80.BC.AddD(-1);                                       
    	if( Z80.BC.D !=0 ) 
            Z80.AF.SetL(Z80.AF.L | VF);						
    }
    /*TODO*////***************************************************************
    /*TODO*/// * CPI
    /*TODO*/// ***************************************************************/
    /*TODO*///#if Z80_EXACT
    /*TODO*///#define CPI {													\
    /*TODO*///	UINT8 val = RM(_HL);										\
    /*TODO*///	UINT8 res = _A - val;										\
    /*TODO*///	_HL++; _BC--;												\
    /*TODO*///	_F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF;  \
    /*TODO*///	if( _F & HF ) res -= 1; 									\
    /*TODO*///	if( res & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */			\
    /*TODO*///	if( res & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */			\
    /*TODO*///    if( _BC ) _F |= VF;                                         \
    /*TODO*///}