You only need to use swapf when you RESTORE the context.
When saving it you can use MOVF because MOVF first copies the contents of STATUS to W before it alters the status bits.
when you restore contect THE ONLY RIGHT WAY is to use SWAPF.
I don't think this is correct at all. SWAPF swaps the nibbles, so if you use SWAPF only to restore you will not have the correct byte.
EDIT: Better explain swap the nibbles: the low nibble becomes the high, and the high nibble becomes the low.
if register foo = 3F,
swapf foo, f
puts F3 into foo.
swapf foo,w
puts F3 into w and leaves foo unchanged.
Last edited: