Re: result double
- From: "Avatar Zondertau" <avatarzt@xxxxxxxxx (please reply to newsgroup)>
- Date: 29 Oct 2005 11:14:22 -0700
> How can I read a double returning from a basm function ?
> Example:
>
> function display(x:double):double;
> begin
> asm
> ?????????????
> end;
> end;
>
> Form1.Button1Click(Sender:TObject);
> begin
> Label1.Caption:=FloatToStr(display(2.54));
> end;
First: don't add "begin" and "end" to your BASM function.
You read double parameters using their name, since they will always be
stored on the stack. You return a floating point value by leaving it on
the stack.
For example the function below doubles it's argument and returns that:
function TwoTimes(X: Double): Double;
asm
fld X
fadd st(0), st(0)
end;
--
The Fastcode Project: http://www.fastcodeproject.org/
.
- References:
- result double
- From: Marcello Lenci
- result double
- Prev by Date: Re: memorymanager/fastmm question/suggestion
- Next by Date: Re: memorymanager/fastmm question/suggestion
- Previous by thread: Re: result double
- Index(es):