sewardj | 0181665 | 2004-12-06 14:26:28 +0000 | [diff] [blame] | 1 | |
2 | #include <stdio.h> | ||||
3 | #include <stdlib.h> | ||||
4 | |||||
5 | void do_fstenv ( void* p ) | ||||
6 | { | ||||
7 | asm("fldpi ; fld1; fldln2 ; movl 8(%esp), %eax ; fstenv (%eax)"); | ||||
8 | } | ||||
9 | |||||
10 | int 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 | } |