[fpc-pascal] Inline bytes

Rainer Stratmann RainerStratmann at t-online.de
Thu Aug 9 15:44:00 CEST 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(!).

> You will have to declare the macro in a common include file or in
> every main source file if you want to use it in more than one
> compilation module though.
>
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list