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

📄 instructions2.doc8.html

📁 Java编程规范
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<blockquote><a name="69311"></a>Compare <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69310"></a> <i>lcmp</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lcmp.Forms"></a><p><b>Forms</b><br><blockquote><a name="69312"></a><i>lcmp</i> = 148 (0x94)</blockquote><p><a name="lcmp.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69313"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lcmp.Description"></a><p><b>Description</b><br><blockquote><a name="69314"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>long</code>. They are both popped from the operand stack, and a signed integer comparison is performed. If <i>value1</i> is greater than <i>value2</i>, the <code>int</code> value 1 is pushed onto the operand stack. If <i>value1</i> is equal to <i>value2</i>, the <code>int</code> value 0 is pushed onto the operand stack. If <i>value1</i> is less than <i>value2</i>, the <code>int</code> value -1 is pushed onto the operand stack.</blockquote><p><a name="lconst_l"></a><hr><h2>lconst_&lt;l&gt;</h2><a name="lconst_l.Operation"></a><p><b>Operation</b><br><blockquote><a name="69321"></a>Push <code>long</code> constant<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69320"></a> <i>lconst_&lt;l&gt;</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lconst_l.Forms"></a><p><b>Forms</b><br><blockquote><a name="69322"></a><i>lconst_0</i> = 9 (0x9) <i>lconst_1</i> = 10 (0xa)</blockquote><p><a name="lconst_l.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69323"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>&lt;l&gt;</i></blockquote><p><a name="lconst_l.Description"></a><p><b>Description</b><br><blockquote><a name="69324"></a>Push the <code>long</code> constant <i>&lt;l&gt;</i> (<i>0</i> or <i>1</i>) onto the operand stack. </blockquote><p><a name="ldc"></a><hr><h2>ldc</h2><a name="ldc.Operation"></a><p><b>Operation</b><br><blockquote><a name="69333"></a>Push item from runtime constant pool<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69330"></a> <i>ldc</i><td><a name="87568"></a> <tr><td><a name="69332"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ldc.Forms"></a><p><b>Forms</b><br><blockquote><a name="69334"></a><i>ldc</i><em> </em>= 18 (0x12)</blockquote><p><a name="ldc.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69335"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="ldc.Description"></a><p><b>Description</b><br><blockquote><a name="69336"></a>The <i>index</i> is an unsigned byte that must be a valid index into the runtime constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The runtime constant pool entry at <i>index</i> either must be a runtime constant of type <code>int</code> or <code>float</code>, or must be a symbolic reference to a string literal <a href="ConstantPool.doc.html#73272">(&#167;5.1)</a>.</blockquote><p><blockquote><a name="297204"></a>If the runtime constant pool entry is a runtime constant of type <code>int</code> or <code>float</code>, the numeric <i>value</i> of that runtime constant is pushed onto the operand stack as an <code>int</code> or <code>float</code>, respectively.</blockquote><p><blockquote><a name="415850"></a>Otherwise, the runtime constant pool entry must be a reference to an instance of class <code>String</code> representing a string literal <a href="ConstantPool.doc.html#73272">(&#167;5.1)</a>. A <code>reference</code> to that instance, <i>value</i>, is pushed onto the operand stack.</blockquote><p><a name="ldc.Notes"></a><p><b>Notes</b><br><blockquote><a name="415848"></a>The <i>ldc</i> instruction can only be used to push a value of type <code>float</code> taken from the float value set <a href="Overview.doc.html#28147">(&#167;3.3.2)</a> because a constant of type <code>float</code> in the constant pool <a href="ClassFile.doc.html#21942">(&#167;4.4.4)</a> must be taken from the float value set.</blockquote><p><a name="ldc_w"></a><hr><h2>ldc_w</h2><a name="ldc_w.Operation"></a><p><b>Operation</b><br><blockquote><a name="69366"></a>Push item from runtime constant pool (wide index)<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69361"></a> <i>ldc_w</i><td><a name="87568"></a> <tr><td><a name="69363"></a> <i>indexbyte1</i><td><a name="87568"></a> <tr><td><a name="69365"></a> <i>indexbyte2</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ldc_w.Forms"></a><p><b>Forms</b><br><blockquote><a name="69367"></a><i>ldc_w</i> = 19 (0x13)</blockquote><p><a name="ldc_w.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69368"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="ldc_w.Description"></a><p><b>Description</b><br><blockquote><a name="293060"></a>The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are assembled into an unsigned 16-bit index into the runtime constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where the value of the index is calculated as (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The index must be a valid index into the runtime constant pool of the current class. The runtime constant pool entry at the index either must be a runtime constant of type <code>int</code> or <code>float</code>, or must be a symbolic reference to a string literal <a href="ConstantPool.doc.html#73272">(&#167;5.1)</a>. </blockquote><p><blockquote><a name="415908"></a>If the runtime constant pool entry is a runtime constant of type <code>int</code> or <code>float</code>, the numeric <i>value</i> of that runtime constant is pushed onto the operand stack as an <code>int</code> or <code>float</code>, respectively.</blockquote><p><blockquote><a name="415909"></a>Otherwise, the runtime constant pool entry must be a reference to an instance of class <code>String</code> representing a string literal <a href="ConstantPool.doc.html#73272">(&#167;5.1)</a>. A <code>reference</code> to that instance, <i>value</i>, is pushed onto the operand stack.</blockquote><p><a name="ldc_w.Notes"></a><p><b>Notes</b><br><blockquote><a name="125478"></a>The <i>ldc_w</i> instruction is identical to the <i>ldc</i> instruction except for its wider runtime constant pool index.</blockquote><p><blockquote><a name="430868"></a>The <i>ldc_w</i> instruction can only be used to push a value of type <code>float</code> taken from the float value set <a href="Overview.doc.html#28147">(&#167;3.3.2)</a> because a constant of type <code>float</code> in the constant pool <a href="ClassFile.doc.html#21942">(&#167;4.4.4)</a> must be taken from the float value set.</blockquote><p><a name="ldc2_w"></a><hr><h2>ldc2_w</h2><a name="ldc2_w.Operation"></a><p><b>Operation</b><br><blockquote><a name="69403"></a>Push <code>long</code> or <code>double</code> from runtime constant pool (wide index)<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69398"></a> <i>ldc2_w</i><td><a name="87568"></a> <tr><td><a name="69400"></a> <i>indexbyte1</i><td><a name="87568"></a> <tr><td><a name="69402"></a> <i>indexbyte2</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ldc2_w.Forms"></a><p><b>Forms</b><br><blockquote><a name="69404"></a><i>ldc2_w</i> = 20 (0x14)</blockquote><p><a name="ldc2_w.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="349328"></a>... <img src="chars/arrwdbrt.gif"> ...,<em> </em><i>value</i></blockquote><p><a name="ldc2_w.Description"></a><p><b>Description</b><br><blockquote><a name="69406"></a>The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are assembled into an unsigned 16-bit index into the runtime constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where the value of the index is calculated as (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The index must be a valid index into the runtime constant pool of the current class. The runtime constant pool entry at the index must be a runtime constant of type <code>long</code> or <code>double</code> <a href="ConstantPool.doc.html#73272">(&#167;5.1)</a>. The numeric <i>value</i> of that runtime constant is pushed onto the operand stack as a <code>long</code> or <code>double</code>, respectively.</blockquote><p><a name="ldc2_w.Notes"></a><p><b>Notes</b><br><blockquote><a name="69419"></a>Only a wide-index version of the <i>ldc2_w</i> instruction exists; there is no <i>ldc2</i> instruction that pushes a <code>long</code> or <code>double</code> with a single-byte index.</blockquote><p><blockquote><a name="432235"></a>The <i>ldc2_w</i> instruction can only be used to push a value of type <code>double</code> taken from the double value set <a href="Overview.doc.html#28147">(&#167;3.3.2)</a> because a constant of type <code>double</code> in the constant pool <a href="ClassFile.doc.html#1348">(&#167;4.4.5)</a> must be taken from the double value set.</blockquote><p><blockquote><a name="432233"></a></blockquote><p><a name="ldiv"></a><hr><h2>ldiv</h2><a name="ldiv.Operation"></a><p><b>Operation</b><br><blockquote><a name="69429"></a>Divide <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69428"></a> <i>ldiv</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ldiv.Forms"></a><p><b>Forms</b><br><blockquote><a name="69430"></a><i>ldiv</i> = 109 (0x6d)</blockquote><p><a name="ldiv.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69431"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="ldiv.Description"></a><p><b>Description</b><br><blockquote><a name="69432"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>long</code>. The values are popped from the operand stack. The <code>long</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="69433"></a>A <code>long</code> division rounds towards 0; that is, the quotient produced for <code>long</code> values in <i>n </i>/ <i>d</i> is a <code>long</code> value <i>q</i> whose magnitude is as large as possible while satisfying <img src="Instructions2.doc.anc10.gif">. Moreover, <i>q </i>is positive when <img src="Instructions2.doc.anc11.gif"> and <i>n</i> and <i>d</i> have the same sign, but <i>q</i> is negative when <img src="Instructions2.doc.anc12.gif"> and <i>n</i> and <i>d </i>have opposite signs. </blockquote><p><blockquote><a name="69443"></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>long</code> type and the divisor is -<code>1</code>, 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="ldiv.Runtime"></a><p><b>Runtime Exception</b><br><blockquote><a name="69445"></a>If the value of the divisor in a <code>long</code> division is 0, <i>ldiv</i> throws an <code>ArithmeticException</code>.</blockquote><p><a name="lload"></a><hr><h2>lload</h2><a name="lload.Operation"></a><p><b>Operation</b><br><blockquote><a name="69454"></a>Load <code>long</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69451"></a> <i>lload</i><td><a name="87568"></a> <tr><td><a name="69453"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lload.Forms"></a><p><b>Forms</b><br><blockquote><a name="69455"></a><i>lload</i> = 22 (0x16)</blockquote><p><a name="lload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="349346"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="lload.Description"></a><p><b>Description</b><br><blockquote><a name="69457"></a>The <i>index</i> is an unsigned byte. Both <i>index</i> and <i>index </i>+ 1 must be indices into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The local variable at <i>index</i> must contain a <code>long</code>. The <i>value</i> of the local variable at <i>index</i> is pushed onto the operand stack. </blockquote><p><a name="lload.Notes"></a><p><b>Notes</b><br><blockquote><a name="69461"></a>The <i>lload</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.</blockquote><p><a name="lload_n"></a><hr><h2>lload_&lt;n&gt;</h2><a name="lload_n.Operation"></a><p><b>Operation</b><br>

⌨️ 快捷键说明

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