Amazing! Andrew Warren wrote: > ; 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 ; <--- NEW LINE ADDED > IORWF 11110000B ; <--- NEW LINE ADDED > 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 ; > > -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.