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

📄 instructions2.doc3.html

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<a name="dneg"></a><hr><h2>dneg</h2><a name="dneg.Operation"></a><p><b>Operation</b><br><blockquote><a name="67661"></a>Negate <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67660"></a> <i>dneg</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="dneg.Forms"></a><p><b>Forms</b><br><blockquote><a name="67662"></a><i>dneg</i> = 119 (0x77)</blockquote><p><a name="dneg.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67663"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="dneg.Description"></a><p><b>Description</b><br><blockquote><a name="67664"></a>The <i>value</i> must be of type <code>double</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. The <code>double</code> <i>result</i> is the arithmetic negation of <i>value'</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><blockquote><a name="67665"></a>For <code>double</code> values, negation is not the same as subtraction from zero. If <code>x</code> is +<code>0.0</code>, then <code>0.0</code>-<code>x</code> equals +<code>0.0</code>, but -<code>x</code> equals -<code>0.0</code>. Unary minus merely inverts the sign of a <code>double</code>. </blockquote><p><blockquote><a name="67666"></a>Special cases of interest:</blockquote><p><ul><li>If the operand is NaN, the result is NaN (recall that NaN has no sign).<p><li>If the operand is an infinity, the result is the infinity of opposite sign.<p><li>If the operand is a zero, the result is the zero of opposite sign.</ul><a name="drem"></a><hr><h2>drem</h2><a name="drem.Operation"></a><p><b>Operation</b><br><blockquote><a name="67676"></a>Remainder <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67675"></a> <i>drem</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="drem.Forms"></a><p><b>Forms</b><br><blockquote><a name="67677"></a><i>drem</i><em> </em>= 115 (0x73)</blockquote><p><a name="drem.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67678"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="drem.Description"></a><p><b>Description</b><br><blockquote><a name="67679"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>double</code>. The values are popped from the operand stack and undergo value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value1'</i> and <i>value2'</i>. The <i>result</i> is calculated and pushed onto the operand stack as a <code>double</code>.</blockquote><p><blockquote><a name="67680"></a>The result of a <i>drem</i> instruction is not the same as that of the so-called remainder operation defined by IEEE 754. The IEEE 754 "remainder" operation computes the remainder from a rounding division, not a truncating division, and so its behavior is <i>not</i> analogous to that of the usual integer remainder operator. Instead, the Java virtual machine defines <i>drem</i> to behave in a manner analogous to that of the Java virtual machine integer remainder instructions (<i>irem</i> and <i>lrem</i>); this may be compared with the C library function <code>fmod</code>.</blockquote><p><blockquote><a name="427340"></a>The result of a <i>drem</i> instruction is governed by these rules:</blockquote><p><ul><li>If either <i>value1'</i> or <i>value2'</i> is NaN, the result is NaN.<p><li>If neither <i>value1'</i> nor <i>value2'</i> is NaN, the sign of the result equals the sign of the dividend.<p><li>If the dividend is an infinity or the divisor is a zero or both, the result is NaN.<p><li>If the dividend is finite and the divisor is an infinity, the result equals the dividend.<p><li>If the dividend is a zero and the divisor is finite, the result equals the dividend.<p><li>In the remaining cases, where neither operand is an infinity, a zero, or NaN, the floating-point remainder <i>result</i> from a dividend <i>value1'</i> and a divisor <i>value2'</i> is defined by the mathematical  relation <i>result </i>=<i> value1' </i>-<i> </i>(<i>value2' </i>*<i> q</i>), where <i>q</i> is an integer that is negative only if <i>value1' </i>/<i> value2'</i> is negative, and positive only if <i>value1' </i>/<i> value2' </i>is positive, and whose magnitude is as large  as possible without exceeding the magnitude of the true mathematical quotient of <i>value1'</i> and <i>value2'</i>.</ul><blockquote><a name="67700"></a>Despite the fact that division by zero may occur, evaluation of a <i>drem</i> instruction never throws a runtime exception. Overflow, underflow, or loss of precision cannot occur.</blockquote><p><a name="drem.Notes"></a><p><b>Notes</b><br><blockquote><a name="67701"></a>The IEEE 754 remainder operation may be computed by the library routine <code>Math.IEEEremainder</code>.</blockquote><p><a name="dreturn"></a><hr><h2>dreturn</h2><a name="dreturn.Operation"></a><p><b>Operation</b><br><blockquote><a name="67717"></a>Return <code>double</code> from method<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67716"></a> <i>dreturn</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="dreturn.Forms"></a><p><b>Forms</b><br><blockquote><a name="67718"></a><i>dreturn</i> = 175 (0xaf)</blockquote><p><a name="dreturn.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67719"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif">  [empty]</blockquote><p><a name="dreturn.Description"></a><p><b>Description</b><br><blockquote><a name="452734"></a>The current method must have return type <code>double</code>. The <i>value</i> must be of type <code>double</code>. If the current method is a <code>synchronized</code> method, the monitor acquired or reentered on invocation of the method is released or exited (respectively) as if by execution of a <i>monitorexit</i> instruction. If no exception is thrown, <i>value</i> is popped from the operand stack of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a> and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. The <i>value'</i> is pushed onto the operand stack of the frame of the invoker. Any other values on the operand stack of the current method are discarded.</blockquote><p><blockquote><a name="67724"></a>The interpreter then returns control to the invoker of the method, reinstating the frame of the invoker.</blockquote><p><a name="dreturn.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="250706"></a>If the current method is a <code>synchronized</code> method and the current thread is not the owner of the monitor acquired or reentered on invocation of the method, <i>dreturn</i> throws an <code>IllegalMonitorStateException</code>. This can happen, for example, if a <code>synchronized</code> method contains a <i>monitorexit</i> instruction, but no <i>monitorenter</i> instruction, on the object on which the method is synchronized.</blockquote><p><blockquote><a name="250707"></a>Otherwise, if the virtual machine implementation enforces the rules on structured use of locks described in <a href="Threads.doc.html#22500">&#167;8.13</a> and if the first of those rules is violated during invocation of the current method, then <i>dreturn</i> throws an <code>IllegalMonitorStateException</code>.</blockquote><p><a name="dstore"></a><hr><h2>dstore</h2><a name="dstore.Operation"></a><p><b>Operation</b><br><blockquote><a name="67733"></a>Store <code>double</code> into local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67730"></a> <i>dstore</i><td><a name="87568"></a> <tr><td><a name="67732"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="dstore.Forms"></a><p><b>Forms</b><br><blockquote><a name="67734"></a><i>dstore</i> = 57 (0x39)</blockquote><p><a name="dstore.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67735"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="dstore.Description"></a><p><b>Description</b><br><blockquote><a name="427239"></a>The <i>index</i> is an unsigned byte. Both <i>index</i> and <i>index </i>+ <i>1</i> must be indices into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The <i>value</i> on the top of the operand stack must be of type <code>double</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. The local variables at <i>index</i> and <i>index</i> &#32;+ &#32;<i>1</i> are set to <i>value'</i>. </blockquote><p><a name="dstore.Notes"></a><p><b>Notes</b><br><blockquote><a name="67740"></a>The <i>dstore</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><blockquote><a name="67741"></a></blockquote><p><a name="dstore_n"></a><hr><h2>dstore_&lt;n&gt;</h2><a name="dstore_n.Operation"></a><p><b>Operation</b><br><blockquote>Store <code>double</code> into local variable<a name="67751"></a><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67750"></a> <i>dstore_&lt;n&gt;</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="dstore_n.Forms"></a><p><b>Forms</b><br><blockquote><a name="67752"></a><i>dstore_0</i> = 71 (0x47) <i>dstore_1</i> = 72 (0x48) <i>dstore_2</i> = 73 (0x49) <i>dstore_3</i> = 74 (0x4a)</blockquote><p><a name="dstore_n.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67753"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="dstore_n.Description"></a><p><b>Description</b><br><blockquote><a name="67754"></a>Both <i>&lt;n&gt;</i> and <i>&lt;n&gt; + 1</i> must be indices into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The <i>value</i> on the top of the operand stack must be of type <code>double</code>. It is popped from the operand stack and undergoes value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value'</i>. The local variables at <i>&lt;n&gt;</i> and <i>&lt;n&gt;</i> &#32;+ &#32;<i>1</i> are set to <i>value'</i>.</blockquote><p><a name="dstore_n.Notes"></a><p><b>Notes</b><br><blockquote><a name="67758"></a>Each of the <i>dstore_&lt;n&gt;</i> instructions is the same as <i>dstore</i> with an <i>index</i> of <i>&lt;n&gt;</i>, except that the operand <i>&lt;n&gt;</i> is implicit.</blockquote><p><a name="dsub"></a><hr><h2>dsub</h2><a name="dsub.Operation"></a><p><b>Operation</b><br><blockquote><a name="67771"></a>Subtract <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67770"></a> <i>dsub</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="dsub.Forms"></a><p><b>Forms</b><br><blockquote><a name="67772"></a><i>dsub</i> = 103 (0x67)</blockquote><p><a name="dsub.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67773"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="dsub.Description"></a><p><b>Description</b><br><blockquote><a name="67774"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>double</code>. The values are popped from the operand stack and undergo value set conversion <a href="Overview.doc.html#33120">(&#167;3.8.3)</a>, resulting in <i>value1'</i> and <i>value2'</i>. The <code>double</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="67775"></a>For <code>double</code> subtraction, it is always the case that <code>a</code>-<code>b</code> produces the same result as <code>a</code>+(-<code>b</code>). However, for the <i>dsub</i> instruction, subtraction from zero is not the same as negation, because if <code>x</code> is +<code>0.0</code>, then <code>0.0</code>-<code>x</code> equals +<code>0.0</code>, but -<code>x</code> equals -<code>0.0</code>. </blockquote><p><blockquote><a name="67776"></a>The Java virtual machine requires support of gradual underflow as defined by IEEE 754. Despite the fact that overflow, underflow, or loss of precision may occur, execution of a <i>dsub</i> instruction never throws a runtime exception.</blockquote><p><a name="dup"></a><hr><h2>dup</h2><a name="dup.Operation"></a><p><b>Operation</b><br><blockquote><a name="67789"></a>Duplicate the top operand stack value<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67788"></a> <i>dup</i><td><a name="87568"></a>

⌨️ 快捷键说明

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