Software Engineering
architecture history assembly gnu
Updated Sun, 25 Sep 2022 16:17:01 GMT

Why does GNU AS use different characters for single-line comments depending on the architecture?


The GNU Assembler as uses different characters depending on the architecture to specify single-line comments, such as # on x86, ; on 29k, or @ on ARM. Moreover, regardless of platform, C-style comments are also supported (/* */).

Is there a technical reason for different comment styles on different architecture? The multi-line comment suggest no, as it works on any platform - however if there is no technical limitation on the characters that can be used for comments, why design the assembler to require different comment styles on different platforms (for single-line comments)?




Solution

The default assembler syntax of different platforms simply used different ways of commenting and to make existing code compile without extra modifications, the typical syntax has been adopted by GNU AS, too. Keep in mind that there is no standardization among assembler languages.