intcon=%00001000 'enable interrupt on PORTB

MainLoop:
if powerswitch=1 then ' Check if Power Switch Pressed
gosub pause1sec ' Wait 1 second
if powerswitch=1 then ' Still pressed?
gosub pause1sec 'yes, wait one more second
@ sleep ' go to sleep wait for change on PORTB
@ nop
intcon=%00000000 ------> change to INTCON.0 = 0
goto AnotherPartOfTheProgram <------ this is where I want the program to resume when the chip wakes up
endif
endif