📄 instructions2.doc8.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>VM Spec </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000><table width=100%><tr><td><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc7.html">Prev</a> | <a href="Instructions2.doc9.html">Next</a> | <a href="VMSpecIX.fm.html">Index</a></td><td align=right><i><i>The Java<sup><font size=-2>TM</font></sup> Virtual Machine Specification</i></i></td></tr></table><hr><br> <a href="Instructions2.doc.html">A</a><a href="Instructions2.doc1.html">B</a><a href="Instructions2.doc2.html">C</a><a href="Instructions2.doc3.html">D</a><a href="Instructions2.doc4.html">F</a><a href="Instructions2.doc5.html">G</a><a href="Instructions2.doc6.html">I</a><a href="Instructions2.doc7.html">J</a><a href="Instructions2.doc8.html">L</a><a href="Instructions2.doc9.html">M</a><a href="Instructions2.doc10.html">N</a><a href="Instructions2.doc11.html">P</a><a href="Instructions2.doc12.html">R</a><a href="Instructions2.doc13.html">S</a><a href="Instructions2.doc14.html">T</a><a href="Instructions2.doc15.html">W</a><a name="l2d"></a><hr><h2>l2d</h2><a name="l2d.Operation"></a><p><b>Operation</b><br><blockquote><a name="69207"></a>Convert <code>long</code> to <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69206"></a> <i>l2d</i><td><a name="457592"></a> </Table><br></blockquote><p><a name="l2d.Forms"></a><p><b>Forms</b><br><blockquote><a name="69208"></a><i>l2d</i> = 138 (0x8a)</blockquote><p><a name="l2d.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69209"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="l2d.Description"></a><p><b>Description</b><br><blockquote><a name="69210"></a>The <i>value</i> on the top of the operand stack must be of type <code>long</code>. It is popped from the operand stack and converted to a <code>double</code> <i>result</i> using IEEE 754 round to nearest mode. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="l2d.Notes"></a><p><b>Notes</b><br><blockquote><a name="432867"></a>The <i>l2d</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(§2.6.2)</a> that may lose precision because values of type <code>double</code> have only 53 significand bits.</blockquote><p><a name="l2f"></a><hr><h2>l2f</h2><a name="l2f.Operation"></a><p><b>Operation</b><br><blockquote><a name="69224"></a>Convert <code>long</code> to <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69223"></a> <i>l2f</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="l2f.Forms"></a><p><b>Forms</b><br><blockquote><a name="69225"></a><i>l2f</i> = 137 (0x89)</blockquote><p><a name="l2f.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69226"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="l2f.Description"></a><p><b>Description</b><br><blockquote><a name="69227"></a>The <i>value</i> on the top of the operand stack must be of type <code>long</code>. It is popped from the operand stack and converted to a <code>float</code> <i>result</i> using IEEE 754 round to nearest mode. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="l2f.Notes"></a><p><b>Notes</b><br><blockquote><a name="69228"></a>The <i>l2f</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(§2.6.2)</a> that may lose precision because values of type <code>float</code> have only 24 significand bits.</blockquote><p><blockquote><a name="69232"></a></blockquote><p><a name="l2i"></a><hr><h2>l2i</h2><a name="l2i.Operation"></a><p><b>Operation</b><br><blockquote><a name="69239"></a>Convert <code>long</code> to <code>int</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69238"></a> <i>l2i</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="l2i.Forms"></a><p><b>Forms</b><br><blockquote><a name="69240"></a><i>l2i</i> = 136 (0x88)</blockquote><p><a name="l2i.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69241"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="l2i.Description"></a><p><b>Description</b><br><blockquote><a name="69242"></a>The <i>value</i> on the top of the operand stack must be of type <code>long</code>. It is popped from the operand stack and converted to an <code>int</code> <i>result</i> by taking the low-order 32 bits of the <code>long</code> value and discarding the high-order 32 bits. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="l2i.Notes"></a><p><b>Notes</b><br><blockquote><a name="69243"></a>The <i>l2i</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(§2.6.3)</a>. It may lose information about the overall magnitude of <i>value</i>. The <i>result</i> may also not have the same sign as <i>value</i>.</blockquote><p><blockquote><a name="69247"></a></blockquote><p><a name="ladd"></a><hr><h2>ladd</h2><a name="ladd.Operation"></a><p><b>Operation</b><br><blockquote><a name="69254"></a>Add <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69253"></a> <i>ladd</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="ladd.Forms"></a><p><b>Forms</b><br><blockquote><a name="69255"></a><i>ladd</i> = 97 (0x61)</blockquote><p><a name="ladd.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69256"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="ladd.Description"></a><p><b>Description</b><br><blockquote><a name="69257"></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 <i>value1</i> + <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><blockquote><a name="448592"></a>The result is the 64 low-order bits of the true mathematical result in a sufficiently wide two's-complement format, represented as a value of type <code>long</code>. If overflow occurs, 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="448572"></a>Despite the fact that overflow may occur, execution of an <i>ladd</i> instruction never throws a runtime exception.</blockquote><p><blockquote><a name="69259"></a></blockquote><p><a name="laload"></a><hr><h2>laload</h2><a name="laload.Operation"></a><p><b>Operation</b><br><blockquote><a name="69269"></a>Load <code>long</code> from array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69268"></a> <i>laload</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="laload.Forms"></a><p><b>Forms</b><br><blockquote><a name="69270"></a><i>laload</i> = 47 (0x2f)</blockquote><p><a name="laload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69271"></a>..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="laload.Description"></a><p><b>Description</b><br><blockquote><a name="69272"></a>The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>long</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>long</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="laload.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="69274"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>laload</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="69275"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>laload</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><a name="land"></a><hr><h2>land</h2><a name="land.Operation"></a><p><b>Operation</b><br><blockquote><a name="69285"></a>Boolean AND <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69284"></a> <i>land</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="land.Forms"></a><p><b>Forms</b><br><blockquote><a name="69286"></a><i>land</i> = 127 (0x7f)</blockquote><p><a name="land.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69287"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="land.Description"></a><p><b>Description</b><br><blockquote><a name="69288"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>long</code>. They are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by taking the bitwise AND of <i>value1</i> and <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="lastore"></a><hr><h2>lastore</h2><a name="lastore.Operation"></a><p><b>Operation</b><br><blockquote><a name="69298"></a>Store into <code>long</code> array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69297"></a> <i>lastore</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lastore.Forms"></a><p><b>Forms</b><br><blockquote><a name="69299"></a><i>lastore</i> = 80 (0x50)</blockquote><p><a name="lastore.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69300"></a>..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="lastore.Description"></a><p><b>Description</b><br><blockquote><a name="69301"></a>The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>long</code>. The <i>index</i> must be of type <code>int</code>, and <i>value</i> must be of type <code>long</code>. The <i>arrayref</i>, <i>index</i>, and <i>value</i> are popped from the operand stack. The <code>long</code> <i>value</i> is stored as the component of the array indexed by <i>index</i>. </blockquote><p><a name="lastore.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="69303"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>lastore</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="69304"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>lastore</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><a name="lcmp"></a><hr><h2>lcmp</h2><a name="lcmp.Operation"></a><p><b>Operation</b><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -