Forum > FPC development

Limited relocation support in inline assembler

<< < (2/2)

Jonas Maebe:
There are several answers to this:
a) the x86-64 intel assembler reader is barely used/tested, see e.g. http://bugs.freepascal.org/view.php?id=26613
b) you should never use absolute addressing on x86-64, but use relative (RIP-based) addressing instead. While in theory it's supported, in practice it's strongly discouraged for various reasons (and I doubt there is any support for it in FPC, because unless you are writing OS kernels or so you shouldn't ever use it).

I would strongly recommend to try to find a tutorial on writing x86-64 assembly somewhere, or at least study the code generated by the compiler. You cannot just apply your assumptions from 32 bit x86.

MathMan:

--- Quote from: Jonas Maebe on September 25, 2014, 11:13:28 pm ---...
b) you should never use absolute addressing on x86-64, but use relative (RIP-based) addressing instead. While in theory it's supported, in practice it's strongly discouraged for various reasons (and I doubt there is any support for it in FPC, because unless you are writing OS kernels or so you shouldn't ever use it).
...

--- End quote ---

Ok, if it is bad programming practice and will potentially bring me into conflict with the FPC environment I'll let it rest and see if there are other, better behaved possibilities.

Navigation

[0] Message Index

[*] Previous page

Go to full version