89 lines
		
	
	
	
		
			4.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
	
		
			4.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html lang="en">
 | 
						|
<head>
 | 
						|
<title>MMIX-Symbols - 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="MMIX_002dSyntax.html#MMIX_002dSyntax" title="MMIX-Syntax">
 | 
						|
<link rel="prev" href="MMIX_002dChars.html#MMIX_002dChars" title="MMIX-Chars">
 | 
						|
<link rel="next" href="MMIX_002dRegs.html#MMIX_002dRegs" title="MMIX-Regs">
 | 
						|
<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="MMIX_002dSymbols"></a>Next: <a rel="next" accesskey="n" href="MMIX_002dRegs.html#MMIX_002dRegs">MMIX-Regs</a>,
 | 
						|
Previous: <a rel="previous" accesskey="p" href="MMIX_002dChars.html#MMIX_002dChars">MMIX-Chars</a>,
 | 
						|
Up: <a rel="up" accesskey="u" href="MMIX_002dSyntax.html#MMIX_002dSyntax">MMIX-Syntax</a>
 | 
						|
<hr><br>
 | 
						|
</div>
 | 
						|
 | 
						|
<h5 class="subsubsection">9.23.3.2 Symbols</h5>
 | 
						|
 | 
						|
<p>The character <span class="samp">:</span> is permitted in identifiers.  There are two
 | 
						|
exceptions to it being treated as any other symbol character: if a symbol
 | 
						|
begins with <span class="samp">:</span>, it means that the symbol is in the global namespace
 | 
						|
and that the current prefix should not be prepended to that symbol
 | 
						|
(see <a href="MMIX_002dprefix.html#MMIX_002dprefix">MMIX-prefix</a>).  The <span class="samp">:</span> is then not considered part of the
 | 
						|
symbol.  For a symbol in the label position (first on a line), a <span class="samp">:</span>
 | 
						|
at the end of a symbol is silently stripped off.  A label is permitted,
 | 
						|
but not required, to be followed by a <span class="samp">:</span>, as with many other
 | 
						|
assembly formats.
 | 
						|
 | 
						|
   <p>The character <span class="samp">@</span> in an expression, is a synonym for <span class="samp">.</span>, the
 | 
						|
current location.
 | 
						|
 | 
						|
   <p>In addition to the common forward and backward local symbol formats
 | 
						|
(see <a href="Symbol-Names.html#Symbol-Names">Symbol Names</a>), they can be specified with upper-case <span class="samp">B</span> and
 | 
						|
<span class="samp">F</span>, as in <span class="samp">8B</span> and <span class="samp">9F</span>.  A local label defined for the
 | 
						|
current position is written with a <span class="samp">H</span> appended to the number:
 | 
						|
<pre class="smallexample">     3H LDB $0,$1,2
 | 
						|
</pre>
 | 
						|
   <p>This and traditional local-label formats cannot be mixed: a label must be
 | 
						|
defined and referred to using the same format.
 | 
						|
 | 
						|
   <p>There's a minor caveat: just as for the ordinary local symbols, the local
 | 
						|
symbols are translated into ordinary symbols using control characters are
 | 
						|
to hide the ordinal number of the symbol.  Unfortunately, these symbols
 | 
						|
are not translated back in error messages.  Thus you may see confusing
 | 
						|
error messages when local symbols are used.  Control characters
 | 
						|
<span class="samp">\003</span> (control-C) and <span class="samp">\004</span> (control-D) are used for the
 | 
						|
MMIX-specific local-symbol syntax.
 | 
						|
 | 
						|
   <p>The symbol <span class="samp">Main</span> is handled specially; it is always global.
 | 
						|
 | 
						|
   <p>By defining the symbols <span class="samp">__.MMIX.start..text</span> and
 | 
						|
<span class="samp">__.MMIX.start..data</span>, the address of respectively the <span class="samp">.text</span>
 | 
						|
and <span class="samp">.data</span> segments of the final program can be defined, though when
 | 
						|
linking more than one object file, the code or data in the object file
 | 
						|
containing the symbol is not guaranteed to be start at that position; just
 | 
						|
the final executable.  See <a href="MMIX_002dloc.html#MMIX_002dloc">MMIX-loc</a>.
 | 
						|
 | 
						|
   </body></html>
 | 
						|
 |