eblc1388
Active Member
On entering ISR, one needs to save the context of the PIC environment.
Saving W is easy using MOVWF instruction.
Its a bit tricky when saving the STATUS register. There are two choices. The SWAP instruction definitely works. The other alternative is to use the MOVF instruction, which could affect STATUS bits.
The question is: When one does a MOVF STATUS,W instruction, would W contains the original copy or the changed copy?
Saving W is easy using MOVWF instruction.
Its a bit tricky when saving the STATUS register. There are two choices. The SWAP instruction definitely works. The other alternative is to use the MOVF instruction, which could affect STATUS bits.
The question is: When one does a MOVF STATUS,W instruction, would W contains the original copy or the changed copy?