📄 word.html
字号:
<html lang="en">
<head>
<title>Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="Word">Word</a>,
Next:<a rel="next" accesskey="n" href="Deprecated.html#Deprecated">Deprecated</a>,
Previous:<a rel="previous" accesskey="p" href="Weak.html#Weak">Weak</a>,
Up:<a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo%20Ops">Pseudo Ops</a>
<hr><br>
</div>
<h3 class="section"><code>.word </code><var>expressions</var><code></code></h3>
<p>This directive expects zero or more <var>expressions</var>, of any section,
separated by commas.
<p>The size of the number emitted, and its byte order,
depend on what target computer the assembly is for.
<blockquote>
<em>Warning: Special Treatment to support Compilers</em>
</blockquote>
<p>Machines with a 32-bit address space, but that do less than 32-bit
addressing, require the following special treatment. If the machine of
interest to you does 32-bit addressing (or doesn't require it;
see <a href="Machine-Dependencies.html#Machine%20Dependencies">Machine Dependencies</a>), you can ignore this issue.
<p>In order to assemble compiler output into something that works,
<code>as</code> occasionally does strange things to <code>.word</code> directives.
Directives of the form <code>.word sym1-sym2</code> are often emitted by
compilers as part of jump tables. Therefore, when <code>as</code> assembles a
directive of the form <code>.word sym1-sym2</code>, and the difference between
<code>sym1</code> and <code>sym2</code> does not fit in 16 bits, <code>as</code>
creates a <dfn>secondary jump table</dfn>, immediately before the next label.
This secondary jump table is preceded by a short-jump to the
first byte after the secondary table. This short-jump prevents the flow
of control from accidentally falling into the new table. Inside the
table is a long-jump to <code>sym2</code>. The original <code>.word</code>
contains <code>sym1</code> minus the address of the long-jump to
<code>sym2</code>.
<p>If there were several occurrences of <code>.word sym1-sym2</code> before the
secondary jump table, all of them are adjusted. If there was a
<code>.word sym3-sym4</code>, that also did not fit in sixteen bits, a
long-jump to <code>sym4</code> is included in the secondary jump table,
and the <code>.word</code> directives are adjusted to contain <code>sym3</code>
minus the address of the long-jump to <code>sym4</code>; and so on, for as many
entries in the original jump table as necessary.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -