Will assigning a value to the W-reg in PIC16F84A during an interrupt, save it after the interrupt is disabled?

Okay so, I'm having this part of my program that needs a value to be checked to continue.

basically, here is what it is doing:

WAIT_INT   ; wait for interrupt
CLRWDT
BTFSS TO_LOOP_OR_NOT    ; will be set after interrupt runs
GOTO WAIT
; interrupt assigns a value to W-reg
; When it exits, it will be compared here below
SUBLW 01H
BTFSS STATUS, Z            ; checks if equal
GOTO WAIT_INT

; rest of code


I am stuck in this part and I don't know if the value W-reg is saved after being assigned in an interrupt.

• A specific sequence of instructions (described in the datasheet) is required to save and restore W and the STATUS register. If you don't do this they will retain the values they were given in the ISR. You could even just change the Z flag and wait for that in your main code. – Bruce Abbott Dec 18 '20 at 17:37
• Since you very rarely know where in your code an interrupt occurs, your interrupt service routine should never corrupt W-reg. Your interrupt servicing code should alter no status bits, nor alter W-reg. Sometimes, a very simple interrupt routine can set a bit in a variable (set a flag) without affecting W-reg or status...with bsf flag,0 for example. – glen_geek Dec 18 '20 at 19:34

The answer is in the datasheet in section 2.4.