www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/22/12:45:09

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: djgpp, nasm and floats
Newsgroups: comp.os.msdos.djgpp
References: <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20020422131623 DOT 00bd4110 AT mail DOT ciudad DOT com DOT ar>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha))
Message-ID: <1019493463.722131@queeg.ludd.luth.se>
Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
Date: 22 Apr 2002 16:37:43 GMT
Lines: 30
NNTP-Posting-Date: 22 Apr 2002 16:37:43 GMT
NNTP-Posting-Host: queeg.ludd.luth.se
X-Trace: 1019493463 news.luth.se 286 130.240.16.109
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

R. Grela <rgrela AT ciudad DOT com DOT ar> wrote:
: I'm trying to do some calculations in assembly and return the results to 
: djgpp application..
: I've no trouble returning integers (32 bits) in eax, but with floating I 
: get -NaN (not a number)

: global _atest

: section .data
:     p dd 0.2

: section .text
: _atest:
:      mov eax, [p]
:      ret

: and receiving as float (I've tryed with double too)
: extern "C" float atest();
: void main() { float f = atest();  cout << f << endl; }

: and I get -NaN

: Any idea?

Yes. Floating point values are not returned in EAX I guess.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019