Don Holtz wrote: > I understand that: > > movlw 1 > iorwf STATUS,F > > will not set C. Yes. Due to IORWF instruction change the _Z bit all _Z & _DC and _C group of bits are protected from direct changing and it changed only according results of operation. In case of IORWF _DC & _C are simply locked while _Z will set according result. But if you want to change _C in this manner you may add one more operation and write your example as following: (myke predko was offer this variant) movlw 1 iorwf STATUS,W movwf STATUS ;this operation do not change any flags ;due to that we have possibility write directly to STATUS > Does: > > bsf STATUS,C > > set the C? Yes it does. This operation directly change only _C bit and not fluent to others. > (bsf/bcf are READ-MODIFY-WRITE instructions... so I hope the data would > be treated in exactly the same way as a READ instruction follow byte a > MODIFY-WRITE instruction?) You may easyly apply bcf/bsf for playing with _Z or _DC or _C bits in status register. > In any case: > > addlw 0 ; will always clear C Yes. > sublw 0 ; will always set C No. PIC substracting logic are based literally on the adding core. So if no borrow after operation then _C=1 (result is positive) Other case when _C=0 (result is negative and borrow take a place). The only situation when sublw_0 will result to _C=1 when W=0 before operation, so 0-0=0 and result is positive and no borrow was taken. WBR Dmitry.