【发布时间】:2012-06-26 19:41:54
【问题描述】:
我遇到过几个在没有第二个操作数的情况下使用 MOVF 的例子,例如:
;incorrect context restore
MOVF STATUS_Temp,w
MOVWF STATUS
MOVF W_Temp ;this may change the Z bit <------ !! MOVF with single operand !!
;in the Status register
;good context restore
MOVF STATUS_Temp,w
MOVWF STATUS
SWAPF W_Temp,f ;swap in place
SWAPF W_Temp,w ;swap with Wreg destination
(取自 PICKIT2 LPC 板用户指南的示例)
MPLAB SIM 中的一项快速实验表明,第二个“目标”操作数是可选的,默认为工作寄存器。即
MOVF W_Temp,w
这是那些编码“功能”之一,虽然严格来说是可能的,但只是另一种降低代码可读性的方法吗?或者还有更多的东西吗?
【问题讨论】: