First set the used PORTB pin(s) as input via TRISB
then clear RBPU to enable pullups then read PORTB once to clear mismatch condition
then clear RBIF (on change it flag)
then set RBIE to enable on change it
finally, only now set GIE (enable global interrupts)
No, had not avoided you, it was that I saw some of your recent posts were in C.
As I only do assembler did not think I could offer any help to your C posts, seems you have come back to assembler ..
RBPU should not affect the Interrupt on Change, its just like having weak external pull up resistors.
Its bCf to turn them On.
When you do the Interrupt on Change it compares the current state to the previous state, you might find it useful to read the port just before you enable the interrupts. movf PORTB,W
No, I do not agree with this. I think that if the pullups are enabled after the interrupt "arming" (as PA3040 did it), then it really may cause interrupt, if (because of) the PORTB pins (may) have changed.
Follow the method what I wrote above.