The following inline assemble code is not working on my system. What is the problem with that code?
If I use asm
instead of __asm__
then it works properly.
#include <stdio.h>
int main() {
float arg1, arg2, div ;
printf( "Enter two numbers : " );
scanf( "%f%f", &arg1, &arg2 );
/* Perform floating Division */
__asm__ ( "fld %2;"
"fld %1;"
"fdiv;"
"fstp %0;" : "=g" (div) : "g" (arg1), "g" (arg2) ) ;
printf( "%f / %f = %f\n", arg1, arg2, div );
return 0 ;
}