I wonder how to enable the use of fbstp in the I86 32-bit architecture. I tried something like
int main( )
{
double foo = 100.0;
long bar = 0;
asm( "pushl %1; fbstp %0"
: "=m"(bar)
: "r"(foo)
);
...
But the bar has not changed. I tried to read everything I can find on this, but in most cases just do things like adding two integers. I cannot find any talk about how to push operands onto the stack, and what should I do when an instruction, such as fbstp, writes 80 bits of data back to memory (i.e. what type is C) and how to point it to syntax asm.
Also on x86-64 there seems to be pushq and no pushl, but fbstp still exists, while fbstq does not. Is there any other magic for 64 bits.