Olin Lathrop wrote 2011-03-10 17:04:
> Josh Koffman wrote:
>> For WREG, on entry I execute a
>> "MOVWF W_Temp", and on exit "MOVF W_Temp, W".
>
> That will trash some status bits.
>
> I don't get it. Interrupt save/restore is a well-invented wheel. =
Why
> do people keep trying to create their own code, especially when they don'=
t
> know what they're doing enough to get it right!?
>
>
> ********************************************************************
> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
> (978) 742-9014. Gold level PIC consultants since 2000.
And besides, if one is *not* using dual interrupt priority, the PIC18
chip will save whatever is needed automaticly anyway. Then you decide
if you want to restore the saved values with "RETFIE" or "RETFIE, FAST".
"NOT-FAST" is the default... :-)
Only if you use the dual prio interrupts is there any need to code
your own save/restors context. And, of course, if you need to save
anything else then W, STATUS and BSR registers.
Btw, I just saw that this can be used for standard subrutine calls
also. Didn't knew that...
CALL , FAST
RETURN , FAST
Problem is that, as soon as you use *any* interrupts at all, this
will not work with CALL/RETURN at the same time...
--=20
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
.