89 lines
		
	
	
	
		
			4.6 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
	
		
			4.6 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html lang="en">
 | 
						|
<head>
 | 
						|
<title>Statements - Using as</title>
 | 
						|
<meta http-equiv="Content-Type" content="text/html">
 | 
						|
<meta name="description" content="Using as">
 | 
						|
<meta name="generator" content="makeinfo 4.7">
 | 
						|
<link title="Top" rel="start" href="index.html#Top">
 | 
						|
<link rel="up" href="Syntax.html#Syntax" title="Syntax">
 | 
						|
<link rel="prev" href="Symbol-Intro.html#Symbol-Intro" title="Symbol Intro">
 | 
						|
<link rel="next" href="Constants.html#Constants" title="Constants">
 | 
						|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
 | 
						|
<!--
 | 
						|
This file documents the GNU Assembler "as".
 | 
						|
 | 
						|
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
 | 
						|
2006, 2007 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.1
 | 
						|
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''.
 | 
						|
 | 
						|
man end-->
 | 
						|
<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; } 
 | 
						|
--></style>
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
<div class="node">
 | 
						|
<p>
 | 
						|
<a name="Statements"></a>Next: <a rel="next" accesskey="n" href="Constants.html#Constants">Constants</a>,
 | 
						|
Previous: <a rel="previous" accesskey="p" href="Symbol-Intro.html#Symbol-Intro">Symbol Intro</a>,
 | 
						|
Up: <a rel="up" accesskey="u" href="Syntax.html#Syntax">Syntax</a>
 | 
						|
<hr><br>
 | 
						|
</div>
 | 
						|
 | 
						|
<h3 class="section">3.5 Statements</h3>
 | 
						|
 | 
						|
<p><a name="index-statements_002c-structure-of-130"></a><a name="index-line-separator-character-131"></a><a name="index-statement-separator-character-132"></a>A <dfn>statement</dfn> ends at a newline character (<span class="samp">\n</span>) or line
 | 
						|
separator character.  (The line separator is usually <span class="samp">;</span>, unless this
 | 
						|
conflicts with the comment character; see <a href="Machine-Dependencies.html#Machine-Dependencies">Machine Dependencies</a>.)  The
 | 
						|
newline or separator character is considered part of the preceding
 | 
						|
statement.  Newlines and separators within character constants are an
 | 
						|
exception: they do not end statements.
 | 
						|
 | 
						|
   <p><a name="index-newline_002c-required-at-file-end-133"></a><a name="index-EOF_002c-newline-must-precede-134"></a>It is an error to end any statement with end-of-file:  the last
 | 
						|
character of any input file should be a newline.
 | 
						|
 | 
						|
   <p>An empty statement is allowed, and may include whitespace.  It is ignored.
 | 
						|
 | 
						|
   <p><a name="index-instructions-and-directives-135"></a><a name="index-directives-and-instructions-136"></a><!-- "key symbol" is not used elsewhere in the document; seems pedantic to -->
 | 
						|
<!-- @defn{} it in that case, as was done previously...  doc@cygnus.com, -->
 | 
						|
<!-- 13feb91. -->
 | 
						|
A statement begins with zero or more labels, optionally followed by a
 | 
						|
key symbol which determines what kind of statement it is.  The key
 | 
						|
symbol determines the syntax of the rest of the statement.  If the
 | 
						|
symbol begins with a dot <span class="samp">.</span> then the statement is an assembler
 | 
						|
directive: typically valid for any computer.  If the symbol begins with
 | 
						|
a letter the statement is an assembly language <dfn>instruction</dfn>: it
 | 
						|
assembles into a machine language instruction. 
 | 
						|
Different versions of <span class="command">as</span> for different computers
 | 
						|
recognize different instructions.  In fact, the same symbol may
 | 
						|
represent a different instruction in a different computer's assembly
 | 
						|
language.
 | 
						|
 | 
						|
   <p><a name="index-_0040code_007b_003a_007d-_0028label_0029-137"></a><a name="index-label-_0028_0040code_007b_003a_007d_0029-138"></a>A label is a symbol immediately followed by a colon (<code>:</code>). 
 | 
						|
Whitespace before a label or after a colon is permitted, but you may not
 | 
						|
have whitespace between a label's symbol and its colon. See <a href="Labels.html#Labels">Labels</a>.
 | 
						|
 | 
						|
   <p>For HPPA targets, labels need not be immediately followed by a colon, but
 | 
						|
the definition of a label must begin in column zero.  This also implies that
 | 
						|
only one label may be defined on each line.
 | 
						|
 | 
						|
<pre class="smallexample">     label:     .directive    followed by something
 | 
						|
     another_label:           # This is an empty statement.
 | 
						|
                instruction   operand_1, operand_2, ...
 | 
						|
</pre>
 | 
						|
   </body></html>
 | 
						|
 |