I have two questions:
How do I use CPP (C Preprocessor) with GNU's AS
How do I use "continuation lines" (like some line \ next line
)?
For the first, I know you can use .include
instead of #include
, but #define
doesn't work (and I don't know the equivalent). File extension .S
is supposed to force it to use the preprocessor, same with g++ -x assembler-with-cpp
.
As indicated by @Ciro Santilli, GNU AS does not perform CPP-like preprocessing. For this you need to assemble your file with gcc
, like gcc in.S
. Doing so enables both the CPP preprocessor and the continuation line symbol.
Otherwise, the AS directive that is roughly equivalent to #define
for GNU AS stand-alone is .set
(to define new symbols, see AS manual).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With