[fpc-pascal] Inline bytes

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Aug 9 15:14:29 CEST 2012


Rainer Stratmann wrote on Thu, 09 Aug 2012:

> How is it possible to put some inline bytes in the code like the former
> inline( $1f , $ef , $1A );
> instruction?

{$asmmode att}
asm
   .byte $0x1f, $0xef, $0x1a
end;

{$asmmode intel}
asm
   db $1a, $ef, $1a
end;

If this is supposed to be the only code/data inside an assembler  
routine, make sure to also add "assembler; nostackframe;" to that  
routine's modifiers to prevent the compiler from setting up a stack  
frame and/or insert stack alignment code.


Jonas



More information about the fpc-pascal mailing list