15.3.1 Clearing Interrupt Flags
The individual status flags (IOCxF register bits) 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 may be performed. The following sequence is an
example of what may be performed.
Clearing Interrupt Flags (PORTA Example)
MOVLW 0xFF
XORWF IOCAF, W
ANDWF IOCAF, F