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.

255 lines
11KB

  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>Blackfin Syntax (Using as)</title>
  16. <meta name="description" content="Blackfin Syntax (Using as)">
  17. <meta name="keywords" content="Blackfin Syntax (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="Blackfin_002dDependent.html#Blackfin_002dDependent" rel="up" title="Blackfin-Dependent">
  25. <link href="Blackfin-Directives.html#Blackfin-Directives" rel="next" title="Blackfin Directives">
  26. <link href="Blackfin-Options.html#Blackfin-Options" rel="prev" title="Blackfin Options">
  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="Blackfin-Syntax"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="Blackfin-Directives.html#Blackfin-Directives" accesskey="n" rel="next">Blackfin Directives</a>, Previous: <a href="Blackfin-Options.html#Blackfin-Options" accesskey="p" rel="prev">Blackfin Options</a>, Up: <a href="Blackfin_002dDependent.html#Blackfin_002dDependent" accesskey="u" rel="up">Blackfin-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="Syntax-7"></a>
  63. <h4 class="subsection">9.6.2 Syntax</h4>
  64. <a name="index-Blackfin-syntax"></a>
  65. <a name="index-syntax_002c-Blackfin"></a>
  66. <dl compact="compact">
  67. <dt><code>Special Characters</code></dt>
  68. <dd><p>Assembler input is free format and may appear anywhere on the line.
  69. One instruction may extend across multiple lines or more than one
  70. instruction may appear on the same line. White space (space, tab,
  71. comments or newline) may appear anywhere between tokens. A token must
  72. not have embedded spaces. Tokens include numbers, register names,
  73. keywords, user identifiers, and also some multicharacter special
  74. symbols like &quot;+=&quot;, &quot;/*&quot; or &quot;||&quot;.
  75. </p>
  76. <p>Comments are introduced by the &lsquo;<samp>#</samp>&rsquo; character and extend to the
  77. end of the current line. If the &lsquo;<samp>#</samp>&rsquo; appears as the first
  78. character of a line, the whole line is treated as a comment, but in
  79. this case the line can also be a logical line number directive
  80. (see <a href="Comments.html#Comments">Comments</a>) or a preprocessor control command
  81. (see <a href="Preprocessing.html#Preprocessing">Preprocessing</a>).
  82. </p>
  83. </dd>
  84. <dt><code>Instruction Delimiting</code></dt>
  85. <dd><p>A semicolon must terminate every instruction. Sometimes a complete
  86. instruction will consist of more than one operation. There are two
  87. cases where this occurs. The first is when two general operations
  88. are combined. Normally a comma separates the different parts, as in
  89. </p>
  90. <div class="smallexample">
  91. <pre class="smallexample">a0= r3.h * r2.l, a1 = r3.l * r2.h ;
  92. </pre></div>
  93. <p>The second case occurs when a general instruction is combined with one
  94. or two memory references for joint issue. The latter portions are
  95. set off by a &quot;||&quot; token.
  96. </p>
  97. <div class="smallexample">
  98. <pre class="smallexample">a0 = r3.h * r2.l || r1 = [p3++] || r4 = [i2++];
  99. </pre></div>
  100. <p>Multiple instructions can occur on the same line. Each must be
  101. terminated by a semicolon character.
  102. </p>
  103. </dd>
  104. <dt><code>Register Names</code></dt>
  105. <dd>
  106. <p>The assembler treats register names and instruction keywords in a case
  107. insensitive manner. User identifiers are case sensitive. Thus, R3.l,
  108. R3.L, r3.l and r3.L are all equivalent input to the assembler.
  109. </p>
  110. <p>Register names are reserved and may not be used as program identifiers.
  111. </p>
  112. <p>Some operations (such as &quot;Move Register&quot;) require a register pair.
  113. Register pairs are always data registers and are denoted using a colon,
  114. eg., R3:2. The larger number must be written firsts. Note that the
  115. hardware only supports odd-even pairs, eg., R7:6, R5:4, R3:2, and R1:0.
  116. </p>
  117. <p>Some instructions (such as &ndash;SP (Push Multiple)) require a group of
  118. adjacent registers. Adjacent registers are denoted in the syntax by
  119. the range enclosed in parentheses and separated by a colon, eg., (R7:3).
  120. Again, the larger number appears first.
  121. </p>
  122. <p>Portions of a particular register may be individually specified. This
  123. is written with a dot (&quot;.&quot;) following the register name and then a
  124. letter denoting the desired portion. For 32-bit registers, &quot;.H&quot;
  125. denotes the most significant (&quot;High&quot;) portion. &quot;.L&quot; denotes the
  126. least-significant portion. The subdivisions of the 40-bit registers
  127. are described later.
  128. </p>
  129. </dd>
  130. <dt><code>Accumulators</code></dt>
  131. <dd><p>The set of 40-bit registers A1 and A0 that normally contain data that
  132. is being manipulated. Each accumulator can be accessed in four ways.
  133. </p>
  134. <dl compact="compact">
  135. <dt><code>one 40-bit register</code></dt>
  136. <dd><p>The register will be referred to as A1 or A0.
  137. </p></dd>
  138. <dt><code>one 32-bit register</code></dt>
  139. <dd><p>The registers are designated as A1.W or A0.W.
  140. </p></dd>
  141. <dt><code>two 16-bit registers</code></dt>
  142. <dd><p>The registers are designated as A1.H, A1.L, A0.H or A0.L.
  143. </p></dd>
  144. <dt><code>one 8-bit register</code></dt>
  145. <dd><p>The registers are designated as A1.X or A0.X for the bits that
  146. extend beyond bit 31.
  147. </p></dd>
  148. </dl>
  149. </dd>
  150. <dt><code>Data Registers</code></dt>
  151. <dd><p>The set of 32-bit registers (R0, R1, R2, R3, R4, R5, R6 and R7) that
  152. normally contain data for manipulation. These are abbreviated as
  153. D-register or Dreg. Data registers can be accessed as 32-bit registers
  154. or as two independent 16-bit registers. The least significant 16 bits
  155. of each register is called the &quot;low&quot; half and is designated with &quot;.L&quot;
  156. following the register name. The most significant 16 bits are called
  157. the &quot;high&quot; half and is designated with &quot;.H&quot; following the name.
  158. </p>
  159. <div class="smallexample">
  160. <pre class="smallexample"> R7.L, r2.h, r4.L, R0.H
  161. </pre></div>
  162. </dd>
  163. <dt><code>Pointer Registers</code></dt>
  164. <dd><p>The set of 32-bit registers (P0, P1, P2, P3, P4, P5, SP and FP) that
  165. normally contain byte addresses of data structures. These are
  166. abbreviated as P-register or Preg.
  167. </p>
  168. <div class="smallexample">
  169. <pre class="smallexample">p2, p5, fp, sp
  170. </pre></div>
  171. </dd>
  172. <dt><code>Stack Pointer SP</code></dt>
  173. <dd><p>The stack pointer contains the 32-bit address of the last occupied
  174. byte location in the stack. The stack grows by decrementing the
  175. stack pointer.
  176. </p>
  177. </dd>
  178. <dt><code>Frame Pointer FP</code></dt>
  179. <dd><p>The frame pointer contains the 32-bit address of the previous frame
  180. pointer in the stack. It is located at the top of a frame.
  181. </p>
  182. </dd>
  183. <dt><code>Loop Top</code></dt>
  184. <dd><p>LT0 and LT1. These registers contain the 32-bit address of the top of
  185. a zero overhead loop.
  186. </p>
  187. </dd>
  188. <dt><code>Loop Count</code></dt>
  189. <dd><p>LC0 and LC1. These registers contain the 32-bit counter of the zero
  190. overhead loop executions.
  191. </p>
  192. </dd>
  193. <dt><code>Loop Bottom</code></dt>
  194. <dd><p>LB0 and LB1. These registers contain the 32-bit address of the bottom
  195. of a zero overhead loop.
  196. </p>
  197. </dd>
  198. <dt><code>Index Registers</code></dt>
  199. <dd><p>The set of 32-bit registers (I0, I1, I2, I3) that normally contain byte
  200. addresses of data structures. Abbreviated I-register or Ireg.
  201. </p>
  202. </dd>
  203. <dt><code>Modify Registers</code></dt>
  204. <dd><p>The set of 32-bit registers (M0, M1, M2, M3) that normally contain
  205. offset values that are added and subtracted to one of the index
  206. registers. Abbreviated as Mreg.
  207. </p>
  208. </dd>
  209. <dt><code>Length Registers</code></dt>
  210. <dd><p>The set of 32-bit registers (L0, L1, L2, L3) that normally contain the
  211. length in bytes of the circular buffer. Abbreviated as Lreg. Clear
  212. the Lreg to disable circular addressing for the corresponding Ireg.
  213. </p>
  214. </dd>
  215. <dt><code>Base Registers</code></dt>
  216. <dd><p>The set of 32-bit registers (B0, B1, B2, B3) that normally contain the
  217. base address in bytes of the circular buffer. Abbreviated as Breg.
  218. </p>
  219. </dd>
  220. <dt><code>Floating Point</code></dt>
  221. <dd><p>The Blackfin family has no hardware floating point but the .float
  222. directive generates ieee floating point numbers for use with software
  223. floating point libraries.
  224. </p>
  225. </dd>
  226. <dt><code>Blackfin Opcodes</code></dt>
  227. <dd><p>For detailed information on the Blackfin machine instruction set, see
  228. the Blackfin Processor Instruction Set Reference.
  229. </p>
  230. </dd>
  231. </dl>
  232. <hr>
  233. <div class="header">
  234. <p>
  235. Next: <a href="Blackfin-Directives.html#Blackfin-Directives" accesskey="n" rel="next">Blackfin Directives</a>, Previous: <a href="Blackfin-Options.html#Blackfin-Options" accesskey="p" rel="prev">Blackfin Options</a>, Up: <a href="Blackfin_002dDependent.html#Blackfin_002dDependent" accesskey="u" rel="up">Blackfin-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>
  236. </div>
  237. </body>
  238. </html>