#include typedef double (*PFDouble0)(); static unsigned char code[1024]; int main() { double ret; PFDouble0 pfPI; int inst=0; pfPI = (PFDouble0)code; code[inst++] = 0x55; // push bp code[inst++] = 0x89; // mov bp, sp code[inst++] = 0xe5; // code[inst++] = 0xd9; // fldpi code[inst++] = 0xeb; // code[inst++] = 0x5d; // pop bp code[inst++] = 0xcb; // retf ret = pfPI(); printf( "PI=%g\n", ret ); return 0; }