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 Directives</title>
17
18<meta name="description" content="Using as: s390 Directives">
19<meta name="keywords" content="Using as: s390 Directives">
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="S_002f390_002dDependent.html#S_002f390_002dDependent" rel="up" title="S/390-Dependent">
28<link href="s390-Floating-Point.html#s390-Floating-Point" rel="next" title="s390 Floating Point">
29<link href="s390-Literal-Pool-Entries.html#s390-Literal-Pool-Entries" rel="previous" title="s390 Literal Pool Entries">
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-Directives"></a>
64<div class="header">
65<p>
66Next: <a href="s390-Floating-Point.html#s390-Floating-Point" accesskey="n" rel="next">s390 Floating Point</a>, Previous: <a href="s390-Syntax.html#s390-Syntax" accesskey="p" rel="previous">s390 Syntax</a>, Up: <a href="S_002f390_002dDependent.html#S_002f390_002dDependent" accesskey="u" rel="up">S/390-Dependent</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="Assembler-Directives-7"></a>
70<h4 class="subsection">9.41.4 Assembler Directives</h4>
71
72<p><code>as</code> for s390 supports all of the standard ELF
73assembler directives as outlined in the main part of this document.
74Some directives have been extended and there are some additional
75directives, which are only available for the s390 <code>as</code>.
76</p>
77<dl compact="compact">
78<dd><a name="index-_002einsn-directive_002c-s390"></a>
79</dd>
80<dt><code>.insn</code></dt>
81<dd><p>This directive permits the numeric representation of an instructions
82and makes the assembler insert the operands according to one of the
83instructions formats for &lsquo;<samp>.insn</samp>&rsquo; (<a href="s390-Formats.html#s390-Formats">s390 Formats</a>).
84For example, the instruction &lsquo;<samp>l %r1,24(%r15)</samp>&rsquo; could be written as
85&lsquo;<samp>.insn rx,0x58000000,%r1,24(%r15)</samp>&rsquo;.
86<a name="index-_002eshort-directive_002c-s390"></a>
87<a name="index-_002elong-directive_002c-s390"></a>
88<a name="index-_002equad-directive_002c-s390"></a>
89</p></dd>
90<dt><code>.short</code></dt>
91<dt><code>.long</code></dt>
92<dt><code>.quad</code></dt>
93<dd><p>This directive places one or more 16-bit (.short), 32-bit (.long), or
9464-bit (.quad) values into the current section. If an ELF or TLS modifier
95is used only the following expressions are allowed:
96&lsquo;<samp>symbol@modifier + constant</samp>&rsquo;,
97&lsquo;<samp>symbol@modifier + label + constant</samp>&rsquo;, and
98&lsquo;<samp>symbol@modifier - label + constant</samp>&rsquo;.
99The following modifiers are available:
100</p><dl compact="compact">
101<dt><code>@got</code></dt>
102<dt><code>@got12</code></dt>
103<dd><p>The @got modifier can be used for .short, .long and .quad. The @got12
104modifier is synonym to @got. The symbol is added to the GOT. The symbol
105term is replaced with offset from the start of the GOT to the GOT slot for
106the symbol.
107</p></dd>
108<dt><code>@gotoff</code></dt>
109<dd><p>The @gotoff modifier can be used for .short, .long and .quad. The symbol
110term is replaced with the offset from the start of the GOT to the address
111of the symbol.
112</p></dd>
113<dt><code>@gotplt</code></dt>
114<dd><p>The @gotplt modifier can be used for .long and .quad. A procedure linkage
115table entry is generated for the symbol and a jump slot for the symbol
116is added to the GOT. The symbol term is replaced with the offset from the
117start of the GOT to the jump slot for the symbol.
118</p></dd>
119<dt><code>@plt</code></dt>
120<dd><p>The @plt modifier can be used for .long and .quad. A procedure linkage
121table entry us generated for the symbol. The symbol term is replaced with
122the address of the PLT entry for the symbol.
123</p></dd>
124<dt><code>@pltoff</code></dt>
125<dd><p>The @pltoff modifier can be used for .short, .long and .quad. The symbol
126term is replaced with the offset from the start of the PLT to the address
127of the symbol.
128</p></dd>
129<dt><code>@tlsgd</code></dt>
130<dt><code>@tlsldm</code></dt>
131<dd><p>The @tlsgd and @tlsldm modifier can be used for .long and .quad. A
132tls_index structure for the symbol is added to the GOT. The symbol term is
133replaced with the offset from the start of the GOT to the tls_index structure.
134</p></dd>
135<dt><code>@gotntpoff</code></dt>
136<dt><code>@indntpoff</code></dt>
137<dd><p>The @gotntpoff and @indntpoff modifier can be used for .long and .quad.
138The symbol is added to the static TLS block and the negated offset to the
139symbol in the static TLS block is added to the GOT. For @gotntpoff the
140symbol term is replaced with the offset from the start of the GOT to the
141GOT slot, for @indntpoff the symbol term is replaced with the address
142of the GOT slot.
143</p></dd>
144<dt><code>@dtpoff</code></dt>
145<dd><p>The @dtpoff modifier can be used for .long and .quad. The symbol term
146is replaced with the offset of the symbol relative to the start of the
147TLS block it is contained in.
148</p></dd>
149<dt><code>@ntpoff</code></dt>
150<dd><p>The @ntpoff modifier can be used for .long and .quad. The symbol term
151is replaced with the offset of the symbol relative to the TCB pointer.
152</p></dd>
153</dl>
154
155<p>For more information about the thread local storage modifiers see the
156ELF extension documentation &lsquo;<samp>ELF Handling For Thread-Local Storage</samp>&rsquo;.
157</p>
158<a name="index-_002eltorg-directive_002c-s390"></a>
159</dd>
160<dt><code>.ltorg</code></dt>
161<dd><p>This directive causes the current contents of the literal pool to be
162dumped to the current location (<a href="s390-Literal-Pool-Entries.html#s390-Literal-Pool-Entries">s390 Literal Pool Entries</a>).
163</p>
164<a name="index-_002emachine-directive_002c-s390"></a>
165</dd>
166<dt><code>.machine <var>STRING</var>[+<var>EXTENSION</var>]&hellip;</code></dt>
167<dd>
168<p>This directive allows changing the machine for which code is
169generated.  <code>string</code> may be any of the <code>-march=</code>
170selection options, or <code>push</code>, or <code>pop</code>.  <code>.machine
171push</code> saves the currently selected cpu, which may be restored with
172<code>.machine pop</code>.  Be aware that the cpu string has to be put
173into double quotes in case it contains characters not appropriate
174for identifiers.  So you have to write <code>&quot;z9-109&quot;</code> instead of
175just <code>z9-109</code>.  Extensions can be specified after the cpu
176name, separated by plus characters.  Valid extensions are:
177<code>htm</code>,
178<code>nohtm</code>,
179<code>vx</code>,
180<code>novx</code>.
181They extend the basic instruction set with features from a higher
182cpu level, or remove support for a feature from the given cpu
183level.
184</p>
185<p>Example: <code>z13+nohtm</code> allows all instructions of the z13 cpu
186except instructions from the HTM facility.
187</p>
188<a name="index-_002emachinemode-directive_002c-s390"></a>
189</dd>
190<dt><code>.machinemode string</code></dt>
191<dd><p>This directive allows one to change the architecture mode for which code
192is being generated.  <code>string</code> may be <code>esa</code>, <code>zarch</code>,
193<code>zarch_nohighgprs</code>, <code>push</code>, or <code>pop</code>.
194<code>.machinemode zarch_nohighgprs</code> can be used to prevent the
195<code>highgprs</code> flag from being set in the ELF header of the output
196file.  This is useful in situations where the code is gated with a
197runtime check which makes sure that the code is only executed on
198kernels providing the <code>highgprs</code> feature.
199<code>.machinemode push</code> saves the currently selected mode, which may
200be restored with <code>.machinemode pop</code>.
201</p></dd>
202</dl>
203
204<hr>
205<div class="header">
206<p>
207Next: <a href="s390-Floating-Point.html#s390-Floating-Point" accesskey="n" rel="next">s390 Floating Point</a>, Previous: <a href="s390-Syntax.html#s390-Syntax" accesskey="p" rel="previous">s390 Syntax</a>, Up: <a href="S_002f390_002dDependent.html#S_002f390_002dDependent" accesskey="u" rel="up">S/390-Dependent</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>
208</div>
209
210
211
212</body>
213</html>
214