Bob Fehrenbach wrote: > > Bob Blick wrote: > > >> movf Source,w > >> btfsc C > >> incfsz Source,w > >> addwf Dest,f > > >Please continue with the explanation of this one, I'm not quick enough to > >figure out what you're doing. > > Bob, > > Perhaps a whole macro would illustrate: > > ;Two byte add. Standard PIC instruction set does not have an add > ;with carry instruction. > ;At exit, if C = 1, result is greater than 2 bytes. > ;Usage example: add_word buff, new_data > > add_word: macro aaa, bbb > movf (bbb+1), w > addwf (aaa+1), f > movf (bbb), w > skpnc > incfsz (bbb), w > addwf (aaa), f > endm > > Bob > > -- > Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com And as Bob F. and I were recently discussing, this comes from Microchip's AN617. The author is Frank Testa. Someone correct me if I wrong, but I believe Frank has a PhD in physics. Scott