Hello,

I'm trying to translate the following math operating from assembly to C. Its a multiply and add instruction

mr = mr + mx0 * my0 (SS)

this instruction is in a loop and mr is accumulated across a data set.

finally this result is moved

dm(_ch1_sin) = mr2;

dm(_ch1_sin+1) = mr1;

dm(_ch1_sin+2) = mr0;

so I'm guessing that mr0, mr1 and mr2 are 8-bits each containing the contents of mr (actually 40-bits)

I was looking at some of the fraction arithmetic or ESTI functions but none of them seem to make the 40-bit accum available.

any ideas?

Thanks,

Hi Satyajit,

It may not be possible to implement the exact requirements you mentioned purely in C. This is because the result returned by a C multiplication function e.g. "__builtin_mult_fr1x32" is 32 bit only. The result is usually saturated if there is an overflow. If you want to store entire 40 bit result, you might have to customize the assembly source code or write a separate assembly code and use a mix of C and Assembly code.

Hope this helps.

Thanks,

Mitesh