I'm trying to understand saving W in various sized PICS (more or less code space). See page 187 of the PBP manual.
Let's say I have a 16F870 - - the first two examples would apply there
Let's say I have a 16F876A - - then all four examples would apply.
Must all four saves then be used ?
Now see page 188
the example shows :
myint movwf wsave ; <= 2K only
It does not seem to require wsave Var Byte $a0 System
I am probably not doing a very good job explaning my question - -
How many "wsaves" must be used , and what about when exiting the interrupt?
Only one swapf wsave,W is used.
Now, if more than one wsave is used, what swapf needs to be used?
Is the W register saved in all the variables, wsave, wsave1, wsave2, wsave3, but only restored using wsave?
The answer is probably simple, but I cannot get my hands around it.
YES, I KNOW, I should simply use DT's instant interrupts and not be concerned about it - - I just want to understand this.
I'm familar using interrupts in pure assembly, but am totally confused here. I've searched (and read through DT's code as well, but have not found an answer.)
Any explination would be greatly appreciated.
Ken
Bookmarks