blob: 43a0f1040a5514ba1762e62254889e30cd901265 [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-2019 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>
</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-125"></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-126"></a>Anything from a <dfn>line comment</dfn> character up to the next newline is
considered a comment and is ignored. The line comment character is target
specific, and some targets multiple comment characters. Some targets also have
line comment characters that only work if they are the first character on a
line. Some targets use a sequence of two characters to introduce a line
comment. Some targets can also change their line comment characters depending
upon command-line options that have been used. For more details see the
<em>Syntax</em> section in the documentation for individual targets.
<p>If the line comment character is the hash sign (&lsquo;<samp><span class="samp">#</span></samp>&rsquo;) then it still has the
special ability to enable and disable preprocessing (see <a href="Preprocessing.html#Preprocessing">Preprocessing</a>) and
to specify logical line numbers:
<p><a name="index-g_t_0023-127"></a><a name="index-lines-starting-with-_0040code_007b_0023_007d-128"></a><a name="index-logical-line-numbers-129"></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>