The MASM Forum

General => The Campus => Topic started by: Lonewolff on March 18, 2016, 09:56:41 PM

Title: Return values
Post by: Lonewolff on March 18, 2016, 09:56:41 PM
Hi Guys,

I am having trouble trying to figure out how to make a 'double' return value type.

I have found some information that you need to use movsd and fld before the ret statement. But, I am having troubles actually implementing it.

Any advice would be awesome :)
Title: Re: Return values
Post by: jj2007 on March 19, 2016, 01:30:12 AM
double is REAL8 in Masm syntax
returning a double works differently, see your C manual, or assemble this, launch Olly and press F8 until you see the result to the right

include \masm32\include\masm32rt.inc

.code
start:
  invoke crt_atof, chr$("123.456")
  exit

end start