How to make the GNU Assembler use a slash / for comments?

mghis picture mghis · Mar 27, 2013 · Viewed 12.9k times · Source

This is indeed a stupid idiosyncrasy of mine, but I can't stand the way GNU AS uses to insert a comment. I am too accustomed to the Sun way (the same used in most UNIX assemblers), that uses a simple slash "/" to comment out the code till the end of the line.

Do you know of a way to accomplish my little whim?

Answer

Uwe Geuder picture Uwe Geuder · Jun 18, 2013

In Gnu assembler the comment start character is target specific. For i386 and x86_64 it is #. For ARMv7 it is @.

Some other comment conventions work under some conditions. I'm not sure about the details. // comment starter and /* */ multi line comments are examples I have seen.