Discussion:
Line comments for PPC assembly
Igor Ageyev
2003-09-05 18:05:09 UTC
Permalink
Hi,

I am trying to assemble some code for PPC750. The assembly contains comments
that start with ';'. I thought that for PPC, ';' is a valid start-of-comment
character, but assembler fails:

-> as -mppc -o test.o test.s -v
GNU assembler version 2.14 (powerpc-ibm-aix5.1.0.0) using BFD version 2.14
20030612
test.s: Assembler messages:
test.s:1: Error: Unrecognized opcode: `this'
test.s:2: Warning: rest of line ignored; first ignored character is `-'
test.s:3: Error: Unrecognized opcode: `first'
test.s:4: Error: Unrecognized opcode: `second'
test.s:5: Error: Unrecognized opcode: `third'

This is the sample code I tried to assemble:

;; This is a test file
;;--------------------------
lis r9, 0xFFF0 ; First line
addi r9, r9, 0x0010 ; Second line
stwbrx r6, 0, r9 ; Third line

If I change comments to C-style comments, with '/*' '*/', it works.

Are the ';' comments not supported anymore?

Thank you,

Igor Ageyev
Alan Modra
2003-09-06 05:36:54 UTC
Permalink
Post by Igor Ageyev
I thought that for PPC, ';' is a valid start-of-comment
No, a semicolon is a command separator. Used for example, like this:

.pushsection abc; .long 123; .popsection
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Igor Ageyev
2003-09-06 20:36:41 UTC
Permalink
I guess I misread the gas docs then, because in the "Comments" section it
says that semicolon is the line comment character for PowerPC. What is the
correct line comment character for PPC, '#'?

Thank you,
Igor Ageyev

----- Original Message -----
From: "Alan Modra" <***@bigpond.net.au>
To: "Igor Ageyev" <***@icrow.digipark.com>
Cc: <***@sources.redhat.com>
Sent: Friday, September 05, 2003 10:36 PM
Subject: Re: Line comments for PPC assembly
Post by Alan Modra
Post by Igor Ageyev
I thought that for PPC, ';' is a valid start-of-comment
.pushsection abc; .long 123; .popsection
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Ian Lance Taylor
2003-09-07 04:06:42 UTC
Permalink
Post by Igor Ageyev
I guess I misread the gas docs then, because in the "Comments" section it
says that semicolon is the line comment character for PowerPC. What is the
correct line comment character for PPC, '#'?
You didn't misread the documentation. It is simply wrong.

Yes, '#' is the comment character for the PowerPC assembler.

Ian
Nick Clifton
2003-09-07 12:29:31 UTC
Permalink
Hi Guys,
Post by Ian Lance Taylor
Post by Igor Ageyev
I guess I misread the gas docs then, because in the "Comments" section it
says that semicolon is the line comment character for PowerPC. What is the
correct line comment character for PPC, '#'?
You didn't misread the documentation. It is simply wrong.
Yes, '#' is the comment character for the PowerPC assembler.
I have checked in this patch to update the documentation.

Cheers
Nick

2003-09-07 Nick Clifton <***@redhat.com>

* doc/as.texinfo (Comments): Comment character for PPC is #.

Index: gas/doc/as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.89
diff -c -3 -p -r1.89 as.texinfo
*** gas/doc/as.texinfo 29 Aug 2003 20:32:56 -0000 1.89
--- gas/doc/as.texinfo 7 Sep 2003 12:21:17 -0000
*************** is considered a comment and is ignored.
*** 2090,2096 ****
@samp{;} for picoJava;
@end ifset
@ifset PPC
! @samp{;} for Motorola PowerPC;
@end ifset
@ifset SH
@samp{!} for the Renesas / SuperH SH;
--- 2090,2096 ----
@samp{;} for picoJava;
@end ifset
@ifset PPC
! @samp{#} for Motorola PowerPC;
@end ifset
@ifset SH
@samp{!} for the Renesas / SuperH SH;

Continue reading on narkive:
Loading...