📄 if.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="If">If</a>,
Next:<a rel="next" accesskey="n" href="Incbin.html#Incbin">Incbin</a>,
Previous:<a rel="previous" accesskey="p" href="Ident.html#Ident">Ident</a>,
Up:<a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo%20Ops">Pseudo Ops</a>
<hr><br>
</div>
<h3 class="section"><code>.if </code><var>absolute expression</var><code></code></h3>
<p><code>.if</code> marks the beginning of a section of code which is only
considered part of the source program being assembled if the argument
(which must be an <var>absolute expression</var>) is non-zero. The end of
the conditional section of code must be marked by <code>.endif</code>
(see <a href="Endif.html#Endif"><code>.endif</code></a>); optionally, you may include code for the
alternative condition, flagged by <code>.else</code> (see <a href="Else.html#Else"><code>.else</code></a>).
If you have several conditions to check, <code>.elseif</code> may be used to avoid
nesting blocks if/else within each subsequent <code>.else</code> block.
<p>The following variants of <code>.if</code> are also supported:
<dl>
<dt><code>.ifdef </code><var>symbol</var><code></code>
<dd>Assembles the following section of code if the specified <var>symbol</var>
has been defined.
<br><dt><code>.ifc </code><var>string1</var><code>,</code><var>string2</var><code></code>
<dd>Assembles the following section of code if the two strings are the same. The
strings may be optionally quoted with single quotes. If they are not quoted,
the first string stops at the first comma, and the second string stops at the
end of the line. Strings which contain whitespace should be quoted. The
string comparison is case sensitive.
<br><dt><code>.ifeq </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is zero.
<br><dt><code>.ifeqs </code><var>string1</var><code>,</code><var>string2</var><code></code>
<dd>Another form of <code>.ifc</code>. The strings must be quoted using double quotes.
<br><dt><code>.ifge </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is greater than or
equal to zero.
<br><dt><code>.ifgt </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is greater than zero.
<br><dt><code>.ifle </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is less than or equal
to zero.
<br><dt><code>.iflt </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is less than zero.
<br><dt><code>.ifnc </code><var>string1</var><code>,</code><var>string2</var><code>.</code>
<dd>Like <code>.ifc</code>, but the sense of the test is reversed: this assembles the
following section of code if the two strings are not the same.
<br><dt><code>.ifndef </code><var>symbol</var><code></code>
<dd><dt><code>.ifnotdef </code><var>symbol</var><code></code>
<dd>Assembles the following section of code if the specified <var>symbol</var>
has not been defined. Both spelling variants are equivalent.
<br><dt><code>.ifne </code><var>absolute expression</var><code></code>
<dd>Assembles the following section of code if the argument is not equal to zero
(in other words, this is equivalent to <code>.if</code>).
<br><dt><code>.ifnes </code><var>string1</var><code>,</code><var>string2</var><code></code>
<dd>Like <code>.ifeqs</code>, but the sense of the test is reversed: this assembles the
following section of code if the two strings are not the same.
</dl>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -