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
5Copyright (C) 1991-2021 Free Software Foundation, Inc.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3
9or any later version published by the Free Software Foundation;
10with no Invariant Sections, with no Front-Cover Texts, and with no
11Back-Cover Texts.  A copy of the license is included in the
12section entitled "GNU Free Documentation License".
13 -->
14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
15<head>
16<title>Using as: s390 Mnemonics</title>
17
18<meta name="description" content="Using as: s390 Mnemonics">
19<meta name="keywords" content="Using as: s390 Mnemonics">
20<meta name="resource-type" content="document">
21<meta name="distribution" content="global">
22<meta name="Generator" content="makeinfo">
23<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24<link href="index.html#Top" rel="start" title="Top">
25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
27<link href="s390-Syntax.html#s390-Syntax" rel="up" title="s390 Syntax">
28<link href="s390-Operands.html#s390-Operands" rel="next" title="s390 Operands">
29<link href="s390-Register.html#s390-Register" rel="previous" title="s390 Register">
30<style type="text/css">
31<!--
32a.summary-letter {text-decoration: none}
33blockquote.smallquotation {font-size: smaller}
34div.display {margin-left: 3.2em}
35div.example {margin-left: 3.2em}
36div.indentedblock {margin-left: 3.2em}
37div.lisp {margin-left: 3.2em}
38div.smalldisplay {margin-left: 3.2em}
39div.smallexample {margin-left: 3.2em}
40div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
41div.smalllisp {margin-left: 3.2em}
42kbd {font-style:oblique}
43pre.display {font-family: inherit}
44pre.format {font-family: inherit}
45pre.menu-comment {font-family: serif}
46pre.menu-preformatted {font-family: serif}
47pre.smalldisplay {font-family: inherit; font-size: smaller}
48pre.smallexample {font-size: smaller}
49pre.smallformat {font-family: inherit; font-size: smaller}
50pre.smalllisp {font-size: smaller}
51span.nocodebreak {white-space:nowrap}
52span.nolinebreak {white-space:nowrap}
53span.roman {font-family:serif; font-weight:normal}
54span.sansserif {font-family:sans-serif; font-weight:normal}
55ul.no-bullet {list-style: none}
56-->
57</style>
58
59
60</head>
61
62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
63<a name="s390-Mnemonics"></a>
64<div class="header">
65<p>
66Next: <a href="s390-Operands.html#s390-Operands" accesskey="n" rel="next">s390 Operands</a>, Previous: <a href="s390-Register.html#s390-Register" accesskey="p" rel="previous">s390 Register</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>
67</div>
68<hr>
69<a name="Instruction-Mnemonics"></a>
70<h4 class="subsubsection">9.41.3.2 Instruction Mnemonics</h4>
71<a name="index-instruction-mnemonics_002c-s390"></a>
72<a name="index-s390-instruction-mnemonics"></a>
73
74<p>All instructions documented in the Principles of Operation are supported
75with the mnemonic and order of operands as described.
76The instruction mnemonic identifies the instruction format
77(<a href="s390-Formats.html#s390-Formats">s390 Formats</a>) and the specific operation code for the instruction.
78For example, the &lsquo;<samp>lr</samp>&rsquo; mnemonic denotes the instruction format &lsquo;<samp>RR</samp>&rsquo;
79with the operation code &lsquo;<samp>0x18</samp>&rsquo;.
80</p>
81<p>The definition of the various mnemonics follows a scheme, where the first
82character usually hint at the type of the instruction:
83</p>
84<div class="display">
85<table>
86<tr><td><pre class="display">a</pre></td><td><pre class="display">add instruction, for example &lsquo;<samp>al</samp>&rsquo; for add logical 32-bit</pre></td></tr>
87<tr><td><pre class="display">b</pre></td><td><pre class="display">branch instruction, for example &lsquo;<samp>bc</samp>&rsquo; for branch on condition</pre></td></tr>
88<tr><td><pre class="display">c</pre></td><td><pre class="display">compare or convert instruction, for example &lsquo;<samp>cr</samp>&rsquo; for compare
89register 32-bit</pre></td></tr>
90<tr><td><pre class="display">d</pre></td><td><pre class="display">divide instruction, for example &lsquo;<samp>dlr</samp>&rsquo; devide logical register
9164-bit to 32-bit</pre></td></tr>
92<tr><td><pre class="display">i</pre></td><td><pre class="display">insert instruction, for example &lsquo;<samp>ic</samp>&rsquo; insert character</pre></td></tr>
93<tr><td><pre class="display">l</pre></td><td><pre class="display">load instruction, for example &lsquo;<samp>ltr</samp>&rsquo; load and test register</pre></td></tr>
94<tr><td><pre class="display">mv</pre></td><td><pre class="display">move instruction, for example &lsquo;<samp>mvc</samp>&rsquo; move character</pre></td></tr>
95<tr><td><pre class="display">m</pre></td><td><pre class="display">multiply instruction, for example &lsquo;<samp>mh</samp>&rsquo; multiply halfword</pre></td></tr>
96<tr><td><pre class="display">n</pre></td><td><pre class="display">and instruction, for example &lsquo;<samp>ni</samp>&rsquo; and immediate</pre></td></tr>
97<tr><td><pre class="display">o</pre></td><td><pre class="display">or instruction, for example &lsquo;<samp>oc</samp>&rsquo; or character</pre></td></tr>
98<tr><td><pre class="display">sla, sll</pre></td><td><pre class="display">shift left single instruction</pre></td></tr>
99<tr><td><pre class="display">sra, srl</pre></td><td><pre class="display">shift right single instruction</pre></td></tr>
100<tr><td><pre class="display">st</pre></td><td><pre class="display">store instruction, for example &lsquo;<samp>stm</samp>&rsquo; store multiple</pre></td></tr>
101<tr><td><pre class="display">s</pre></td><td><pre class="display">subtract instruction, for example &lsquo;<samp>slr</samp>&rsquo; subtract
102logical 32-bit</pre></td></tr>
103<tr><td><pre class="display">t</pre></td><td><pre class="display">test or translate instruction, of example &lsquo;<samp>tm</samp>&rsquo; test under mask</pre></td></tr>
104<tr><td><pre class="display">x</pre></td><td><pre class="display">exclusive or instruction, for example &lsquo;<samp>xc</samp>&rsquo; exclusive or
105character</pre></td></tr>
106</table>
107</div>
108
109<p>Certain characters at the end of the mnemonic may describe a property
110of the instruction:
111</p>
112<div class="display">
113<table>
114<tr><td><pre class="display">c</pre></td><td><pre class="display">the instruction uses a 8-bit character operand</pre></td></tr>
115<tr><td><pre class="display">f</pre></td><td><pre class="display">the instruction extends a 32-bit operand to 64 bit</pre></td></tr>
116<tr><td><pre class="display">g</pre></td><td><pre class="display">the operands are treated as 64-bit values</pre></td></tr>
117<tr><td><pre class="display">h</pre></td><td><pre class="display">the operand uses a 16-bit halfword operand</pre></td></tr>
118<tr><td><pre class="display">i</pre></td><td><pre class="display">the instruction uses an immediate operand</pre></td></tr>
119<tr><td><pre class="display">l</pre></td><td><pre class="display">the instruction uses unsigned, logical operands</pre></td></tr>
120<tr><td><pre class="display">m</pre></td><td><pre class="display">the instruction uses a mask or operates on multiple values</pre></td></tr>
121<tr><td><pre class="display">r</pre></td><td><pre class="display">if r is the last character, the instruction operates on registers</pre></td></tr>
122<tr><td><pre class="display">y</pre></td><td><pre class="display">the instruction uses 20-bit displacements</pre></td></tr>
123</table>
124</div>
125
126<p>There are many exceptions to the scheme outlined in the above lists, in
127particular for the privileged instructions. For non-privileged
128instruction it works quite well, for example the instruction &lsquo;<samp>clgfr</samp>&rsquo;
129c: compare instruction, l: unsigned operands, g: 64-bit operands,
130f: 32- to 64-bit extension, r: register operands. The instruction compares
131an 64-bit value in a register with the zero extended 32-bit value from
132a second register.
133For a complete list of all mnemonics see appendix B in the Principles
134of Operation.
135</p>
136<hr>
137<div class="header">
138<p>
139Next: <a href="s390-Operands.html#s390-Operands" accesskey="n" rel="next">s390 Operands</a>, Previous: <a href="s390-Register.html#s390-Register" accesskey="p" rel="previous">s390 Register</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>
140</div>
141
142
143
144</body>
145</html>
146