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

📄 instructions2.doc7.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 <i>iand</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="iand.Forms"></a>
<b>Forms</h3></b>
<a name="68455"></a>
<i>iand</i> = 126 (0x7e)<p>
<a name="iand.Stack"></a>
<b>Stack</h3></b>
<a name="68456"></a>
..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="iand.Description"></a>
<b>Description</h3></b>
<a name="68457"></a>
Both <i>value1</i> and <i>value2</i> must be of type <code>int</code>. They are popped from the operand stack. An <code>int</code> <i>result</i> is calculated by taking the bitwise AND (conjunction) of <i>value1</i> and <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>

<a name="iastore"></a>
<hr><h2>iastore</h2>
<a name="iastore.Operation"></a>
<b>Operation</h3></b>
<a name="68470"></a>
Store into <code>int</code> array<p><Table Border="1">
<tr><td><a name="68469"></a>
 <i>iastore</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="iastore.Forms"></a>
<b>Forms</h3></b>
<a name="68471"></a>
<i>iastore</i> = 79 (0x4f)<p>
<a name="iastore.Stack"></a>
<b>Stack</h3></b>
<a name="68472"></a>
..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="iastore.Description"></a>
<b>Description</h3></b>
<a name="68473"></a>
The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>int</code>. Both <i>index</i> and <i>value</i> must be of type <code>int</code>. The <i>arrayref</i>, <i>index</i>, and <i>value</i> are popped from the operand stack. The <code>int</code> <i>value</i> is stored as the component of the array indexed by <i>index</i>. <p>
<a name="iastore.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="68475"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>iastore</i> throws a <code>NullPointerException</code>. <p>
<a name="68476"></a>
Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>iastore</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.<p>

<a name="iconst_i"></a>
<hr><h2>iconst_&lt;i&gt;</h2>
<a name="iconst_i.Operation"></a>
<b>Operation</h3></b>
<a name="68483"></a>
Push <code>int</code> constant<p><Table Border="1">
<tr><td><a name="68482"></a>
 <i>iconst_&lt;i&gt;</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="iconst_i.Forms"></a>
<b>Forms</h3></b>
<a name="68484"></a>
<i>iconst_m1</i> = 2 (0x2)<i></i><p>
<a name="177980"></a>
<i>iconst_0</i> = 3 (0x3)<i></i><p>
<a name="177982"></a>
<i>iconst_1</i> = 4 (0x4)<i></i><p>
<a name="177984"></a>
<i>iconst_2</i> = 5 (0x5)<i></i><p>
<a name="177986"></a>
<i>iconst_3</i> = 6 (0x6)<i></i><p>
<a name="177988"></a>
<i>iconst_4</i> = 7 (0x7)<i></i><p>
<a name="177990"></a>
<i>iconst_5</i> = 8 (0x8)<p>
<a name="iconst_i.Stack"></a>
<b>Stack</h3></b>
<a name="68485"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>&lt;i&gt;</i><p>
<a name="iconst_i.Description"></a>
<b>Description</h3></b>
<a name="68486"></a>
Push the <code>int</code> constant <i>&lt;i&gt;</i> (-<i>1</i>, <i>0</i>, <i>1</i>, <i>2</i>, <i>3</i>, <i>4</i> or <i>5</i>) onto the operand stack. <p>
<a name="iconst_i.Notes"></a>
<b>Notes</h3></b>
<a name="68487"></a>
Each of this family of instructions is equivalent to <i>bipush</i> <i>&lt;i&gt;</i> for the respective value of <i>&lt;i&gt;</i>, except that the operand <i>&lt;i&gt;</i> is implicit.<p>

<a name="idiv"></a>
<hr><h2>idiv</h2>
<a name="idiv.Operation"></a>
<b>Operation</h3></b>
<a name="68497"></a>
Divide <code>int</code><p><Table Border="1">
<tr><td><a name="68496"></a>
 <i>idiv</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="idiv.Forms"></a>
<b>Forms</h3></b>
<a name="68498"></a>
<i>idiv</i> = 108 (0x6c)<p>
<a name="idiv.Stack"></a>
<b>Stack</h3></b>
<a name="68499"></a>
..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="idiv.Description"></a>
<b>Description</h3></b>
<a name="68500"></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 the value of the Java expression <i>value1</i> / <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="68501"></a>
An <code>int</code> division rounds towards 0; that is, the quotient produced for <code>int</code> values in <i>n</i>/<i>d</i> is an <code>int</code> value <i>q</i> whose magnitude is as large as possible while satisfying <br><br><img src="Instructions2.doc.anc6.gif">
<br><br>. Moreover, <i>q </i>is positive when <br><br><img src="Instructions2.doc.anc7.gif">
<br><br> and <i>n</i> and <i>d</i> have the same sign, but <i>q</i> is negative when <br><br><img src="Instructions2.doc.anc8.gif">
<br><br> and <i>n</i> and <i>d </i>have opposite signs. <p>
<a name="68511"></a>
There is one special case that does not satisfy this rule: if the dividend is the negative integer of largest possible magnitude for the <code>int</code> type, and the divisor is -<i>1</i>, then overflow occurs, and the result is equal to the dividend. Despite the overflow, no exception is thrown in this case. <p>
<a name="idiv.Runtime"></a>
<b>Runtime</h3></b>
<a name="idiv.Exception"></a>
<b>Exception</h3></b>
<a name="68513"></a>
If the value of the divisor in an <code>int</code> division is 0, <i>idiv</i> throws an <code>ArithmeticException</code>.<p>

