[fpc-devel] Internal symbols

Jonas Maebe jonas at freepascal.org
Sun Feb 3 18:57:10 CET 2019


On 03/02/19 17:12, J. Gareth Moreton wrote:
> Fair enough.  What about calling functions like Int via assembly 
> language, since it's currently impossible to do it either via the 
> internal function or using the public symbol that maps to it, since 
> "CALL int" just raises a linker error - I presume it's not as easy as 
> copying some code from procedure-calling node generation:
> 
> "Error: Undefined symbol: SYSTEM_::=::\_INT$DOUBLE::=::\DOUBLE"

It's not possible because Int is not a function, but an intrinsic. This 
intrinsic can map to a one of several functions in the system unit or 
may be translated to machine instructions depending on the type of its 
argument and the target platform (no function for it may even exist in 
the system unit for certain platforms).

The compiler should give a better error when trying to call intrinsics 
from assembler code though.


Jonas



More information about the fpc-devel mailing list