Just noticed a typo in the code I posted the other day... The IORWF in the tenth line should, of course, be an IORLW. Corrected code follows: ; AHI:ALO = AVERAGE, NHI:NLO = NEW DATA, BHI:BLO = TEMP MOVF ALO,W ;NHI:NLO = N - A. SUBWF NLO ; MOVF AHI,W ; SKPC ; INCFSZ AHI,W ; SUBWF NHI ; SWAPF NHI,W ;BHI:W = N/16. ANDLW 00001111B ; BTFSC NHI,7 ; IORLW 11110000B ; <--- WAS INCORRECTLY "IORWF" MOVWF BHI ; SWAPF NLO,W ; ANDLW 00001111B ; MOVWF BLO ; SWAPF NHI,W ; ANDLW 11110000B ; IORWF BLO,W ; ADDWF ALO ;AHI:ALO = A + BHI:W. SKPNC ; INCF AHI ; MOVF BHI,W ; ADDWF AHI ; Sorry... -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.