Non-recursive filter to smoothen saw tooth wave
You need to realize that as you are passing over the input, you will be dividing each input by 8 four times and dividing each input by 4 once. You will also calculate the sum of each adjacent input twice. We can try to get rid of this redundancy. 

First lets rewrite the filter:

y[0] = x[-2]/8 + x[-1]/8 + x[0]/4 + x[1]/8 + x[2]/8


like so:

y[0] = (x[-2] + x[-1] + x[0] + x[1] + x[2])/8 + x[0]/8 + (1 if x[0] odd, 0 otherwise)

Multiply both sides by 8:
8*y[0] = (x[-2] + x[-1] + x[0] + x[1] + x[2]) + x[0] + 8*(x[0]&amp;1)

Assuming integers, if the input is floating point, just skipp the odd/even bit.


Notice how you now have a sliding sum? That's effective to compute.  

I'm not well versed in assembly but I can give you pseudo C-code which you can translate to assembly:

void computeSample(int slidingSum, int midSample){
   return (slidingSum + midSample + (midSample &amp; 1) * 8)/8;
}

void filter(int *input, int *output, int len) {
    const int width = 2;

    if (len &lt; width*2 + 1) { return; }

    int slidingSum = 0;
    for (int i = 0; i &lt; width*2 + 1; ++i) {
        slidingSum += input[i];
    }

    output[width] = computeSample(slidingSum, input[width]);
    for (int x0 = width + 1; x0 &lt; len - width; ++x0) {
        slidingSum -= input[x0 - (width+1)];
        slidingSum += input[x0 + width];
        output[x0] = computeSample(slidingSum, input[x0]);
    }
}


You need to figure out how to handle the edges of the signal (repeating, zero extending, no-data etc). 

Hope this helps!