You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CR16-Operand-Qualifiers.html 6.8KB

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