ADD, ADDB

NOTE: These items have been discontinued for a long time.
We no longer support these products or offer alternatives.

We retain these pages so that users can see what their existing tools support and to provide download links to the final documentation and software versions. We have a few replacement parts left, but not many. Available items have an 'ADD to CART' or 'Buy Now' button next to them. Otherwise they are not available.

logo has a few items in stock as well.

 

ADD        fr,#literal        Add literal into fr


Words:        2        Cycles:        2                Affects:        W, C, DC, Z

 

Operation:        Literal is added into fr via W. C will be set if an overflow occurs; otherwise, C will be cleared. DC will be set or cleared depending on whether or not an overflow occurs in the lower nibble. Z will be set if the result is 0; otherwise, Z will be cleared. W is left holding the literal value.

 

Coding:        MOV  W,#lit   (MOVLW  lit)

       ADD  fr,W     (ADDWF  fr,1)

 

 

ADD        fr1,fr2                Add fr2 into fr1


Words:        2        Cycles:        2                Affects:        W, C, DC, Z

 

Operation:        Fr2 is added into fr1 via W. C will be set if an overflow occurs; otherwise, C will be cleared. DC will be set or cleared depending on whether or not an overflow occurs in the lower nibble. Z will be set if the result is 0; otherwise, Z will be cleared. W is left holding the contents of frb.

 

Coding:        MOV  W,fr2   (MOVF   fr2,0)

       ADD  fr1,W   (ADDWF  fr1,1)

 

 

ADD        fr,W                Add W into fr


Words:        1        Cycles:        1                Affects:        C, DC, Z

 

Operation:        W is added into fr. C will be set if an overflow occurs, otherwise C will be cleared. DC will be set or cleared depending on whether or not an overflow occurs in the lower nibble. Z will be set if the result is 0, otherwise Z will be cleared.

 

Coding:        ADDWF fr,1

 

 

ADD        W,fr                Add fr into W


Words:        1        Cycles:        1                Affects:        C, DC, Z

 

Operation:        Fr is added into W. C will be set if an overflow occurs, otherwise C will be cleared. DC will be set or cleared depending on whether or not an overflow occurs in the lower nibble. Z will be set if the result is 0, otherwise Z will be cleared.

 

Coding:        ADDWF fr,0

 

 

ADDB        fr,bit                Add bit into fr


Words:        2        Cycles:        2                Affects:        Z

 

Operation:        If bit is set, fr is incremented. If fr is incremented, Z will be set if the result is 0; otherwise, Z will be cleared. This instruction is useful for adding the carry into the upper byte of a double-byte sum after the lower byte has been computed.

 

Coding:        SNC  bit   (BTFSC  bit)

       INC  fr        (INCF   fr,1)