> > Given: X1 and X2 and RESULT are each 3 bytes long > > > > movf X1,W > > movwf RESULT > > movf X1+1,W > > movwf RESULT > > movf X1+2,W > > movwf RESULT > > > > movf X2,W > > addwf RESULT,F > > > > movf X2+1,W > > skpnc > > incfsz X2+1,W > > addwf RESULT+1,F > > > > movf X2+2,W > > skpnc > > incfsz X2+2,W > > addwf RESULT+2,F > > I like your method of SKIPNC followed by INCFSZ, I hadn't thought of that. > I have been using a far more clunky method with a temp variable to deal with > carry from propagate carry. > > However, in case anyone may be copying and pasting this code, the last two > MOVWF in the first block should be to RESULT+1 and RESULT+2. > > Olin Lathrop oops! By the way: I didn't invent this. It is in one of the Microchop app notes and I've seen it used all over the place. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads