neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

95 lines
4.1 KiB
HTML

<html lang="en">
<head>
<title>CR16 Operand Qualifiers - 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="CR16_002dDependent.html#CR16_002dDependent" title="CR16-Dependent">
<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="CR16-Operand-Qualifiers"></a>Up:&nbsp;<a rel="up" accesskey="u" href="CR16_002dDependent.html#CR16_002dDependent">CR16-Dependent</a>
<hr><br>
</div>
<h4 class="subsection">9.6.1 CR16 Operand Qualifiers</h4>
<p><a name="index-CR16-Operand-Qualifiers-667"></a>
The National Semiconductor CR16 target of <code>as</code> has a few machine dependent operand qualifiers.
<p>Operand expression type qualifier is an optional field in the instruction operand, to determines the type of the expression field of an operand. The <code>@</code> is required. CR16 architecture uses one of the following expression qualifiers:
<dl>
<dt><code>s</code><dd>- <code>Specifies expression operand type as small</code>
<br><dt><code>m</code><dd>- <code>Specifies expression operand type as medium</code>
<br><dt><code>l</code><dd>- <code>Specifies expression operand type as large</code>
<br><dt><code>c</code><dd>- <code>Specifies the CR16 Assembler generates a relocation entry for the operand, where pc has implied bit, the expression is adjusted accordingly. The linker uses the relocation entry to update the operand address at link time.</code>
</dl>
<p>CR16 target operand qualifiers and its size (in bits):
<dl>
<dt><span class="samp">Immediate Operand</span><dd>- s &mdash;&ndash; 4 bits
<br><dt><dd>- m &mdash;&ndash; 16 bits, for movb and movw instructions.
<br><dt><dd>- m &mdash;&ndash; 20 bits, movd instructions.
<br><dt><dd>- l &mdash;&ndash; 32 bits
<br><dt><span class="samp">Absolute Operand</span><dd>- s &mdash;&ndash; Illegal specifier for this operand.
<br><dt><dd>- m &mdash;&ndash; 20 bits, movd instructions.
<br><dt><span class="samp">Displacement Operand</span><dd>- s &mdash;&ndash; 8 bits
<br><dt><dd>- m &mdash;&ndash; 16 bits
<br><dt><dd>- l &mdash;&ndash; 24 bits
</dl>
<p>For example:
<pre class="example"> 1 <code>movw $_myfun@c,r1</code>
This loads the address of _myfun, shifted right by 1, into r1.
2 <code>movd $_myfun@c,(r2,r1)</code>
This loads the address of _myfun, shifted right by 1, into register-pair r2-r1.
3 <code>_myfun_ptr:</code>
<code>.long _myfun@c</code>
<code>loadd _myfun_ptr, (r1,r0)</code>
<code>jal (r1,r0)</code>
This .long directive, the address of _myfunc, shifted right by 1 at link time.
</pre>
<!-- Copyright 2002, 2004 Free Software Foundation, Inc. -->
<!-- This is part of the GAS manual. -->
<!-- For copying conditions, see the file as.texinfo. -->
<!-- CRIS description contributed by Axis Communications. -->
</body></html>