I have to convert this FIR filter in C code to assembly mips64 with the least commands possible. How is it possible to make the fir
function with more than 4 arguments in assembly mips64? I am using winmips64 as a simulator. I only care about declaring the function correctly
void fir(int X[], int H[], int Y[], int n, int m)
{
int i, j;
int y0;
for (j=0; j<m; j++){
y0=0;
for (i=0; i<n; i++){
y0+=X[i+j]*H[i];
}
Y[j]=y0;
}
}
The simulator itself most likely doesn't care about your calling convention.
Look to your assignment text and course work for the official calling convention you're supposed to follow.
If you are calling the assembly code from C, then one approach is to compile and disassemble the C code of the caller to see how the parameters are passed, and, that's how you should expect to receive them. (You can also compile the C version of the actual function as well.)
I only care about declaring the function correctly
There is no concept of declaring functions (function signatures) in assembly. (Search declaration vs. definition.) In assembly there is only the function name, and the expectation (by both caller and callee) of which parameter goes/is where, which is dictated by the applicable calling convention.