<p>Am 24.08.2017 08:32 schrieb "LacaK" <<a href="mailto:lacak@zoznam.sk">lacak@zoznam.sk</a>>:<br>
><br>
> Hi *,<br>
><br>
> I need store result of floating point calculation (in my example arctan()) in memory pointed by some variable. See this code:<br>
> var a: single; pa: PSingle;<br>
> asm<br>
> fild dy<br>
> fild dx<br>
> fpatan<br>
> fstp a<br>
> fwait<br>
> end;<br>
> pa^ := a;<br>
><br>
> It works, but is there any way how to store result directly to "pa^" in assembler ?<br>
> I have tried:<br>
> ...<br>
> fpatan<br>
> fstp pa^ ... fstp (pa) ... but this does not compile ... I need store to memory location pointed by pa "variable"<br>
> fwait<br>
> end;<br>
></p>
<p>You need to retrieve the value of pa into a register and then store at that address. Something like this:</p>
<p>=== code begin ===<br>
mov edx, pa<br>
fstp [pa]<br>
=== code end ===</p>
<p>Note 1: not tested<br>
Note 2: you might want to check which register you can use for that<br>
Note 3: I hope you keep the global and the assembler function in the same unit, because inter-unit access to globals changes when dynamic packages are enabled for a target</p>
<p>Regards,<br>
Sven</p>