<a name="if_acmpcond"></a>
<hr><h2>if_acmp&lt;cond&gt;</h2>
<a name="if_acmpcond.Operation"></a>
<b>Operation</h3></b>
<a name="68524"></a>
Branch if <code>reference</code> comparison succeeds<p><Table Border="1">
<tr><td><a name="68519"></a>
 <i>if_acmp&lt;cond&gt;</i>
<td><a name="87568"></a>
 

<tr><td><a name="68521"></a>
 <i>branchbyte1</i>
<td><a name="87568"></a>
 

<tr><td><a name="68523"></a>
 <i>branchbyte2</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="if_acmpcond.Forms"></a>
<b>Forms</h3></b>
<a name="68525"></a>
<i>if_acmpeq</i> = 165 (0xa5)<i></i><p>
<a name="177994"></a>
<i>if_acmpne</i> = 166 (0xa6)<p>
<a name="if_acmpcond.Stack"></a>
<b>Stack</h3></b>
<a name="68526"></a>
..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="if_acmpcond.Description"></a>
<b>Description</h3></b>
<a name="68527"></a>
Both <i>value1</i> and <i>value2</i> must be of type <code>reference</code>. They are both popped from the operand stack and compared. The results of the comparison are as follows:<p>
<ul><a name="68528"></a>
<li><i>eq</i> 	succeeds if and only if <i>value1</i> = <i>value2</i>
<a name="68529"></a>
<li><i>ne</i> 	succeeds if and only if <i>value1</i> <img src="chars/notequal.gif"> <i>value2</i>
</ul><a name="68530"></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_acmp&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_acmp&lt;cond&gt;</i> instruction.<p>
<a name="68531"></a>
Otherwise, if the comparison fails, execution proceeds at the address of the instruction following this <i>if_acmp&lt;cond&gt;</i> instruction.<p>

<a name="if_icmpcond"></a>
<hr><h2>if_icmp&lt;cond&gt;</h2>
<a name="if_icmpcond.Operation"></a>
<b>Operation</h3></b>
<a name="68548"></a>
Branch if <code>int</code> comparison succeeds<p><Table Border="1">
<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><br><p>
<a name="if_icmpcond.Forms"></a>
<b>Forms</h3></b>
<a name="166925"></a>
<i>if_icmpeq</i>	=	159 (0x9f)<i></i><p>
<a name="177996"></a>
<i>if_icmpne</i>	=	160 (0xa0)<i></i><p>
<a name="177998"></a>
<i>if_icmplt</i> 	= 	161 (0xa1)<i></i><p>
<a name="178000"></a>
<i>if_icmpge</i>	=	162 (0xa2)<i></i><p>
<a name="178002"></a>
<i>if_icmpgt</i>	=	163 (0xa3)<i></i><p>
<a name="178004"></a>
<i>if_icmple</i>	=	164 (0xa4)<p>
<a name="if_icmpcond.Stack"></a>
<b>Stack</h3></b>
<a name="68550"></a>
..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="if_icmpcond.Description"></a>
<b>Description</h3></b>
<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:<p>
<ul><a name="68552"></a>
<li><i>eq</i> 	succeeds if and only if <i>value1</i> = <i>value2</i>
<a name="68553"></a>
<li><i>ne</i> 	succeeds if and only if <i>value1</i> <img src="chars/notequal.gif"> <i>value2</i>
<a name="68554"></a>
<li><i>lt </i>	succeeds if and only if <i>value1</i> < <i>value2</i>
<a name="68555"></a>
<li><i>le</i> 	succeeds if and only if <i>value1</i> &#163; <i>value2</i>
<a name="68556"></a>
<li><i>gt</i> 	succeeds if and only if <i>value1</i> > <i>value2</i>
<a name="68557"></a>
<li><i>ge</i> 	succeeds if and only if <i>value1</i> <img src="chars/gtequal.gif"> <i>value2</i>
</ul>
<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.<p>
<a name="68559"></a>
Otherwise, execution proceeds at the address of the instruction following this <i>if_icmp&lt;cond&gt;</i> instruction. <p>

<a name="ifcond"></a>
<hr><h2>if&lt;cond&gt;</h2>
<a name="ifcond.Operation"></a>
<b>Operation</h3></b>
<a name="68570"></a>
Branch if <code>int</code> comparison with zero succeeds<p><Table Border="1">
<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>

⌨️ 快捷键说明

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