I am writing a function in nasm that will be called from 32bit ansi C.
The function prototype in C looks like this:
long double scalar(int n, long double *x)
mov ecx, [esp+8] ; n
mov eax, [esp+12] ; *x
fld [eax] ; ERROR: operation size not specified
To specify the size explicitely use the following form in NASM:
fld TWORD [eax] ; load 10 bytes from [eax]
As you pointed out, FPU stack registers are 80 bits wide. The C compiler chooses 12 bytes, because of the data alignment requirements of the stack frame.