public void CPD()
    {
        int val = RM(Z80.HL.D);
        int res = (Z80.AF.H - val) & 0xFF;
        Z80.HL.AddD(-1);
        Z80.BC.AddD(-1);
        Z80.AF.SetL((Z80.AF.L & CF) | SZ[res] | ((Z80.AF.H ^ val ^ res) & HF) | NF);
        if(Z80.BC.D!=0)
        {
            Z80.AF.SetL(Z80.AF.L | VF);
        }
    }
    /*TODO*////***************************************************************
    /*TODO*/// * IND
    /*TODO*/// ***************************************************************/
    /*TODO*///#if Z80_EXACT
    /*TODO*///#define IND {													\
    /*TODO*///    UINT8 io = IN(_BC);                                         \
    /*TODO*///	_B--;														\
    /*TODO*///	WM( _HL, io );												\
    /*TODO*///	_HL--;														\
    /*TODO*///	_F = SZ[_B];												\
    /*TODO*///    if( io & SF ) _F |= NF;                                     \
    /*TODO*///	if( (_C + io - 1) & 0x100 ) _F |= HF | CF;					\
    /*TODO*///	if( (drep_tmp1[_C & 3][io & 3] ^							\
    /*TODO*///		 breg_tmp2[_B] ^										\
    /*TODO*///		 (_C >> 2) ^											\
    /*TODO*///		 (io >> 2)) & 1 )										\
    /*TODO*///        _F |= PF;                                               \
    /*TODO*///}
    /*TODO*///#else
    /*TODO*///#define IND {                                                   \
    /*TODO*///	_B--;														\
    /*TODO*///	WM( _HL, IN(_BC) ); 										\
    /*TODO*///	_HL--;														\
    /*TODO*///	_F = (_B) ? NF : NF | ZF;									\
    /*TODO*///}