Rainer Stratmann wrote on Thu, 09 Aug 2012:

Am Thursday 09 August 2012 15:33:52 schrieb Jonas Maebe:
> Thanks, the next problem then is: I wanted to do that in an inline
> procedure but if the compiler detects an asm statement then inline is
> disabled(!).

That's correct, it is not possible inline assembler statements in FPC.
You can try a macro instead:

{$macro on}
{$define IReallyKnowWhatIAmDoing:=asm .byte 0x1f, 0xef, 0x1a end}

begin
   IReallyKnowWhatIAmDoing;
Sounds good!
end.

Same thing: inlining disabled(!).

The idea is to use the macro instead of a function call, not to use the macro inside a function that you then try to inline. A macro is just text substitution, it will never have a different effect than typing its contents directly at the place where the macro is used.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to