public int ADD16(int a, int b) 
    {
        int result = a + b;
        Z80.AF.SetL((Z80.AF.L & 0xc4) | (((a ^ result ^ b) >> 8) & HF) | ((result >> 16) & CF));
        return (result & 0xffff);
    }
    /*TODO*////***************************************************************
    /*TODO*/// * ADC	r16,r16
    /*TODO*/// ***************************************************************/
    /*TODO*///#ifdef	X86_ASM
    /*TODO*///#if Z80_EXACT
    /*TODO*///#define ADC16(Reg)												\
    /*TODO*/// asm (                                                          \
    /*TODO*/// " shrb $1,%1           \n"                                     \
    /*TODO*/// " adcb %%dl,%%cl       \n"                                     \
    /*TODO*/// " lahf                 \n"                                     \
    /*TODO*/// " movb %%ah,%%dl       \n"                                     \
    /*TODO*/// " adcb %%dh,%%ch       \n"                                     \
    /*TODO*/// " lahf                 \n"                                     \
    /*TODO*/// " setob %1             \n"                                     \
    /*TODO*/// " orb $0xbf,%%dl       \n" /* set all but zero */              \
    /*TODO*/// " addb %1,%1           \n"                                     \
    /*TODO*/// " andb $0xd1,%%ah      \n" /* sign,zero,half carry and carry */\
    /*TODO*/// " addb %1,%1           \n"                                     \
    /*TODO*/// " orb %%ah,%1          \n" /* overflow into P/V */             \
    /*TODO*/// " andb %%dl,%1         \n" /* mask zero */                     \
    /*TODO*/// " movb %%ch,%%ah       \n" /* get result MSB */                \
    /*TODO*/// " andb $0x28,%%ah      \n" /* maks flags 5+3 */                \
    /*TODO*/// " orb %%ah,%1          \n" /* put them into flags */           \
    /*TODO*/// :"=c" (_HLD), "=r" (_F)                                        \
    /*TODO*/// :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d)                         \
    /*TODO*/// )
    /*TODO*///#else
    /*TODO*///#define ADC16(Reg)                                              \
    /*TODO*/// asm (                                                          \
    /*TODO*/// " shrb $1,%1           \n"                                     \
    /*TODO*/// " adcb %%dl,%%cl       \n"                                     \
    /*TODO*/// " lahf                 \n"                                     \
    /*TODO*/// " movb %%ah,%%dl       \n"                                     \
    /*TODO*/// " adcb %%dh,%%ch       \n"                                     \
    /*TODO*/// " lahf                 \n"                                     \
    /*TODO*/// " setob %1             \n"                                     \
    /*TODO*/// " orb $0xbf,%%dl       \n" /* set all but zero */              \
    /*TODO*/// " addb %1,%1           \n"                                     \
    /*TODO*/// " andb $0xd1,%%ah      \n" /* sign,zero,half carry and carry */\
    /*TODO*/// " addb %1,%1           \n"                                     \
    /*TODO*/// " orb %%ah,%1          \n" /* overflow into P/V */             \
    /*TODO*/// " andb %%dl,%1         \n" /* mask zero */                     \
    /*TODO*/// :"=c" (_HLD), "=r" (_F)                                        \
    /*TODO*/// :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d)                         \
    /*TODO*/// )
    /*TODO*///#endif
    /*TODO*///#else
    /*TODO*///#define ADC16(Reg)												\
    /*TODO*///{																\
    /*TODO*///	UINT32 res = _HLD + Z80.Reg.d + (_F & CF);					\
    /*TODO*///	_F = (((_HLD ^ res ^ Z80.Reg.d) >> 8) & HF) |				\
    /*TODO*///		((res >> 16) & CF) |									\
    /*TODO*///		((res >> 8) & SF) | 									\
    /*TODO*///		((res & 0xffff) ? 0 : ZF) | 							\
    /*TODO*///		(((Z80.Reg.d ^ _HLD ^ 0x8000) & (Z80.Reg.d ^ res) & 0x8000) >> 13); \
    /*TODO*///	_HL = (UINT16)res;											\
    /*TODO*///}