1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- This file documents the GNU Assembler "as". 4 5Copyright (C) 1991-2021 Free Software Foundation, Inc. 6 7Permission is granted to copy, distribute and/or modify this document 8under the terms of the GNU Free Documentation License, Version 1.3 9or any later version published by the Free Software Foundation; 10with no Invariant Sections, with no Front-Cover Texts, and with no 11Back-Cover Texts. A copy of the license is included in the 12section entitled "GNU Free Documentation License". 13 --> 14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 15<head> 16<title>Using as: CR16 Operand Qualifiers</title> 17 18<meta name="description" content="Using as: CR16 Operand Qualifiers"> 19<meta name="keywords" content="Using as: CR16 Operand Qualifiers"> 20<meta name="resource-type" content="document"> 21<meta name="distribution" content="global"> 22<meta name="Generator" content="makeinfo"> 23<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 24<link href="index.html#Top" rel="start" title="Top"> 25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index"> 26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 27<link href="CR16_002dDependent.html#CR16_002dDependent" rel="up" title="CR16-Dependent"> 28<link href="CR16-Syntax.html#CR16-Syntax" rel="next" title="CR16 Syntax"> 29<link href="CR16_002dDependent.html#CR16_002dDependent" rel="previous" title="CR16-Dependent"> 30<style type="text/css"> 31<!-- 32a.summary-letter {text-decoration: none} 33blockquote.smallquotation {font-size: smaller} 34div.display {margin-left: 3.2em} 35div.example {margin-left: 3.2em} 36div.indentedblock {margin-left: 3.2em} 37div.lisp {margin-left: 3.2em} 38div.smalldisplay {margin-left: 3.2em} 39div.smallexample {margin-left: 3.2em} 40div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 41div.smalllisp {margin-left: 3.2em} 42kbd {font-style:oblique} 43pre.display {font-family: inherit} 44pre.format {font-family: inherit} 45pre.menu-comment {font-family: serif} 46pre.menu-preformatted {font-family: serif} 47pre.smalldisplay {font-family: inherit; font-size: smaller} 48pre.smallexample {font-size: smaller} 49pre.smallformat {font-family: inherit; font-size: smaller} 50pre.smalllisp {font-size: smaller} 51span.nocodebreak {white-space:nowrap} 52span.nolinebreak {white-space:nowrap} 53span.roman {font-family:serif; font-weight:normal} 54span.sansserif {font-family:sans-serif; font-weight:normal} 55ul.no-bullet {list-style: none} 56--> 57</style> 58 59 60</head> 61 62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 63<a name="CR16-Operand-Qualifiers"></a> 64<div class="header"> 65<p> 66Next: <a href="CR16-Syntax.html#CR16-Syntax" accesskey="n" rel="next">CR16 Syntax</a>, Up: <a href="CR16_002dDependent.html#CR16_002dDependent" accesskey="u" rel="up">CR16-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 67</div> 68<hr> 69<a name="CR16-Operand-Qualifiers-1"></a> 70<h4 class="subsection">9.8.1 CR16 Operand Qualifiers</h4> 71<a name="index-CR16-Operand-Qualifiers"></a> 72 73<p>The National Semiconductor CR16 target of <code>as</code> has a few machine dependent operand qualifiers. 74</p> 75<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: 76</p> 77<dl compact="compact"> 78<dt><code>s</code></dt> 79<dd><p>- <code>Specifies expression operand type as small</code> 80</p></dd> 81<dt><code>m</code></dt> 82<dd><p>- <code>Specifies expression operand type as medium</code> 83</p></dd> 84<dt><code>l</code></dt> 85<dd><p>- <code>Specifies expression operand type as large</code> 86</p></dd> 87<dt><code>c</code></dt> 88<dd><p>- <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> 89</p></dd> 90<dt><code>got/GOT</code></dt> 91<dd><p>- <code>Specifies the CR16 Assembler generates a relocation entry for the operand, offset from Global Offset Table. The linker uses this relocation entry to update the operand address at link time</code> 92</p></dd> 93<dt><code>cgot/cGOT</code></dt> 94<dd><p>- <code>Specifies the CompactRISC 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> 95</p></dd> 96</dl> 97 98<p>CR16 target operand qualifiers and its size (in bits): 99</p> 100<dl compact="compact"> 101<dt>‘<samp>Immediate Operand: s</samp>’</dt> 102<dd><p>4 bits. 103</p> 104</dd> 105<dt>‘<samp>Immediate Operand: m</samp>’</dt> 106<dd><p>16 bits, for movb and movw instructions. 107</p> 108</dd> 109<dt>‘<samp>Immediate Operand: m</samp>’</dt> 110<dd><p>20 bits, movd instructions. 111</p> 112</dd> 113<dt>‘<samp>Immediate Operand: l</samp>’</dt> 114<dd><p>32 bits. 115</p> 116</dd> 117<dt>‘<samp>Absolute Operand: s</samp>’</dt> 118<dd><p>Illegal specifier for this operand. 119</p> 120</dd> 121<dt>‘<samp>Absolute Operand: m</samp>’</dt> 122<dd><p>20 bits, movd instructions. 123</p> 124</dd> 125<dt>‘<samp>Displacement Operand: s</samp>’</dt> 126<dd><p>8 bits. 127</p> 128</dd> 129<dt>‘<samp>Displacement Operand: m</samp>’</dt> 130<dd><p>16 bits. 131</p> 132</dd> 133<dt>‘<samp>Displacement Operand: l</samp>’</dt> 134<dd><p>24 bits. 135</p> 136</dd> 137</dl> 138 139<p>For example: 140</p><div class="example"> 141<pre class="example">1 <code>movw $_myfun@c,r1</code> 142 143 This loads the address of _myfun, shifted right by 1, into r1. 144 1452 <code>movd $_myfun@c,(r2,r1)</code> 146 147 This loads the address of _myfun, shifted right by 1, into register-pair r2-r1. 148 1493 <code>_myfun_ptr:</code> 150 <code>.long _myfun@c</code> 151 <code>loadd _myfun_ptr, (r1,r0)</code> 152 <code>jal (r1,r0)</code> 153 154 This .long directive, the address of _myfunc, shifted right by 1 at link time. 155 1564 <code>loadd _data1@GOT(r12), (r1,r0)</code> 157 158 This loads the address of _data1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r2-r1. 159 1605 <code>loadd _myfunc@cGOT(r12), (r1,r0)</code> 161 162 This loads the address of _myfun, shifted right by 1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r1-r0. 163</pre></div> 164 165<hr> 166<div class="header"> 167<p> 168Next: <a href="CR16-Syntax.html#CR16-Syntax" accesskey="n" rel="next">CR16 Syntax</a>, Up: <a href="CR16_002dDependent.html#CR16_002dDependent" accesskey="u" rel="up">CR16-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 169</div> 170 171 172 173</body> 174</html> 175