> So I would like to implement a running average algorithm, which gives the > average of the last eight values. It should add up the last eight values > and divide then by 8. but my values can be everything between 256 and 0. > If I divide every value before adding them up I get very arbitrary > averages from low input numbers due to rounding errors. Is there a > possibility to do 16 bit integer arithmetric with two data registers. My personal preferred approach to this problem is to average pairs, then average pairs of averages, etc. If I had eight numbers num0 to num7, then I'd do something like this: Ave2: ds 1 Ave4: ds 1 Ave8: ds 1 Temp: ds 1 ... AveEmAll: movf Num0,w addwf Num1,w movwf Ave2 rrf Ave2 movf Num2,w addwf Num3,w movwf Temp rrf Temp,w addwf Ave2,w movwf Ave4 rrf Ave4 movf Num4,w addwf Num5,w movwf Ave2 rrf Ave2 movf Num6,w addwf Num7,w movwf Temp rrf Temp,w addwf Ave4 movwf Ave8 rrf Ave8 ; 22 instructions total Not quite as precise as doing full-precision adds, but a little faster if the numbers may be in the range 128-255. If the numbers are known to be smaller (e.g. 128 or less) then it may make sense to add pairs of then and then average those pairs.