How to access C preprocessor constants in assembly?
问题 If I define a constant in my C .h file: #define constant 1 How do I access it in my assembly .s file? 回答1: If you use the GNU toolchain, gcc will by default run the preprocessor on files with the .S extension (uppercase 'S'). So you can use all cpp features in your assembly file. There are some caveats: there might be differences in the way the assembler and the preprocessor tokenize the input. If you #include header files, they should only contain preprocessor directives, not C stuff like