This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ASM_COMMENT_START and gas divide operator


Alan Modra <alan@spri.levels.unisa.edu.au> writes:

|> On 7 May 1998, Andreas Schwab wrote:

|>> Jeffrey A Law <law@cygnus.com> writes:
|>> 
|>> |>   In message <Pine.LNX.3.96.980501124359.28262A-100000@mullet.Levels.UniSA.Edu.ou write:
|>> |>   > There is a problem with using "/" to start comments, such as those
|>> |>   > emitted by gcc's -fverbose-asm.  If gas needs to support "/" meaning
|>> |>   > the start of a comment anywhere on a line, then the gas division
|>> |>   > operator is killed, sometimes silently.  For instance:
|>> |>   >   asm("pushl $FOO/2")
|>> |>   > is treated as if the programmer wrote
|>> |>   >   asm("pushl $FOO")
|>> |>   > 
|>> |>   > Of course, this is only a problem with hand-coded assembly, but it
|>> |>   > would be nice to fix gas and gcc.  At least on linux, where the only
|>> |>   > assembler used with gcc is gas, we should be able to make the
|>> |>   > following change without causing too many problems.
|>> |>   > 
|>> |>   > 	* config/linux.h (ASM_COMMENT_START): Define as "#"
|>> |>   > 	* config/linux-aout.h (ASM_COMMENT_START): Likewise
|>> |> Thanks.  I've installed this into egcs.
|>> 
|>> This is wrong, it breaks m68k-linux, and perhaps all other non-intel linux
|>> port.  It must be moved to config/i386/linux.h.  There is no such thing as
|>> a universal comment character.

|> OK, you're right.  Just as well I said "without causing too many
|> problems" rather than "no problems" :-)  What about ASM_APP_ON and
|> ASM_APP_OFF defined on the next few lines down?  Do these really
|> belong in config/i386/linux.h too?

No, these are correct.  There are two types of comments, one that start on
column 1 and the other that do not.  ASM_APP_* are only written at the
start of the line, and here # is used as comment universally.  For inline
comments every port has different conventions.  For example, on m68k the #
is used to denote immediate operands, thus it cannot start a comment.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org