On Wed, 16 Jul 1997 06:25:54 +0400 Dmitry Kiryashov writes: >Hello John . > >> movf S1,w >> btfsc C >> incfsz S1,w >> addwf D1,f > >Stop. For example S1=0xFF , D1=0x00 , Carry=1 . After executing your >code result will >be equal 0x00 with Carry=0 not =1 . It's error . In my code to correct >this situation >I save previous Carry's in S1 . Look closer. Notice that the operation on S1 if C is set is incfsz: Increment f, *skip if (now) zero*. If S1+1 =0, the add will be skipped (what's the point of adding 0?). So if S1=FF, C in = 1, the incfsz will be executed, and it will skip. C will still be 1 because the add was not executed. And the sum will be correct also because zero would have been added. This code works. Some of the Microchip examples use incf instead, which is wrong, though it does work for a 16 bit add since the carry out is usually not used.