On Mon, 2 Apr 2001, Olin Lathrop wrote: > > 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. Is it worth mentioning that you can save one instruction? Or how about two more if you don't care about the carry out? Scott -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads