📄 instructions2.doc6.html
字号:
<td><a name="87568"></a> </Table><br></blockquote><p><a name="iadd.Forms"></a><p><b>Forms</b><br><blockquote><a name="68422"></a><i>iadd</i> = 96 (0x60)</blockquote><p><a name="iadd.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68423"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="iadd.Description"></a><p><b>Description</b><br><blockquote><a name="68424"></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. </blockquote><p><blockquote><a name="68425"></a>The result is the 32 low-order bits of the true mathematical result in a sufficiently wide two's-complement format, represented as a value of type <code>int</code>. If overflow occurs, then the sign of the result may not be the same as the sign of the mathematical sum of the two values.</blockquote><p><blockquote><a name="448552"></a>Despite the fact that overflow may occur, execution of an <i>iadd</i> instruction never throws a runtime exception.</blockquote><p><a name="iaload"></a><hr><h2>iaload</h2><a name="iaload.Operation"></a><p><b>Operation</b><br><blockquote><a name="68438"></a>Load <code>int</code> from array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68437"></a> <i>iaload</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="iaload.Forms"></a><p><b>Forms</b><br><blockquote><a name="68439"></a><i>iaload</i> = 46 (0x2e)</blockquote><p><a name="iaload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68440"></a>..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="iaload.Description"></a><p><b>Description</b><br><blockquote><a name="68441"></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>. The <i>index</i> must be of type <code>int</code>. Both <i>arrayref</i> and <i>index</i> are popped from the operand stack. The <code>int</code> <i>value</i> in the component of the array at <i>index</i> is retrieved and pushed onto the operand stack.</blockquote><p><a name="iaload.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="68443"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>iaload</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="68444"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>iaload</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><a name="iand"></a><hr><h2>iand</h2><a name="iand.Operation"></a><p><b>Operation</b><br><blockquote><a name="68454"></a>Boolean AND <code>int</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68453"></a> <i>iand</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="iand.Forms"></a><p><b>Forms</b><br><blockquote><a name="68455"></a><i>iand</i> = 126 (0x7e)</blockquote><p><a name="iand.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68456"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="iand.Description"></a><p><b>Description</b><br><blockquote><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.</blockquote><p><a name="iastore"></a><hr><h2>iastore</h2><a name="iastore.Operation"></a><p><b>Operation</b><br><blockquote><a name="68470"></a>Store into <code>int</code> array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68469"></a> <i>iastore</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="iastore.Forms"></a><p><b>Forms</b><br><blockquote><a name="68471"></a><i>iastore</i> = 79 (0x4f)</blockquote><p><a name="iastore.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68472"></a>..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="iastore.Description"></a><p><b>Description</b><br><blockquote><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>. </blockquote><p><a name="iastore.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="68475"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>iastore</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><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>.</blockquote><p><a name="iconst_i"></a><hr><h2>iconst_<i></h2><a name="iconst_i.Operation"></a><p><b>Operation</b><br><blockquote><a name="68483"></a>Push <code>int</code> constant<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68482"></a> <i>iconst_<i></i><td><a name="87568"></a> </Table><br></blockquote><p><a name="iconst_i.Forms"></a><p><b>Forms</b><br><blockquote><a name="68484"></a><i>iconst_m1</i> = 2 (0x2) <i>iconst_0</i> = 3 (0x3) <i>iconst_1</i> = 4 (0x4) <i>iconst_2</i> = 5 (0x5) <i>iconst_3</i> = 6 (0x6) <i>iconst_4</i> = 7 (0x7) <i>iconst_5</i> = 8 (0x8)</blockquote><p><a name="iconst_i.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68485"></a>... <img src="chars/arrwdbrt.gif"> ..., <i><i></i></blockquote><p><a name="iconst_i.Description"></a><p><b>Description</b><br><blockquote><a name="68486"></a>Push the <code>int</code> constant <i><i></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. </blockquote><p><a name="iconst_i.Notes"></a><p><b>Notes</b><br><blockquote><a name="68487"></a>Each of this family of instructions is equivalent to <i>bipush</i> <i><i></i> for the respective value of <i><i></i>, except that the operand <i><i></i> is implicit.</blockquote><p><a name="idiv"></a><hr><h2>idiv</h2><a name="idiv.Operation"></a><p><b>Operation</b><br><blockquote><a name="68497"></a>Divide <code>int</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68496"></a> <i>idiv</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="idiv.Forms"></a><p><b>Forms</b><br><blockquote><a name="68498"></a><i>idiv</i> = 108 (0x6c)</blockquote><p><a name="idiv.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68499"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="idiv.Description"></a><p><b>Description</b><br><blockquote><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 programming language expression <i>value1</i> / <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><blockquote><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 <img src="Instructions2.doc.anc6.gif">. Moreover, <i>q </i>is positive when <img src="Instructions2.doc.anc7.gif"> and <i>n</i> and <i>d</i> have the same sign, but <i>q</i> is negative when <img src="Instructions2.doc.anc8.gif">and <i>n</i> and <i>d </i>have opposite signs. </blockquote><p><blockquote><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. </blockquote><p><a name="idiv.Runtime"></a><p><b>Runtime Exception</b><br><blockquote><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>.</blockquote><p><a name="if_acmpcond"></a><hr><h2>if_acmp<cond></h2><a name="if_acmpcond.Operation"></a><p><b>Operation</b><br><blockquote><a name="339213"></a> Branch if <code>reference</code> comparison succeeds<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="339202"></a> <i>if_acmp<cond></i><td><a name="339204"></a> <tr><td><a name="339206"></a> <i>branchbyte1</i><td><a name="339208"></a> <tr><td><a name="339210"></a> <i>branchbyte2</i><td><a name="339212"></a> </Table><br></blockquote><p><a name="if_acmpcond.Forms"></a><p><b>Forms</b><br><blockquote><a name="68525"></a><i>if_acmpeq</i> = 165 (0xa5) <i>if_acmpne</i> = 166 (0xa6)</blockquote><p><a name="if_acmpcond.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68526"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="if_acmpcond.Description"></a><p><b>Description</b><br><blockquote><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:</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></ul><blockquote><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<cond></i> instruction. The target address must be that of an opcode of an instruction within the method that contains this <i>if_acmp<cond></i> instruction.</blockquote><p><blockquote><a name="68531"></a>Otherwise, if the comparison fails, execution proceeds at the address of the instruction following this <i>if_acmp<cond></i> instruction.</blockquote><p><a name="if_icmpcond"></a><hr><h2>if_icmp<cond></h2><a name="if_icmpcond.Operation"></a><p><b>Operation</b><br><blockquote><a name="68548"></a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -