1 2 #include <stdio.h> 3 fldcw_default(void)4void fldcw_default ( void ) 5 { 6 asm(" pushw $0x037F ; fldcw (%esp) ; addl $2, %esp"); 7 } 8 fldcw_exns(void)9void fldcw_exns ( void ) 10 { 11 asm(" pushw $0x037E ; fldcw (%esp) ; addl $2, %esp"); 12 } 13 fldcw_precision(void)14void fldcw_precision ( void ) 15 { 16 asm(" pushw $0x007F ; fldcw (%esp) ; addl $2, %esp"); 17 } 18 fldcw_rounding(void)19void fldcw_rounding ( void ) 20 { 21 asm(" pushw $0x077F ; fldcw (%esp) ; addl $2, %esp"); 22 } 23 main(void)24int main ( void ) 25 { 26 printf("default\n"); 27 fldcw_default(); 28 printf("\n"); 29 30 printf("exns\n"); 31 fldcw_exns(); 32 printf("\n"); 33 34 printf("precision\n"); 35 fldcw_precision(); 36 printf("\n"); 37 38 printf("rounding\n"); 39 fldcw_rounding(); 40 printf("\n"); 41 42 return 0; 43 } 44