I am writing an intel x86 assembly program to compute logarithms using a log table. I call the assembly function in a c program. I don't want to move all the values in the log table to memory every time i call. I'm new to assembly on a non-simulated processor, so I'm not even sure where I'm allowed to store it. 20,000 32-bit integers.
How can I store a "large" amount of data once at the beginning of a c program, so that I can access it in an assembly routine? If i put it in the .data section, is it moved to memory every time i call the actual function?
Edit: this is how i call the function
#include <stdio.h>
extern int doIt(float) asm("doIt");
int main(){
printf("%d\n", doIt(7.0));
printf("%d\n", doIt(4.0));
... //more calls of the sort
}
Not sure if the c code is completely correct. In doIt i need to access the mentioned table repeatedly.