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.

295 satır
13KB

  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>s390 Formats (Using as)</title>
  16. <meta name="description" content="s390 Formats (Using as)">
  17. <meta name="keywords" content="s390 Formats (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="s390-Syntax.html#s390-Syntax" rel="up" title="s390 Syntax">
  25. <link href="s390-Aliases.html#s390-Aliases" rel="next" title="s390 Aliases">
  26. <link href="s390-Operands.html#s390-Operands" rel="prev" title="s390 Operands">
  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="s390-Formats"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="s390-Aliases.html#s390-Aliases" accesskey="n" rel="next">s390 Aliases</a>, Previous: <a href="s390-Operands.html#s390-Operands" accesskey="p" rel="prev">s390 Operands</a>, Up: <a href="s390-Syntax.html#s390-Syntax" accesskey="u" rel="up">s390 Syntax</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="Instruction-Formats"></a>
  63. <h4 class="subsubsection">9.41.3.4 Instruction Formats</h4>
  64. <a name="index-instruction-formats_002c-s390"></a>
  65. <a name="index-s390-instruction-formats"></a>
  66. <p>The Principles of Operation manuals lists 26 instruction formats where
  67. some of the formats have multiple variants. For the &lsquo;<samp>.insn</samp>&rsquo;
  68. pseudo directive the assembler recognizes some of the formats.
  69. Typically, the most general variant of the instruction format is used
  70. by the &lsquo;<samp>.insn</samp>&rsquo; directive.
  71. </p>
  72. <p>The following table lists the abbreviations used in the table of
  73. instruction formats:
  74. </p>
  75. <div class="display">
  76. <table>
  77. <tr><td><pre class="display">OpCode / OpCd</pre></td><td><pre class="display">Part of the op code.</pre></td></tr>
  78. <tr><td><pre class="display">Bx</pre></td><td><pre class="display">Base register number for operand x.</pre></td></tr>
  79. <tr><td><pre class="display">Dx</pre></td><td><pre class="display">Displacement for operand x.</pre></td></tr>
  80. <tr><td><pre class="display">DLx</pre></td><td><pre class="display">Displacement lower 12 bits for operand x.</pre></td></tr>
  81. <tr><td><pre class="display">DHx</pre></td><td><pre class="display">Displacement higher 8-bits for operand x.</pre></td></tr>
  82. <tr><td><pre class="display">Rx</pre></td><td><pre class="display">Register number for operand x.</pre></td></tr>
  83. <tr><td><pre class="display">Xx</pre></td><td><pre class="display">Index register number for operand x.</pre></td></tr>
  84. <tr><td><pre class="display">Ix</pre></td><td><pre class="display">Signed immediate for operand x.</pre></td></tr>
  85. <tr><td><pre class="display">Ux</pre></td><td><pre class="display">Unsigned immediate for operand x.</pre></td></tr>
  86. </table>
  87. </div>
  88. <p>An instruction is two, four, or six bytes in length and must be aligned
  89. on a 2 byte boundary. The first two bits of the instruction specify the
  90. length of the instruction, 00 indicates a two byte instruction, 01 and 10
  91. indicates a four byte instruction, and 11 indicates a six byte instruction.
  92. </p>
  93. <p>The following table lists the s390 instruction formats that are available
  94. with the &lsquo;<samp>.insn</samp>&rsquo; pseudo directive:
  95. </p>
  96. <dl compact="compact">
  97. <dt><code>E format</code></dt>
  98. <dd><pre class="verbatim">+-------------+
  99. | OpCode |
  100. +-------------+
  101. 0 15
  102. </pre>
  103. </dd>
  104. <dt><code>RI format: &lt;insn&gt; R1,I2</code></dt>
  105. <dd><pre class="verbatim">+--------+----+----+------------------+
  106. | OpCode | R1 |OpCd| I2 |
  107. +--------+----+----+------------------+
  108. 0 8 12 16 31
  109. </pre>
  110. </dd>
  111. <dt><code>RIE format: &lt;insn&gt; R1,R3,I2</code></dt>
  112. <dd><pre class="verbatim">+--------+----+----+------------------+--------+--------+
  113. | OpCode | R1 | R3 | I2 |////////| OpCode |
  114. +--------+----+----+------------------+--------+--------+
  115. 0 8 12 16 32 40 47
  116. </pre>
  117. </dd>
  118. <dt><code>RIL format: &lt;insn&gt; R1,I2</code></dt>
  119. <dd><pre class="verbatim">+--------+----+----+------------------------------------+
  120. | OpCode | R1 |OpCd| I2 |
  121. +--------+----+----+------------------------------------+
  122. 0 8 12 16 47
  123. </pre>
  124. </dd>
  125. <dt><code>RILU format: &lt;insn&gt; R1,U2</code></dt>
  126. <dd><pre class="verbatim">+--------+----+----+------------------------------------+
  127. | OpCode | R1 |OpCd| U2 |
  128. +--------+----+----+------------------------------------+
  129. 0 8 12 16 47
  130. </pre>
  131. </dd>
  132. <dt><code>RIS format: &lt;insn&gt; R1,I2,M3,D4(B4)</code></dt>
  133. <dd><pre class="verbatim">+--------+----+----+----+-------------+--------+--------+
  134. | OpCode | R1 | M3 | B4 | D4 | I2 | Opcode |
  135. +--------+----+----+----+-------------+--------+--------+
  136. 0 8 12 16 20 32 36 47
  137. </pre>
  138. </dd>
  139. <dt><code>RR format: &lt;insn&gt; R1,R2</code></dt>
  140. <dd><pre class="verbatim">+--------+----+----+
  141. | OpCode | R1 | R2 |
  142. +--------+----+----+
  143. 0 8 12 15
  144. </pre>
  145. </dd>
  146. <dt><code>RRE format: &lt;insn&gt; R1,R2</code></dt>
  147. <dd><pre class="verbatim">+------------------+--------+----+----+
  148. | OpCode |////////| R1 | R2 |
  149. +------------------+--------+----+----+
  150. 0 16 24 28 31
  151. </pre>
  152. </dd>
  153. <dt><code>RRF format: &lt;insn&gt; R1,R2,R3,M4</code></dt>
  154. <dd><pre class="verbatim">+------------------+----+----+----+----+
  155. | OpCode | R3 | M4 | R1 | R2 |
  156. +------------------+----+----+----+----+
  157. 0 16 20 24 28 31
  158. </pre>
  159. </dd>
  160. <dt><code>RRS format: &lt;insn&gt; R1,R2,M3,D4(B4)</code></dt>
  161. <dd><pre class="verbatim">+--------+----+----+----+-------------+----+----+--------+
  162. | OpCode | R1 | R3 | B4 | D4 | M3 |////| OpCode |
  163. +--------+----+----+----+-------------+----+----+--------+
  164. 0 8 12 16 20 32 36 40 47
  165. </pre>
  166. </dd>
  167. <dt><code>RS format: &lt;insn&gt; R1,R3,D2(B2)</code></dt>
  168. <dd><pre class="verbatim">+--------+----+----+----+-------------+
  169. | OpCode | R1 | R3 | B2 | D2 |
  170. +--------+----+----+----+-------------+
  171. 0 8 12 16 20 31
  172. </pre>
  173. </dd>
  174. <dt><code>RSE format: &lt;insn&gt; R1,R3,D2(B2)</code></dt>
  175. <dd><pre class="verbatim">+--------+----+----+----+-------------+--------+--------+
  176. | OpCode | R1 | R3 | B2 | D2 |////////| OpCode |
  177. +--------+----+----+----+-------------+--------+--------+
  178. 0 8 12 16 20 32 40 47
  179. </pre>
  180. </dd>
  181. <dt><code>RSI format: &lt;insn&gt; R1,R3,I2</code></dt>
  182. <dd><pre class="verbatim">+--------+----+----+------------------------------------+
  183. | OpCode | R1 | R3 | I2 |
  184. +--------+----+----+------------------------------------+
  185. 0 8 12 16 47
  186. </pre>
  187. </dd>
  188. <dt><code>RSY format: &lt;insn&gt; R1,R3,D2(B2)</code></dt>
  189. <dd><pre class="verbatim">+--------+----+----+----+-------------+--------+--------+
  190. | OpCode | R1 | R3 | B2 | DL2 | DH2 | OpCode |
  191. +--------+----+----+----+-------------+--------+--------+
  192. 0 8 12 16 20 32 40 47
  193. </pre>
  194. </dd>
  195. <dt><code>RX format: &lt;insn&gt; R1,D2(X2,B2)</code></dt>
  196. <dd><pre class="verbatim">+--------+----+----+----+-------------+
  197. | OpCode | R1 | X2 | B2 | D2 |
  198. +--------+----+----+----+-------------+
  199. 0 8 12 16 20 31
  200. </pre>
  201. </dd>
  202. <dt><code>RXE format: &lt;insn&gt; R1,D2(X2,B2)</code></dt>
  203. <dd><pre class="verbatim">+--------+----+----+----+-------------+--------+--------+
  204. | OpCode | R1 | X2 | B2 | D2 |////////| OpCode |
  205. +--------+----+----+----+-------------+--------+--------+
  206. 0 8 12 16 20 32 40 47
  207. </pre>
  208. </dd>
  209. <dt><code>RXF format: &lt;insn&gt; R1,R3,D2(X2,B2)</code></dt>
  210. <dd><pre class="verbatim">+--------+----+----+----+-------------+----+---+--------+
  211. | OpCode | R3 | X2 | B2 | D2 | R1 |///| OpCode |
  212. +--------+----+----+----+-------------+----+---+--------+
  213. 0 8 12 16 20 32 36 40 47
  214. </pre>
  215. </dd>
  216. <dt><code>RXY format: &lt;insn&gt; R1,D2(X2,B2)</code></dt>
  217. <dd><pre class="verbatim">+--------+----+----+----+-------------+--------+--------+
  218. | OpCode | R1 | X2 | B2 | DL2 | DH2 | OpCode |
  219. +--------+----+----+----+-------------+--------+--------+
  220. 0 8 12 16 20 32 36 40 47
  221. </pre>
  222. </dd>
  223. <dt><code>S format: &lt;insn&gt; D2(B2)</code></dt>
  224. <dd><pre class="verbatim">+------------------+----+-------------+
  225. | OpCode | B2 | D2 |
  226. +------------------+----+-------------+
  227. 0 16 20 31
  228. </pre>
  229. </dd>
  230. <dt><code>SI format: &lt;insn&gt; D1(B1),I2</code></dt>
  231. <dd><pre class="verbatim">+--------+---------+----+-------------+
  232. | OpCode | I2 | B1 | D1 |
  233. +--------+---------+----+-------------+
  234. 0 8 16 20 31
  235. </pre>
  236. </dd>
  237. <dt><code>SIY format: &lt;insn&gt; D1(B1),U2</code></dt>
  238. <dd><pre class="verbatim">+--------+---------+----+-------------+--------+--------+
  239. | OpCode | I2 | B1 | DL1 | DH1 | OpCode |
  240. +--------+---------+----+-------------+--------+--------+
  241. 0 8 16 20 32 36 40 47
  242. </pre>
  243. </dd>
  244. <dt><code>SIL format: &lt;insn&gt; D1(B1),I2</code></dt>
  245. <dd><pre class="verbatim">+------------------+----+-------------+-----------------+
  246. | OpCode | B1 | D1 | I2 |
  247. +------------------+----+-------------+-----------------+
  248. 0 16 20 32 47
  249. </pre>
  250. </dd>
  251. <dt><code>SS format: &lt;insn&gt; D1(R1,B1),D2(B3),R3</code></dt>
  252. <dd><pre class="verbatim">+--------+----+----+----+-------------+----+------------+
  253. | OpCode | R1 | R3 | B1 | D1 | B2 | D2 |
  254. +--------+----+----+----+-------------+----+------------+
  255. 0 8 12 16 20 32 36 47
  256. </pre>
  257. </dd>
  258. <dt><code>SSE format: &lt;insn&gt; D1(B1),D2(B2)</code></dt>
  259. <dd><pre class="verbatim">+------------------+----+-------------+----+------------+
  260. | OpCode | B1 | D1 | B2 | D2 |
  261. +------------------+----+-------------+----+------------+
  262. 0 8 12 16 20 32 36 47
  263. </pre>
  264. </dd>
  265. <dt><code>SSF format: &lt;insn&gt; D1(B1),D2(B2),R3</code></dt>
  266. <dd><pre class="verbatim">+--------+----+----+----+-------------+----+------------+
  267. | OpCode | R3 |OpCd| B1 | D1 | B2 | D2 |
  268. +--------+----+----+----+-------------+----+------------+
  269. 0 8 12 16 20 32 36 47
  270. </pre>
  271. </dd>
  272. </dl>
  273. <p>For the complete list of all instruction format variants see the
  274. Principles of Operation manuals.
  275. </p>
  276. <hr>
  277. <div class="header">
  278. <p>
  279. Next: <a href="s390-Aliases.html#s390-Aliases" accesskey="n" rel="next">s390 Aliases</a>, Previous: <a href="s390-Operands.html#s390-Operands" accesskey="p" rel="prev">s390 Operands</a>, Up: <a href="s390-Syntax.html#s390-Syntax" accesskey="u" rel="up">s390 Syntax</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>
  280. </div>
  281. </body>
  282. </html>