📄 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="Lindholm.INDEX.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 name="l2d">
</a><h2>l2d</h2>
<a name="l2d.Operation"></a>
<b>Operation</h3></b>
<a name="69207"></a>
Convert <code>long</code> to <code>double</code><p><Table Border="1">
<tr><td><a name="69206"></a>
<i>l2d</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="l2d.Forms"></a>
<b>Forms</h3></b>
<a name="69208"></a>
<i>l2d</i> = 138 (0x8a)<p>
<a name="l2d.Stack"></a>
<b>Stack</h3></b>
<a name="69209"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="l2d.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="l2d.Notes"></a>
<b>Notes</h3></b>
<a name="69211"></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 type <code>double</code> has only 53 mantissa bits.<p>
<a name="l2f"></a>
<hr><h2>l2f</h2>
<a name="l2f.Operation"></a>
<b>Operation</h3></b>
<a name="69224"></a>
Convert <code>long</code> to <code>float</code><p><Table Border="1">
<tr><td><a name="69223"></a>
<i>l2f</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="l2f.Forms"></a>
<b>Forms</h3></b>
<a name="69225"></a>
<i>l2f</i> = 137 (0x89)<p>
<a name="l2f.Stack"></a>
<b>Stack</h3></b>
<a name="69226"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="l2f.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="l2f.Notes"></a>
<b>Notes</h3></b>
<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 type <code>float</code> has only 24 mantissa bits.<p>
<a name="69232"></a>
<p>
<a name="l2i"></a>
<hr><h2>l2i</h2>
<a name="l2i.Operation"></a>
<b>Operation</h3></b>
<a name="69239"></a>
Convert <code>long</code> to <code>int</code><p><Table Border="1">
<tr><td><a name="69238"></a>
<i>l2i</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="l2i.Forms"></a>
<b>Forms</h3></b>
<a name="69240"></a>
<i>l2i</i> = 136 (0x88)<p>
<a name="l2i.Stack"></a>
<b>Stack</h3></b>
<a name="69241"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="l2i.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="l2i.Notes"></a>
<b>Notes</h3></b>
<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>.<p>
<a name="69247"></a>
<p>
<a name="ladd"></a>
<hr><h2>ladd</h2>
<a name="ladd.Operation"></a>
<b>Operation</h3></b>
<a name="69254"></a>
Add <code>long</code><p><Table Border="1">
<tr><td><a name="69253"></a>
<i>ladd</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="ladd.Forms"></a>
<b>Forms</h3></b>
<a name="69255"></a>
<i>ladd</i> = 97 (0x61)<p>
<a name="ladd.Stack"></a>
<b>Stack</h3></b>
<a name="69256"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2.word1</i>, <i>value2.word2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="ladd.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="69258"></a>
If a <code>long</code> addition overflows, then the result is the low-order bits of the mathematical sum as represented by a <code>long</code>. If overflow occurs, then the sign of the result will not be the same as the sign of the mathematical sum of the two values.<p>
<a name="69259"></a>
<p>
<a name="laload"></a>
<hr><h2>laload</h2>
<a name="laload.Operation"></a>
<b>Operation</h3></b>
<a name="69269"></a>
Load <code>long</code> from array<p><Table Border="1">
<tr><td><a name="69268"></a>
<i>laload</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="laload.Forms"></a>
<b>Forms</h3></b>
<a name="69270"></a>
<i>laload</i> = 47 (0x2f)<p>
<a name="laload.Stack"></a>
<b>Stack</h3></b>
<a name="69271"></a>
..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value.word1</i>, <i>value.word2</i><p>
<a name="laload.Description"></a>
<b>Description</h3></b>
<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 top of the operand stack.<p>
<a name="laload.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="69274"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>laload</i> throws a <code>NullPointerException</code>. <p>
<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>.<p>
<a name="land"></a>
<hr><h2>land</h2>
<a name="land.Operation"></a>
<b>Operation</h3></b>
<a name="69285"></a>
Boolean AND <code>long</code><p><Table Border="1">
<tr><td><a name="69284"></a>
<i>land</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="land.Forms"></a>
<b>Forms</h3></b>
<a name="69286"></a>
<i>land</i> = 127 (0x7f)<p>
<a name="land.Stack"></a>
<b>Stack</h3></b>
<a name="69287"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2.word1</i>, <i>value2.word2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="land.Description"></a>
<b>Description</h3></b>
<a name="69288"></a>
Both <i>value1</i> and <i>value2</i> must both 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.<p>
<a name="lastore"></a>
<hr><h2>lastore</h2>
<a name="lastore.Operation"></a>
<b>Operation</h3></b>
<a name="69298"></a>
Store into <code>long</code> array<p><Table Border="1">
<tr><td><a name="69297"></a>
<i>lastore</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lastore.Forms"></a>
<b>Forms</h3></b>
<a name="69299"></a>
<i>lastore</i> = 80 (0x50)<p>
<a name="lastore.Stack"></a>
<b>Stack</h3></b>
<a name="69300"></a>
..., <i>arrayref</i>, <i>index</i>, <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="lastore.Description"></a>
<b>Description</h3></b>
<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>. <p>
<a name="lastore.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="69303"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>lastore</i> throws a <code>NullPointerException</code>. <p>
<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>.<p>
<a name="lcmp"></a>
<hr><h2>lcmp</h2>
<a name="lcmp.Operation"></a>
<b>Operation</h3></b>
<a name="69311"></a>
Compare <code>long</code><p><Table Border="1">
<tr><td><a name="69310"></a>
<i>lcmp</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lcmp.Forms"></a>
<b>Forms</h3></b>
<a name="69312"></a>
<i>lcmp</i> = 148 (0x94)<p>
<a name="lcmp.Stack"></a>
<b>Stack</h3></b>
<a name="69313"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2.word1</i>, <i>value2.word1</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="lcmp.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="lconst_l"></a>
<hr><h2>lconst_<l></h2>
<a name="lconst_l.Operation"></a>
<b>Operation</h3></b>
<a name="69321"></a>
Push <code>long</code> constant<p><Table Border="1">
<tr><td><a name="69320"></a>
<i>lconst_<l></i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lconst_l.Forms"></a>
<b>Forms</h3></b>
<a name="69322"></a>
<i>lconst_0</i> = 9 (0x9)<i></i><p>
<a name="178040"></a>
<i>lconst_1</i> = 10 (0xa)<p>
<a name="lconst_l.Stack"></a>
<b>Stack</h3></b>
<a name="69323"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i><l>.word1</i>, <i><l>.word2</i><p>
<a name="lconst_l.Description"></a>
<b>Description</h3></b>
<a name="69324"></a>
Push the <code>long</code> constant <i><l></i> (<i>0</i> or <i>1</i>) onto the operand stack. <p>
<a name="ldc"></a>
<hr><h2>ldc</h2>
<a name="ldc.Operation"></a>
<b>Operation</h3></b>
<a name="69333"></a>
Push item from constant pool<p><Table Border="1">
<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><br><p>
<a name="ldc.Forms"></a>
<b>Forms</h3></b>
<a name="69334"></a>
<i>ldc</i><em> </em>= 18 (0x12)<p>
<a name="ldc.Stack"></a>
<b>Stack</h3></b>
<a name="69335"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>item</i><p>
<a name="ldc.Description"></a>
<b>Description</h3></b>
<a name="69336"></a>
The <i>index</i> is an unsigned byte that must be a valid index into the constant pool of the current class <a href="Overview.doc.html#17257">(§3.6)</a>. The constant pool entry at <i>index</i> must be a <code>CONSTANT_Integer</code> <a href="ClassFile.doc.html#21942">(§4.4.4)</a>, <code>CONSTANT_Float</code> <a href="ClassFile.doc.html#21942">(§4.4.4)</a>, or <code>CONSTANT_String</code> <a href="ClassFile.doc.html#8794">(§4.4.3)</a>. The constant pool entry is resolved (<a href="ConstantPool.doc.html#38759">§5.4</a>, <a href="ConstantPool.doc.html#49466">§5.5)</a>. If the entry is a <code>CONSTANT_Integer</code> or <code>CONSTANT_Float</code>, it must contain a numeric <i>item</i> which is pushed onto the operand stack as an <code>int</code> or <code>float</code>, respectively.<p>
<a name="69352"></a>
If the entry at <i>index</i> is a <code>CONSTANT_String</code>, it must contain a <code>CONSTANT_Utf8</code> <a href="ClassFile.doc.html#7963">(§4.4.7)</a> string. An instance of class <code>String</code> is created and initialized to the <code>CONSTANT_Utf8</code> string. The <i>item</i>, a <code>reference</code> to the instance, is pushed onto the operand stack.<p>
<a name="ldc.Linking"></a>
<b>Linking Exceptions</h3></b>
<a name="117410"></a>
During resolution of a <code>CONSTANT_String </code>constant pool item, any of the exceptions documented in <a href="ConstantPool.doc.html#38759">§5.4</a> can be thrown.<p>
<a name="ldc_w"></a>
<hr><h2>ldc_w</h2>
<a name="ldc_w.Operation"></a>
<b>Operation</h3></b>
<a name="69366"></a>
Push item from constant pool<p><Table Border="1">
<tr><td><a name="69361"></a>
<i>ldc_w</i>
<td><a name="87568"></a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -