⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructions2.doc6.html

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<i></i>Branch if <code>int</code> comparison succeeds<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68543"></a> <i>if_icmp&lt;cond&gt;</i><td><a name="87568"></a> <tr><td><a name="68545"></a> <i>branchbyte1</i><td><a name="87568"></a> <tr><td><a name="68547"></a> <i>branchbyte2</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="if_icmpcond.Forms"></a><p><b>Forms</b><br><blockquote><a name="166925"></a><i>if_icmpeq</i>	=	159 (0x9f) <i>if_icmpne</i>	=	160 (0xa0) <i>if_icmplt</i> 	= 	161 (0xa1) <i>if_icmpge</i>	=	162 (0xa2) <i>if_icmpgt</i>	=	163 (0xa3) <i>if_icmple</i>	=	164 (0xa4)</blockquote><p><a name="if_icmpcond.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68550"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="if_icmpcond.Description"></a><p><b>Description</b><br><blockquote><a name="68551"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>int</code>. They are both popped from the operand stack and compared. All comparisons are signed. The results of the comparison are as follows:</blockquote><p><ul><li><i>eq</i> 	succeeds if and only if <i>value1</i> = <i>value2</i><li><i>ne</i> 	succeeds if and only if <i>value1</i> <img src="chars/notequal.gif"> <i>value2</i><li><i>lt </i>	succeeds if and only if <i>value1</i> < <i>value2</i><li><i>le</i> 	succeeds if and only if <i>value1</i> <img src="chars/lt_equal.gif"> <i>value2</i><li><i>gt</i> 	succeeds if and only if <i>value1</i> > <i>value2</i><li><i>ge</i> 	succeeds if and only if <i>value1</i> <img src="chars/gtequal.gif"> <i>value2</i></ul><blockquote><a name="68558"></a>If <em>the comparison succeeds, 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_icmp&lt;cond&gt;</i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>if_icmp&lt;cond&gt;</i> instruction.</blockquote><p><blockquote><a name="68559"></a>Otherwise, execution proceeds at the address of the instruction following this <i>if_icmp&lt;cond&gt;</i> instruction. </blockquote><p><a name="ifcond"></a><hr><h2>if&lt;cond&gt;</h2><a name="ifcond.Operation"></a><p><b>Operation</b><br><blockquote><a name="68570"></a>Branch if <i></i><code>int</code> comparison with zero succeeds<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68565"></a> <i>if&lt;cond&gt;</i><td><a name="87568"></a> <tr><td><a name="68567"></a> <i>branchbyte1</i><td><a name="87568"></a> <tr><td><a name="68569"></a> <i>branchbyte2</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ifcond.Forms"></a><p><b>Forms</b><br><blockquote><a name="68571"></a><i>ifeq	</i>=	153 (0x99) <i>ifne</i>	=	154 (0x9a) <i>iflt</i>	=	155 (0x9b) <i>ifge</i>	=	156 (0x9c) <i>ifgt</i>	=	157 (0x9d) <i>ifle</i>	=	158 (0x9e)</blockquote><p><a name="ifcond.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68572"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="ifcond.Description"></a><p><b>Description</b><br><blockquote><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:</blockquote><p><ul><li><i>eq</i> 	succeeds if and only if <i>value</i> = 0<li><i>ne</i> 	succeeds if and only if <i>value</i> <img src="chars/notequal.gif"> 0<li><i>lt</i> 	succeeds if and only if <i>value</i> < 0<li><i>le</i> 	succeeds if and only if <i>value</i> <img src="chars/lt_equal.gif"> 0<li><i>gt</i> 	succeeds if and only if <i>value</i> > 0<li><i>ge</i> 	succeeds if and only if <i>value</i> <img src="chars/gtequal.gif"> 0</ul><blockquote><a name="68580"></a>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&lt;cond&gt;</i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>if&lt;cond&gt;</i> instruction.</blockquote><p><blockquote><a name="68581"></a>Otherwise, execution proceeds at the address of the instruction following this <i>if&lt;cond&gt;</i> instruction.</blockquote><p><a name="ifnonnull"></a><hr><h2>ifnonnull</h2><a name="ifnonnull.Operation"></a><p><b>Operation</b><br><blockquote><a name="68592"></a>Branch if <code>reference</code> not <code>null</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><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></blockquote><p><a name="ifnonnull.Forms"></a><p><b>Forms</b><br><blockquote><a name="68593"></a><i>ifnonnull</i> = 199 (0xc7)</blockquote><p><a name="ifnonnull.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68594"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="ifnonnull.Description"></a><p><b>Description</b><br><blockquote><a name="504905"></a>The <i>value</i> must be of type <code>reference</code>. It is popped from the operand 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.</blockquote><p><blockquote><a name="68596"></a>Otherwise, execution proceeds at the address of the instruction following this <i>ifnonnull</i> instruction.</blockquote><p><a name="ifnull"></a><hr><h2>ifnull</h2><a name="ifnull.Operation"></a><p><b>Operation</b><br><blockquote><a name="68607"></a>Branch if <code>reference</code> is <code>null</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><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></blockquote><p><a name="ifnull.Forms"></a><p><b>Forms</b><br><blockquote><a name="68608"></a><i>ifnull</i> = 198 (0xc6)</blockquote><p><a name="ifnull.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68609"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="ifnull.Description"></a><p><b>Description</b><br><blockquote><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.</blockquote><p><blockquote><a name="68611"></a>Otherwise, execution proceeds at the address of the instruction following this <i>ifnull</i> instruction.</blockquote><p><a name="iinc"></a><hr><h2>iinc</h2><a name="iinc.Operation"></a><p><b>Operation</b><br><blockquote><a name="68622"></a>Increment local variable by constant<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><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></blockquote><p><a name="iinc.Forms"></a><p><b>Forms</b><br><blockquote><a name="68623"></a><i>iinc</i> = 132 (0x84)</blockquote><p><a name="iinc.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68624"></a>No change</blockquote><p><a name="iinc.Description"></a><p><b>Description</b><br><blockquote><a name="68625"></a>The <i>index</i> is an unsigned byte that must be an index into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The <i>const</i> is an 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>, and then the local variable at <i>index</i> is incremented by that amount.</blockquote><p><a name="iinc.Notes"></a><p><b>Notes</b><br><blockquote><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 to increment it by a two-byte immediate value.</blockquote><p><blockquote><a name="68630"></a></blockquote><p><a name="iload"></a><hr><h2>iload</h2><a name="iload.Operation"></a><p><b>Operation</b><br><blockquote><a name="339438"></a>Load <code>int</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="339431"></a> <i>iload</i><td><a name="339433"></a> <tr><td><a name="339435"></a> <i>index</i><td><a name="339437"></a> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -