Am 24.08.2017 08:32 schrieb "LacaK" <la...@zoznam.sk>: > > Hi *, > > I need store result of floating point calculation (in my example arctan()) in memory pointed by some variable. See this code: > var a: single; pa: PSingle; > asm > fild dy > fild dx > fpatan > fstp a > fwait > end; > pa^ := a; > > It works, but is there any way how to store result directly to "pa^" in assembler ? > I have tried: > ... > fpatan > fstp pa^ ... fstp (pa) ... but this does not compile ... I need store to memory location pointed by pa "variable" > fwait > end; >
You need to retrieve the value of pa into a register and then store at that address. Something like this: === code begin === mov edx, pa fstp [pa] === code end === Note 1: not tested Note 2: you might want to check which register you can use for that 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 Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal