blob: 8b3c4b5fd6bb90a7001c01dea918b31312d9a87b [file] [log] [blame]
<html lang="en">
<head>
<title>Comments - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Syntax.html#Syntax" title="Syntax">
<link rel="prev" href="Whitespace.html#Whitespace" title="Whitespace">
<link rel="next" href="Symbol-Intro.html#Symbol-Intro" title="Symbol Intro">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Comments"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Symbol-Intro.html#Symbol-Intro">Symbol Intro</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Whitespace.html#Whitespace">Whitespace</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Syntax.html#Syntax">Syntax</a>
<hr>
</div>
<h3 class="section">3.3 Comments</h3>
<p><a name="index-comments-123"></a>There are two ways of rendering comments to <samp><span class="command">as</span></samp>. In both
cases the comment is equivalent to one space.
<p>Anything from &lsquo;<samp><span class="samp">/*</span></samp>&rsquo; through the next &lsquo;<samp><span class="samp">*/</span></samp>&rsquo; is a comment.
This means you may not nest these comments.
<pre class="smallexample"> /*
The only way to include a newline ('\n') in a comment
is to use this sort of comment.
*/
/* This sort of comment does not nest. */
</pre>
<p><a name="index-line-comment-character-124"></a>Anything from the <dfn>line comment</dfn> character to the next newline
is considered a comment and is ignored. The line comment character is
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; on the ARC;
&lsquo;<samp><span class="samp">@</span></samp>&rsquo; on the ARM;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; for the H8/300 family;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; for the HPPA;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the i386 and x86-64;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the i960;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; for the PDP-11;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; for picoJava;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; for Motorola PowerPC;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; for IBM S/390;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; for the Sunplus SCORE;
&lsquo;<samp><span class="samp">!</span></samp>&rsquo; for the Renesas / SuperH SH;
&lsquo;<samp><span class="samp">!</span></samp>&rsquo; on the SPARC;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the ip2k;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the m32c;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the m32r;
&lsquo;<samp><span class="samp">|</span></samp>&rsquo; on the 680x0;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the 68HC11 and 68HC12;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the RX;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; on the TMS320C6X;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the Vax;
&lsquo;<samp><span class="samp">;</span></samp>&rsquo; for the Z80;
&lsquo;<samp><span class="samp">!</span></samp>&rsquo; for the Z8000;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; on the V850;
&lsquo;<samp><span class="samp">#</span></samp>&rsquo; for Xtensa systems;
see <a href="Machine-Dependencies.html#Machine-Dependencies">Machine Dependencies</a>.
<!-- FIXME What about i860? -->
<p>On some machines there are two different line comment characters. One
character only begins a comment if it is the first non-whitespace character on
a line, while the other always begins a comment.
<p>The V850 assembler also supports a double dash as starting a comment that
extends to the end of the line.
<p>&lsquo;<samp><span class="samp">--</span></samp>&rsquo;;
<p><a name="index-g_t_0023-125"></a><a name="index-lines-starting-with-_0040code_007b_0023_007d-126"></a><a name="index-logical-line-numbers-127"></a>To be compatible with past assemblers, lines that begin with &lsquo;<samp><span class="samp">#</span></samp>&rsquo; have a
special interpretation. Following the &lsquo;<samp><span class="samp">#</span></samp>&rsquo; should be an absolute
expression (see <a href="Expressions.html#Expressions">Expressions</a>): the logical line number of the <em>next</em>
line. Then a string (see <a href="Strings.html#Strings">Strings</a>) is allowed: if present it is a
new logical file name. The rest of the line, if any, should be whitespace.
<p>If the first non-whitespace characters on the line are not numeric,
the line is ignored. (Just like a comment.)
<pre class="smallexample"> # This is an ordinary comment.
# 42-6 "new_file_name" # New logical file name
# This is logical line # 36.
</pre>
<p>This feature is deprecated, and may disappear from future versions
of <samp><span class="command">as</span></samp>.
</body></html>