GNU assembler preprocessor defines

I have two questions:

  • How to use CPP (C-preprocessor) with GNU AS

  • How to use continuation lines (e.g. some line \ next line)?

Firstly, I know that you can use .includeinstead #include, but it #definedoes not work (and I do not know the equivalent). A file extension .Sshould force it to use a preprocessor, the same with g++ -x assembler-with-cpp.

+4
source share
1 answer

As pointed out by @Ciro Santilli, GNU AS does not perform CPP-like preprocessing. To do this, you need to compile a file gcc, for example gcc in.S. This allows you to use both the CPP preprocessor and the continuation line symbol.

AS, #define GNU AS, .set ( , . AS manual).

+4

Source: https://habr.com/ru/post/1613280/


All Articles