114 lines
		
	
	
	
		
			4.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			114 lines
		
	
	
	
		
			4.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html lang="en">
 | 
						|
<head>
 | 
						|
<title>AVR-Modifiers - 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="AVR-Syntax.html#AVR-Syntax" title="AVR Syntax">
 | 
						|
<link rel="prev" href="AVR_002dRegs.html#AVR_002dRegs" title="AVR-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="AVR_002dModifiers"></a>Previous: <a rel="previous" accesskey="p" href="AVR_002dRegs.html#AVR_002dRegs">AVR-Regs</a>,
 | 
						|
Up: <a rel="up" accesskey="u" href="AVR-Syntax.html#AVR-Syntax">AVR Syntax</a>
 | 
						|
<hr><br>
 | 
						|
</div>
 | 
						|
 | 
						|
<h5 class="subsubsection">9.4.2.3 Relocatable Expression Modifiers</h5>
 | 
						|
 | 
						|
<p><a name="index-AVR-modifiers-654"></a><a name="index-syntax_002c-AVR-655"></a>
 | 
						|
The assembler supports several modifiers when using relocatable addresses
 | 
						|
in AVR instruction operands.  The general syntax is the following:
 | 
						|
 | 
						|
<pre class="smallexample">     modifier(relocatable-expression)
 | 
						|
</pre>
 | 
						|
     
 | 
						|
<a name="index-symbol-modifiers-656"></a>
 | 
						|
<dl>
 | 
						|
<dt><code>lo8</code><dd>
 | 
						|
This modifier allows you to use bits 0 through 7 of
 | 
						|
an address expression as 8 bit relocatable expression.
 | 
						|
 | 
						|
     <br><dt><code>hi8</code><dd>
 | 
						|
This modifier allows you to use bits 7 through 15 of an address expression
 | 
						|
as 8 bit relocatable expression.  This is useful with, for example, the
 | 
						|
AVR <span class="samp">ldi</span> instruction and <span class="samp">lo8</span> modifier.
 | 
						|
 | 
						|
     <p>For example
 | 
						|
 | 
						|
     <pre class="smallexample">          ldi r26, lo8(sym+10)
 | 
						|
          ldi r27, hi8(sym+10)
 | 
						|
     </pre>
 | 
						|
     <br><dt><code>hh8</code><dd>
 | 
						|
This modifier allows you to use bits 16 through 23 of
 | 
						|
an address expression as 8 bit relocatable expression. 
 | 
						|
Also, can be useful for loading 32 bit constants.
 | 
						|
 | 
						|
     <br><dt><code>hlo8</code><dd>
 | 
						|
Synonym of <span class="samp">hh8</span>.
 | 
						|
 | 
						|
     <br><dt><code>hhi8</code><dd>
 | 
						|
This modifier allows you to use bits 24 through 31 of
 | 
						|
an expression as 8 bit expression. This is useful with, for example, the
 | 
						|
AVR <span class="samp">ldi</span> instruction and <span class="samp">lo8</span>, <span class="samp">hi8</span>, <span class="samp">hlo8</span>,
 | 
						|
<span class="samp">hhi8</span>, modifier.
 | 
						|
 | 
						|
     <p>For example
 | 
						|
 | 
						|
     <pre class="smallexample">          ldi r26, lo8(285774925)
 | 
						|
          ldi r27, hi8(285774925)
 | 
						|
          ldi r28, hlo8(285774925)
 | 
						|
          ldi r29, hhi8(285774925)
 | 
						|
          ; r29,r28,r27,r26 = 285774925
 | 
						|
     </pre>
 | 
						|
     <br><dt><code>pm_lo8</code><dd>
 | 
						|
This modifier allows you to use bits 0 through 7 of
 | 
						|
an address expression as 8 bit relocatable expression. 
 | 
						|
This modifier useful for addressing data or code from
 | 
						|
Flash/Program memory. The using of <span class="samp">pm_lo8</span> similar
 | 
						|
to <span class="samp">lo8</span>.
 | 
						|
 | 
						|
     <br><dt><code>pm_hi8</code><dd>
 | 
						|
This modifier allows you to use bits 8 through 15 of
 | 
						|
an address expression as 8 bit relocatable expression. 
 | 
						|
This modifier useful for addressing data or code from
 | 
						|
Flash/Program memory.
 | 
						|
 | 
						|
     <br><dt><code>pm_hh8</code><dd>
 | 
						|
This modifier allows you to use bits 15 through 23 of
 | 
						|
an address expression as 8 bit relocatable expression. 
 | 
						|
This modifier useful for addressing data or code from
 | 
						|
Flash/Program memory.
 | 
						|
 | 
						|
   </dl>
 | 
						|
 | 
						|
   </body></html>
 | 
						|
 |