I’m learning assembly, and it seems that MOVF f,d can be moved f to f, but the zero flag in the status register will be set, meaning it’s useful to check if f is zero. Why doesn’t MOVWF affect the status register?
I’m learning assembly, and it seems that MOVF f,d can be moved f to
Share
This question probably talking about PIC MCPUs, so I have added
pictag.PIC MCPUs have RISC architecture, which is high-optimised logic and that is the main reason why
MOVWFwill not to affect to theZeroflag inStatusregister.When value is loaded in to
W(WREG)theZeroflag inStatusregister is set, so there is no reason to be set again when we store that value withMOVWFinstruction. This is useful in case that we must test the Zero flag afterMOVWFinstruction.