Hi All,
I am new to PIC's having 'come up' from Micro (Z80/8080/8085) systems, and am experimenting with the 16F628A and 16F88 pics.
I have been looking through some Interrupt service routines for some idea's of the handlers and appreciate that registers such as the W and STATUS registers need to saved for the Return From Interrupt instruction at the end.
Many Interrupt Service Routines seem to use the SWAPF <STORE>,W instruction as a method of storing the W register, but on checking this insturction, this instruction seems to Swap the Upper with the Lower Nibbles of the specified register and place the result in either the source register or the W register based on the value of 'd' (destination), this can only be a '0' or a '1', (so assume that W is not valid).
I can't follow why this instruction can be used to store the W and STATUS registers .... an explanation would be greatly appreciated.
Fenderman
I am new to PIC's having 'come up' from Micro (Z80/8080/8085) systems, and am experimenting with the 16F628A and 16F88 pics.
I have been looking through some Interrupt service routines for some idea's of the handlers and appreciate that registers such as the W and STATUS registers need to saved for the Return From Interrupt instruction at the end.
Many Interrupt Service Routines seem to use the SWAPF <STORE>,W instruction as a method of storing the W register, but on checking this insturction, this instruction seems to Swap the Upper with the Lower Nibbles of the specified register and place the result in either the source register or the W register based on the value of 'd' (destination), this can only be a '0' or a '1', (so assume that W is not valid).
I can't follow why this instruction can be used to store the W and STATUS registers .... an explanation would be greatly appreciated.
Fenderman
Last edited: