blob: 4ff80dbcd5f1071e9541540951cddef987f9aeb9 [file] [log] [blame]
<html lang="en">
<head>
<title>s390 Formats - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="s390-Syntax.html#s390-Syntax" title="s390 Syntax">
<link rel="prev" href="s390-Operands.html#s390-Operands" title="s390 Operands">
<link rel="next" href="s390-Aliases.html#s390-Aliases" title="s390 Aliases">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="s390-Formats"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="s390-Aliases.html#s390-Aliases">s390 Aliases</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="s390-Operands.html#s390-Operands">s390 Operands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="s390-Syntax.html#s390-Syntax">s390 Syntax</a>
<hr>
</div>
<h5 class="subsubsection">9.31.3.4 Instruction Formats</h5>
<p><a name="index-instruction-formats_002c-s390-1540"></a><a name="index-s390-instruction-formats-1541"></a>
The Principles of Operation manuals lists 26 instruction formats where
some of the formats have multiple variants. For the &lsquo;<samp><span class="samp">.insn</span></samp>&rsquo;
pseudo directive the assembler recognizes some of the formats.
Typically, the most general variant of the instruction format is used
by the &lsquo;<samp><span class="samp">.insn</span></samp>&rsquo; directive.
<p>The following table lists the abbreviations used in the table of
instruction formats:
<pre class="display">
<p><table summary=""><tr align="left"><td valign="top">OpCode / OpCd </td><td valign="top">Part of the op code.
<br></td></tr><tr align="left"><td valign="top">Bx </td><td valign="top">Base register number for operand x.
<br></td></tr><tr align="left"><td valign="top">Dx </td><td valign="top">Displacement for operand x.
<br></td></tr><tr align="left"><td valign="top">DLx </td><td valign="top">Displacement lower 12 bits for operand x.
<br></td></tr><tr align="left"><td valign="top">DHx </td><td valign="top">Displacement higher 8-bits for operand x.
<br></td></tr><tr align="left"><td valign="top">Rx </td><td valign="top">Register number for operand x.
<br></td></tr><tr align="left"><td valign="top">Xx </td><td valign="top">Index register number for operand x.
<br></td></tr><tr align="left"><td valign="top">Ix </td><td valign="top">Signed immediate for operand x.
<br></td></tr><tr align="left"><td valign="top">Ux </td><td valign="top">Unsigned immediate for operand x.
<br></td></tr></table>
</pre>
<p>An instruction is two, four, or six bytes in length and must be aligned
on a 2 byte boundary. The first two bits of the instruction specify the
length of the instruction, 00 indicates a two byte instruction, 01 and 10
indicates a four byte instruction, and 11 indicates a six byte instruction.
<p>The following table lists the s390 instruction formats that are available
with the &lsquo;<samp><span class="samp">.insn</span></samp>&rsquo; pseudo directive:
<dl>
<dt><code>E format</code><dd><pre class="verbatim"> +-------------+
| OpCode |
+-------------+
0 15
</pre>
<br><dt><code>RI format: &lt;insn&gt; R1,I2</code><dd><pre class="verbatim"> +--------+----+----+------------------+
| OpCode | R1 |OpCd| I2 |
+--------+----+----+------------------+
0 8 12 16 31
</pre>
<br><dt><code>RIE format: &lt;insn&gt; R1,R3,I2</code><dd><pre class="verbatim"> +--------+----+----+------------------+--------+--------+
| OpCode | R1 | R3 | I2 |////////| OpCode |
+--------+----+----+------------------+--------+--------+
0 8 12 16 32 40 47
</pre>
<br><dt><code>RIL format: &lt;insn&gt; R1,I2</code><dd><pre class="verbatim"> +--------+----+----+------------------------------------+
| OpCode | R1 |OpCd| I2 |
+--------+----+----+------------------------------------+
0 8 12 16 47
</pre>
<br><dt><code>RILU format: &lt;insn&gt; R1,U2</code><dd><pre class="verbatim"> +--------+----+----+------------------------------------+
| OpCode | R1 |OpCd| U2 |
+--------+----+----+------------------------------------+
0 8 12 16 47
</pre>
<br><dt><code>RIS format: &lt;insn&gt; R1,I2,M3,D4(B4)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+--------+--------+
| OpCode | R1 | M3 | B4 | D4 | I2 | Opcode |
+--------+----+----+----+-------------+--------+--------+
0 8 12 16 20 32 36 47
</pre>
<br><dt><code>RR format: &lt;insn&gt; R1,R2</code><dd><pre class="verbatim"> +--------+----+----+
| OpCode | R1 | R2 |
+--------+----+----+
0 8 12 15
</pre>
<br><dt><code>RRE format: &lt;insn&gt; R1,R2</code><dd><pre class="verbatim"> +------------------+--------+----+----+
| OpCode |////////| R1 | R2 |
+------------------+--------+----+----+
0 16 24 28 31
</pre>
<br><dt><code>RRF format: &lt;insn&gt; R1,R2,R3,M4</code><dd><pre class="verbatim"> +------------------+----+----+----+----+
| OpCode | R3 | M4 | R1 | R2 |
+------------------+----+----+----+----+
0 16 20 24 28 31
</pre>
<br><dt><code>RRS format: &lt;insn&gt; R1,R2,M3,D4(B4)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+----+----+--------+
| OpCode | R1 | R3 | B4 | D4 | M3 |////| OpCode |
+--------+----+----+----+-------------+----+----+--------+
0 8 12 16 20 32 36 40 47
</pre>
<br><dt><code>RS format: &lt;insn&gt; R1,R3,D2(B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+
| OpCode | R1 | R3 | B2 | D2 |
+--------+----+----+----+-------------+
0 8 12 16 20 31
</pre>
<br><dt><code>RSE format: &lt;insn&gt; R1,R3,D2(B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+--------+--------+
| OpCode | R1 | R3 | B2 | D2 |////////| OpCode |
+--------+----+----+----+-------------+--------+--------+
0 8 12 16 20 32 40 47
</pre>
<br><dt><code>RSI format: &lt;insn&gt; R1,R3,I2</code><dd><pre class="verbatim"> +--------+----+----+------------------------------------+
| OpCode | R1 | R3 | I2 |
+--------+----+----+------------------------------------+
0 8 12 16 47
</pre>
<br><dt><code>RSY format: &lt;insn&gt; R1,R3,D2(B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+--------+--------+
| OpCode | R1 | R3 | B2 | DL2 | DH2 | OpCode |
+--------+----+----+----+-------------+--------+--------+
0 8 12 16 20 32 40 47
</pre>
<br><dt><code>RX format: &lt;insn&gt; R1,D2(X2,B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+
| OpCode | R1 | X2 | B2 | D2 |
+--------+----+----+----+-------------+
0 8 12 16 20 31
</pre>
<br><dt><code>RXE format: &lt;insn&gt; R1,D2(X2,B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+--------+--------+
| OpCode | R1 | X2 | B2 | D2 |////////| OpCode |
+--------+----+----+----+-------------+--------+--------+
0 8 12 16 20 32 40 47
</pre>
<br><dt><code>RXF format: &lt;insn&gt; R1,R3,D2(X2,B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+----+---+--------+
| OpCode | R3 | X2 | B2 | D2 | R1 |///| OpCode |
+--------+----+----+----+-------------+----+---+--------+
0 8 12 16 20 32 36 40 47
</pre>
<br><dt><code>RXY format: &lt;insn&gt; R1,D2(X2,B2)</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+--------+--------+
| OpCode | R1 | X2 | B2 | DL2 | DH2 | OpCode |
+--------+----+----+----+-------------+--------+--------+
0 8 12 16 20 32 36 40 47
</pre>
<br><dt><code>S format: &lt;insn&gt; D2(B2)</code><dd><pre class="verbatim"> +------------------+----+-------------+
| OpCode | B2 | D2 |
+------------------+----+-------------+
0 16 20 31
</pre>
<br><dt><code>SI format: &lt;insn&gt; D1(B1),I2</code><dd><pre class="verbatim"> +--------+---------+----+-------------+
| OpCode | I2 | B1 | D1 |
+--------+---------+----+-------------+
0 8 16 20 31
</pre>
<br><dt><code>SIY format: &lt;insn&gt; D1(B1),U2</code><dd><pre class="verbatim"> +--------+---------+----+-------------+--------+--------+
| OpCode | I2 | B1 | DL1 | DH1 | OpCode |
+--------+---------+----+-------------+--------+--------+
0 8 16 20 32 36 40 47
</pre>
<br><dt><code>SIL format: &lt;insn&gt; D1(B1),I2</code><dd><pre class="verbatim"> +------------------+----+-------------+-----------------+
| OpCode | B1 | D1 | I2 |
+------------------+----+-------------+-----------------+
0 16 20 32 47
</pre>
<br><dt><code>SS format: &lt;insn&gt; D1(R1,B1),D2(B3),R3</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+----+------------+
| OpCode | R1 | R3 | B1 | D1 | B2 | D2 |
+--------+----+----+----+-------------+----+------------+
0 8 12 16 20 32 36 47
</pre>
<br><dt><code>SSE format: &lt;insn&gt; D1(B1),D2(B2)</code><dd><pre class="verbatim"> +------------------+----+-------------+----+------------+
| OpCode | B1 | D1 | B2 | D2 |
+------------------+----+-------------+----+------------+
0 8 12 16 20 32 36 47
</pre>
<br><dt><code>SSF format: &lt;insn&gt; D1(B1),D2(B2),R3</code><dd><pre class="verbatim"> +--------+----+----+----+-------------+----+------------+
| OpCode | R3 |OpCd| B1 | D1 | B2 | D2 |
+--------+----+----+----+-------------+----+------------+
0 8 12 16 20 32 36 47
</pre>
</dl>
<p>For the complete list of all instruction format variants see the
Principles of Operation manuals.
</body></html>