PIC TRICKS (Alan Bradley - May '01)

I once went to a Microchip PIC course and they gave everyone a folder full of programming tricks. The following two might interest readers:

; Exchange contents of register REG and W
MOVWF TEMP1    	; save W
MOVF REG,W     	; save REG
MOVWF TEMP2
MOVF TEMP1,W   	; old <W> ->REG
MOVWF REG
MOVF TEMP2,W   	; old <REG> ->W

; Swap contents of W and REG without using a second register
XORWF REG,F
XORWF REG,W
XORWF REG,F
