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