17.7 Clearing Interrupt Flags
The individual status flag bits (IOCAFx, IOCBFx, IOCCFx and IOCEF3) can be cleared by resetting them to zero. If another edge is detected during this clearing operation, the associated status flag will be set at the end of the sequence, regardless of the value actually being written.
To ensure that no detected edge is lost while clearing flags, only AND operations masking out known changed bits must be performed. The following sequence is an example of what must be performed.
Clearing Interrupt Flags (PORTA Example)
MOVLW 0xff XORWF IOCAF, W ANDWF IOCAF, F