Hi Barry,
I don't see the need for all the IF/ENDIF stuff, care to explain?

Instead, why not do like I did in the previous example:
Code:
Counter[0] = Counter[0] + IOCBP.0  ' Positive edge on RB0
Counter[1] = Counter[1] + IOCBP.1  ' Positive edge on RB1
' ....and so on.

IOCBP = 0   ' Clear the interrupt flag registers

' Possibly clear the IOC flag as well IF DT-INTS doesn't do it (I don't know for sure).
If an IOC flag bit IS set the counter will get incremented, if it's not set the counter will not get incremented. If you want to capture negative edges as well then just add a similar block for IOCBN etc. The ISR will take the same amount of time every time which is good and it should be about as quick as my subroutine so you'll probably spend way more time getting in and out of the ISR than actually IN the ISR.

It might be better to read the complete IOCxP register into a temporary register and using that instead. The datasheet does discuss the correct way of doing this ensuring no events gets missed but I haven't really looked into it properly.

/Henrik.