944,098 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 3762
  • Assembly RSS
Apr 20th, 2005
0

FPU + external C file - how to return double

Expand Post »
Hi

I'm working on a piece of assembly procedure that would enable me to return a double value (generated in asm module) to C code.

Up to now never produced such a code, so would be grateful if you could assist me a bit. I know that I should leave the value in st(0)

currently wrote a piece of C :

#include <stdio.h>

extern double test(void) ;

void main ( void )
{
double p ;
p = test () ;
printf ( "The num is %f \n", p ) ;
}

When I write and leave purre integer there's no problem. But how to leave 64bit value in ST ?

I start with

finit
fld... and here comes the problem

thanks for any assistance
Stebel.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
stebel is offline Offline
1 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: I need help
Next Thread in Assembly Forum Timeline: MIPS - I'm Not getting the right answer :( Can anybody Review :)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC