s390-Formats.html 13 KB

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