> I've got this question over which I have > been breaking my head far too long. Maybe > somebody can get me out of my misery... > > What's the meaning of the SWAPF instructions, > performed on W and STATUS register in the > saving and restoring code, proposed by > Microchip in the PIC datasheets ??? > This is just a neat little trick they use to save the state of a file register without affecting the status bits, such as Z, C...etc If you used a movf instruction it would affect the Z bit. Example: swapf status,0 This swaps the nibbles in status and stores the result in W movwf temp temp now contains the status with the nibbles swapped swapf temp,0 swaps the nibbles back to thier original state and stores the result back into W. movwf status Status is effectively restored now I hope this helps...... Mike henning mikeh@smart.net