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
a开发者_开发问答ffect the status register?
This question probably talking about PIC MCPUs, so I have added pic
tag.
PIC MCPUs have RISC architecture, which is high-optimised logic and that is the main reason why MOVWF
will not to affect to the Zero
flag in Status
register.
When value is loaded in to W
(WREG)
the Zero
flag in Status
register is set, so there is no reason to be set again when we store that value with MOVWF
instruction. This is useful in case that we must test the Zero flag after MOVWF
instruction.
精彩评论