RE: Interrupts and Sleep

The INTCON register contains a Global Interrupt Enable bit (GIE) and also masks for each interrupt source.
T0IE is the mask for Timer 0 overflow
INTE is the mask for the external interrupt
RBIE is the mask for interrupt on PORTB change .
EEIE is the mask for EEPROM write complete interrupt.

In practice, to enable interrupts, you set the masks for whichever interrupt sources to wish to use, and then set GIE.

If you wish to turn off all interrupts then there is a small gotcha.  Basically if you just clear GIE, then there is a chance it will be re-enabled by a pending interrupt.  You have to clear GIE and then check that it is still clear.  Something like:

InterruptsOff
        bcf     INTCON,GIE
        btfsc   INTCON,GIE
        goto    InterruptsOff

Once you have turned interrupts on, they shouldn't turn themselves off so there's no need to re-enable them.

In your interrupt routine, starting at address 0x04, you should check the interrupt flags T0IF,INTF,RBIF,EEIF to check which source has caused the interrupt.  You should then clear that flag for the next time.

Hope that helps

Mike