1
2#include <stdio.h>
3#include <stdlib.h>
4
5void do_fstenv ( void* p )
6{
7   asm("fldpi ; fld1; fldln2 ; movl 8(%esp), %eax ; fstenv (%eax)");
8}
9
10int main ( void )
11{
12   int i;
13   unsigned int* buf = malloc(7*sizeof(int));
14   do_fstenv(buf);
15   for (i = 0; i < 7; i++) {
16      printf("%08x ", buf[i]);
17      if (i > 0 && ((i % 6) == 5))
18          printf("\n");
19   }
20   printf("\n");
21   return 0;
22}
23