📄 instructions2.doc7.html
字号:
<td><a name="87568"></a>
</Table><br><br><p>
<a name="ifcond.Forms"></a>
<b>Forms</h3></b>
<a name="68571"></a>
<i>ifeq </i>= 153 (0x99)<i></i><p>
<a name="178006"></a>
<i>ifne</i> = 154 (0x9a)<i></i><p>
<a name="178008"></a>
<i>iflt</i> = 155 (0x9b)<i></i><p>
<a name="178010"></a>
<i>ifge</i> = 156 (0x9c)<i></i><p>
<a name="178012"></a>
<i>ifgt</i> = 157 (0x9d)<i></i><p>
<a name="178014"></a>
<i>ifle</i> = 158 (0x9e)<p>
<a name="ifcond.Stack"></a>
<b>Stack</h3></b>
<a name="68572"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="ifcond.Description"></a>
<b>Description</h3></b>
<a name="68573"></a>
The <i>value</i> must be of type <code>int</code>. It is popped from the operand stack and compared against zero. All comparisons are signed. The results of the comparisons are as follows:<p>
<ul><a name="68574"></a>
<li><i>eq</i> succeeds if and only if <i>value</i> = 0
<a name="68575"></a>
<li><i>ne</i> succeeds if and only if <i>value</i> <img src="chars/notequal.gif"> 0
<a name="68576"></a>
<li><i>lt</i> succeeds if and only if <i>value</i> < 0
<a name="68577"></a>
<li><i>le</i> succeeds if and only if <i>value</i> £ 0
<a name="68578"></a>
<li><i>gt</i> succeeds if and only if <i>value</i> > 0
<a name="68579"></a>
<li><i>ge</i> succeeds if and only if <i>value</i> <img src="chars/gtequal.gif"> 0
</ul>
If the comparison succeeds, <em>the unsigned</em> <i>branchbyte1</i> and <i>branchbyte2</i> are used to construct a signed 16-bit offset, where the offset is calculated to be (<i>branchbyte1</i> << 8) | <i>branchbyte2</i>. Execution then proceeds at that offset from the address of the opcode of this <i>if<cond></i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>if<cond></i> instruction.<p>
<a name="68581"></a>
Otherwise, execution proceeds at the address of the instruction following this <i>if<cond></i> instruction.<p>
<a name="ifnonnull"></a>
<hr><h2>ifnonnull</h2>
<a name="ifnonnull.Operation"></a>
<b>Operation</h3></b>
<a name="68592"></a>
Branch if <code>reference</code> not <code>null</code><p><Table Border="1">
<tr><td><a name="68587"></a>
<i>ifnonnull</i>
<td><a name="87568"></a>
<tr><td><a name="68589"></a>
<i>branchbyte1</i>
<td><a name="87568"></a>
<tr><td><a name="68591"></a>
<i>branchbyte2</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="ifnonnull.Forms"></a>
<b>Forms</h3></b>
<a name="68593"></a>
<i>ifnonnull</i> = 199 (0xc7)<p>
<a name="ifnonnull.Stack"></a>
<b>Stack</h3></b>
<a name="68594"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="ifnonnull.Description"></a>
<b>Description</h3></b>
<a name="68595"></a>
The <i>value</i> must of type <code>reference</code>. It is popped from the oper-and stack. If <i>value</i> is not <code>null</code>, <em>the unsigned</em> <i>branchbyte1</i> and <i>branchbyte2</i> are used to construct a signed 16-bit offset, where the offset is calculated to be (<i>branchbyte1</i> << 8) | <i>branchbyte2</i>. Execution then proceeds at that offset from the address of the opcode of this <i>ifnonnull</i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>ifnonnull</i> instruction.<p>
<a name="68596"></a>
Otherwise, execution proceeds at the address of the instruction following this <i>ifnonnull</i> instruction.<p>
<a name="ifnull"></a>
<hr><h2>ifnull</h2>
<a name="ifnull.Operation"></a>
<b>Operation</h3></b>
<a name="68607"></a>
Branch if <code>reference</code> is <code>null</code><p><Table Border="1">
<tr><td><a name="68602"></a>
<i>ifnull</i>
<td><a name="87568"></a>
<tr><td><a name="68604"></a>
<i>branchbyte1</i>
<td><a name="87568"></a>
<tr><td><a name="68606"></a>
<i>branchbyte2</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="ifnull.Forms"></a>
<b>Forms</h3></b>
<a name="68608"></a>
<i>ifnull</i> = 198 (0xc6)<p>
<a name="ifnull.Stack"></a>
<b>Stack</h3></b>
<a name="68609"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="ifnull.Description"></a>
<b>Description</h3></b>
<a name="68610"></a>
The <i>value</i> must of type <code>reference</code>. It is popped from the operand stack. If <i>value</i> is <code>null</code>, <em>the unsigned</em> <i>branchbyte1</i> and <i>branchbyte2</i> are used to construct a signed 16-bit offset, where the offset is calculated to be (<i>branchbyte1</i> << 8) | <i>branchbyte2</i>. Execution then proceeds at that offset from the address of the opcode of this <i>ifnull</i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>ifnull</i> instruction.<p>
<a name="68611"></a>
Otherwise, execution proceeds at the address of the instruction following this <i>ifnull</i> instruction.<p>
<a name="iinc"></a>
<hr><h2>iinc</h2>
<a name="iinc.Operation"></a>
<b>Operation</h3></b>
<a name="68622"></a>
Increment local variable by constant<p><Table Border="1">
<tr><td><a name="68617"></a>
<i>iinc</i>
<td><a name="87568"></a>
<tr><td><a name="68619"></a>
<i>index</i>
<td><a name="87568"></a>
<tr><td><a name="68621"></a>
<i>const</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="iinc.Forms"></a>
<b>Forms</h3></b>
<a name="68623"></a>
<i>iinc</i> = 132 (0x84)<p>
<a name="iinc.Stack"></a>
<b>Stack</h3></b>
<a name="68624"></a>
No change<p>
<a name="iinc.Description"></a>
<b>Description</h3></b>
<a name="68625"></a>
The <i>index</i> is an unsigned byte that must be a valid index into the local variables of the current frame <a href="Overview.doc.html#17257">(§3.6)</a>. The <i>const</i> is a immediate signed byte. The local variable at <i>index</i> must contain an <code>int</code>. The value <i>const</i> is first sign-extended to an <code>int</code>, then the local variable at <i>index</i> is incremented by that amount.<p>
<a name="iinc.Notes"></a>
<b>Notes</h3></b>
<a name="68629"></a>
The <i>iinc</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index and increment it by a two-byte immediate value.<p>
<a name="68630"></a>
<p>
<a name="iload"></a>
<hr><h2>iload</h2>
<a name="iload.Operation"></a>
<b>Operation</h3></b>
<a name="68639"></a>
Load <code>int</code> from local variable<p><Table Border="1">
<tr><td><a name="68636"></a>
<i>iload</i>
<td><a name="87568"></a>
<tr><td><a name="68638"></a>
<i>index</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="iload.Forms"></a>
<b>Forms</h3></b>
<a name="68640"></a>
<i>iload</i> = 21 (0x15)<p>
<a name="iload.Stack"></a>
<b>Stack</h3></b>
<a name="68641"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>value</i><p>
<a name="iload.Description"></a>
<b>Description</h3></b>
<a name="68642"></a>
The <i>index</i> is an unsigned byte that must be a valid index into the local variables of the current frame <a href="Overview.doc.html#17257">(§3.6)</a>. The local variable at <i>index</i> must contain an <code>int</code>. The <i>value</i> of the local variable at <i>index </i>is pushed onto the operand stack.<p>
<a name="iload.Notes"></a>
<b>Notes</h3></b>
<a name="68646"></a>
The <i>iload</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.<p>
<a name="iload_n"></a>
<hr><h2>iload_<n></h2>
<a name="iload_n.Operation"></a>
<b>Operation</h3></b>
<a name="68656"></a>
Load <code>int</code> from local variable<p><Table Border="1">
<tr><td><a name="68655"></a>
<i>iload_<n></i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="iload_n.Forms"></a>
<b>Forms</h3></b>
<a name="68657"></a>
<i>iload_0</i> = 26 (0x1a)<i></i><p>
<a name="178016"></a>
<i>iload_1</i> = 27 (0x1b)<i></i><p>
<a name="178018"></a>
<i>iload_2</i> = 28 (0x1c)<i></i><p>
<a name="178020"></a>
<i>iload_3</i> = 29 (0x1d)<p>
<a name="iload_n.Stack"></a>
<b>Stack</h3></b>
<a name="68658"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>value</i><p>
<a name="iload_n.Description"></a>
<b>Description</h3></b>
<a name="68659"></a>
The <i><n></i> must be a valid index into the local variables of the current frame <a href="Overview.doc.html#17257">(§3.6)</a>. The local variable at <i><n></i> must contain an <code>int</code>. The <i>value</i> of the local variable at <i><n></i> is pushed onto the operand stack.<p>
<a name="iload_n.Notes"></a>
<b>Notes</h3></b>
<a name="68663"></a>
Each of the <i>iload_<n></i> instructions is the same as <i>iload</i> with an <i>index</i> of <i><n></i>, except that the operand <i><n></i> is implicit.<p>
<a name="imul"></a>
<hr><h2>imul</h2>
<a name="imul.Operation"></a>
<b>Operation</h3></b>
<a name="68676"></a>
Multiply <code>int</code><p><Table Border="1">
<tr><td><a name="68675"></a>
<i>imul</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="imul.Forms"></a>
<b>Forms</h3></b>
<a name="68677"></a>
<i>imul</i> = 104 (0x68)<p>
<a name="imul.Stack"></a>
<b>Stack</h3></b>
<a name="68678"></a>
..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="imul.Description"></a>
<b>Description</h3></b>
<a name="68679"></a>
Both <i>value1</i> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. The <code>int</code> <i>result</i> is <i>value1</i> * <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="68680"></a>
If an <code>int</code> multiplication overflows, then the result is the low-order bits of the mathematical product as an <code>int</code>. If overflow occurs, then the sign of the result may not be the same as the sign of the mathematical product of the two values.<p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -