4 #define SINTAB_SIZE 512
5 #define SINTAB_SCALE 8192
11 printf("\tbits 32\n");
12 printf("\tsection .rodata\n\n");
14 printf("\tglobal _sintab\n");
17 fputs("\tdw", stdout);
19 for(i=0; i<SINTAB_SIZE; i++) {
20 double theta = (double)i / (double)SINTAB_SIZE * 6.28318530718;
21 double sf = sin(theta);
22 int sx = (int)(sf * SINTAB_SCALE);
23 len += printf(" %d", sx);
26 if(i < SINTAB_SIZE - 1) {
27 fputs("\tdw", stdout);
35 printf("\n\n; vi:ft=nasm ts=8 sts=8 sw=8:\n");