📄 instructions2.doc8.html
字号:
<a name="69551"></a>
The <i>match-offset</i> pairs are sorted to support lookup routines that are quicker than linear search.<p>
<a name="lor"></a>
<hr><h2>lor</h2>
<a name="lor.Operation"></a>
<b>Operation</h3></b>
<a name="69558"></a>
Boolean OR <code>long</code><p><Table Border="1">
<tr><td><a name="69557"></a>
<i>lor</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lor.Forms"></a>
<b>Forms</h3></b>
<a name="69559"></a>
<i>lor</i> = 129 (0x81)<p>
<a name="lor.Stack"></a>
<b>Stack</h3></b>
<a name="69560"></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="lor.Description"></a>
<b>Description</h3></b>
<a name="69561"></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 inclusive OR of <i>value1</i> and <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="lrem"></a>
<hr><h2>lrem</h2>
<a name="lrem.Operation"></a>
<b>Operation</h3></b>
<a name="69568"></a>
Remainder <code>long</code><p><Table Border="1">
<tr><td><a name="69567"></a>
<i>lrem</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lrem.Forms"></a>
<b>Forms</h3></b>
<a name="69569"></a>
<i>lrem</i> = 113 (0x71)<p>
<a name="lrem.Stack"></a>
<b>Stack</h3></b>
<a name="69570"></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="lrem.Description"></a>
<b>Description</h3></b>
<a name="69571"></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>value1</i> / <i>value2</i>) * <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="69572"></a>
The result of the <i>lrem</i> instruction is such that <code>(a/b)*b</code> <code>+</code> <code>(a%b)</code> is equal to <code>a</code>. This identity holds even in the special case that the dividend is the negative <code>long</code> of largest possible magnitude for its type and the divisor is -<code>1</code> (the remainder is <code>0</code>). It follows from this rule that the result of the remainder operation can be negative only if the dividend is negative and can be positive only if the dividend is positive; moreover, the magnitude of the result is always less than the magnitude of the divisor. <p>
<a name="lrem.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="69574"></a>
If the value of the divisor for a <code>long</code> remainder operator is 0, <i>lrem</i> throws an <code>ArithmeticException</code>.<p>
<a name="lreturn"></a>
<hr><h2>lreturn</h2>
<a name="lreturn.Operation"></a>
<b>Operation</h3></b>
<a name="69581"></a>
Return <code>long</code> from method<p><Table Border="1">
<tr><td><a name="69580"></a>
<i>lreturn</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lreturn.Forms"></a>
<b>Forms</h3></b>
<a name="69582"></a>
<i>lreturn</i> = 173 (0xad)<p>
<a name="lreturn.Stack"></a>
<b>Stack</h3></b>
<a name="69583"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> <p>
<a name="178050"></a>
[empty]<p>
<a name="lreturn.Description"></a>
<b>Description</h3></b>
<a name="69584"></a>
The returning method must have return type <code>long</code>. The <i>value</i> must be of type <code>long</code>. The <i>value</i> is popped from the operand stack of the current frame <a href="Overview.doc.html#17257">(§3.6)</a> and pushed onto the operand stack of the frame of the invoker. Any other values on the operand stack of the current method are discarded. If the returning 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. <p>
<a name="69588"></a>
The interpreter then returns control to the invoker of the method, reinstating the frame of the invoker.<p>
<a name="lshl"></a>
<hr><h2>lshl</h2>
<a name="lshl.Operation"></a>
<b>Operation</h3></b>
<a name="69598"></a>
Shift left<p><Table Border="1">
<tr><td><a name="69597"></a>
<i>lshl</i>
<td><a name="87568"></a>
</Table><br><br> <code>long</code><p>
<a name="lshl.Forms"></a>
<b>Forms</h3></b>
<a name="69599"></a>
<i>lshl</i> = 121 (0x79)<p>
<a name="lshl.Stack"></a>
<b>Stack</h3></b>
<a name="69600"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="lshl.Description"></a>
<b>Description</h3></b>
<a name="69601"></a>
The <i>value1</i> must be of type <code>long</code> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> left by <em>s</em> bit positions, where <em>s</em> is the low six bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="lshl.Notes"></a>
<b>Notes</h3></b>
<a name="69602"></a>
This is equivalent (even if overflow occurs) to multiplication by 2 to the power<em> </em><em>s</em>. The shift distance actually used is therefore always in the range 0 to 63, inclusive, as if <i>value2</i> were subjected to a bitwise logical AND with the mask value 0x3f. <p>
<a name="lshr"></a>
<hr><h2>lshr</h2>
<a name="lshr.Operation"></a>
<b>Operation</h3></b>
<a name="69612"></a>
Arithmetic shift right <code>long</code><p><Table Border="1">
<tr><td><a name="69611"></a>
<i>lshr</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lshr.Forms"></a>
<b>Forms</h3></b>
<a name="69613"></a>
<i>lshr</i> = 123 (0x7b)<p>
<a name="lshr.Stack"></a>
<b>Stack</h3></b>
<a name="69614"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="lshr.Description"></a>
<b>Description</h3></b>
<a name="69615"></a>
The <i>value1</i> must be of type <code>long</code> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> right by <em>s</em> bit positions, with sign extension, where <em>s</em> is the value of the low six bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="lshr.Notes"></a>
<b>Notes</h3></b>
<a name="69619"></a>
The resulting value is <br><br><img src="Instructions2.doc.anc13.gif">
<br><br>, where <i>s</i> is <i>value2</i> & 0x3f. For nonnegative <i>value1</i>, this is equivalent to truncating <code>long</code> division by 2 to the power <code>s</code>. The shift distance actually used is therefore always in the range 0 to 63, inclusive, as if <i>value2</i> were subjected to a bitwise logical AND with the mask value 0x3f. <p>
<a name="lstore"></a>
<hr><h2>lstore</h2>
<a name="lstore.Operation"></a>
<b>Operation</h3></b>
<a name="69628"></a>
Store <code>long</code> into local variable<p><Table Border="1">
<tr><td><a name="69625"></a>
<i>lstore</i>
<td><a name="87568"></a>
<tr><td><a name="69627"></a>
<i>index</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lstore.Forms"></a>
<b>Forms</h3></b>
<a name="69629"></a>
<i>lstore</i> = 55 (0x37)<p>
<a name="lstore.Stack"></a>
<b>Stack</h3></b>
<a name="69630"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="lstore.Description"></a>
<b>Description</h3></b>
<a name="69631"></a>
The <i>index</i> is an unsigned byte. Both <i>index</i> and <i>index </i>+ 1 must be valid indices into the local variables of the current frame <a href="Overview.doc.html#17257">(§3.6)</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 the local variables at <i>index</i> and <i>index </i>+ 1 are set to <i>value</i>. <p>
<a name="lstore.Notes"></a>
<b>Notes</h3></b>
<a name="69635"></a>
The <i>lstore</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.<p>
<a name="lstore_n"></a>
<hr><h2>lstore_<n></h2>
<a name="lstore_n.Operation"></a>
<b>Operation</h3></b>
<a name="69645"></a>
Store <code>long</code> into local variable<p><Table Border="1">
<tr><td><a name="69644"></a>
<i>lstore_<n></i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lstore_n.Forms"></a>
<b>Forms</h3></b>
<a name="69646"></a>
<i>lstore_0</i> = 63 (0x3f)<i></i><p>
<a name="178052"></a>
<i>lstore_1</i> = 64 (0x40)<i></i><p>
<a name="178054"></a>
<i>lstore_2</i> = 65 (0x41)<i></i><p>
<a name="178056"></a>
<i>lstore_3</i> = 66 (0x42)<p>
<a name="lstore_n.Stack"></a>
<b>Stack</h3></b>
<a name="88095"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="lstore_n.Description"></a>
<b>Description</h3></b>
<a name="69648"></a>
Both <i><n></i> and <i><n> </i>+ 1 must be valid indices into the local variables of the current frame <a href="Overview.doc.html#17257">(§3.6)</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 the local variables at <i><n></i> and <i><n> </i>+ 1 are set to <i>value</i>.<p>
<a name="lstore_n.Notes"></a>
<b>Notes</h3></b>
<a name="69652"></a>
Each of the <i>lstore_<n></i> instructions is the same as <i>lstore</i> with an <i>index</i> of <i><n></i>, except that the operand <i><n></i> is implicit.<p>
<a name="lsub"></a>
<hr><h2>lsub</h2>
<a name="lsub.Operation"></a>
<b>Operation</h3></b>
<a name="69662"></a>
Subtract <code>long</code><p><Table Border="1">
<tr><td><a name="69661"></a>
<i>lsub</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lsub.Forms"></a>
<b>Forms</h3></b>
<a name="69663"></a>
<i>lsub</i> = 101 (0x65)<p>
<a name="lsub.Stack"></a>
<b>Stack</h3></b>
<a name="69664"></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="lsub.Description"></a>
<b>Description</h3></b>
<a name="69665"></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="69666"></a>
For <code>long</code> subtraction, <code>a</code>-<code>b</code> produces the same result as <code>a</code>+<code>(</code>-<code>b)</code>. For <code>long</code> values, subtraction from zero is the same as negation.<p>
<a name="69667"></a>
Despite the fact that overflow or underflow may occur, in which case the <i>result</i> may have a different sign than the true mathematical result, execution of an <i>lsub</i> instruction never throws a runtime exception.<p>
<a name="lushr"></a>
<hr><h2>lushr</h2>
<a name="lushr.Operation"></a>
<b>Operation</h3></b>
<a name="69677"></a>
Logical shift right <code>long</code><p><Table Border="1">
<tr><td><a name="69676"></a>
<i>lushr</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lushr.Forms"></a>
<b>Forms</h3></b>
<a name="69678"></a>
<i>lushr</i> = 125 (0x7d)<p>
<a name="lushr.Stack"></a>
<b>Stack</h3></b>
<a name="69679"></a>
..., <i>value1.word1</i>, <i>value1.word2</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="lushr.Description"></a>
<b>Description</h3></b>
<a name="69680"></a>
The <i>value1</i> must be of type <code>long</code> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> right logically (with zero extension) by the amount indicated by the low six bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="lushr.Notes"></a>
<b>Notes</h3></b>
<a name="125526"></a>
If <em>value1</em> is positive and <code>s</code> is <i>value2</i> & 0x3f, the result is the same as that of <i>value1</i> >> <code>s</code>; if <i>value1</i> is negative, the result is equal to the value of the expression (<i>value1</i> >> <code>s</code>) + (2L << ~<code>s</code>). The addition of the (2L << ~<code>s</code>) term cancels out the propagated sign bit. The shift distance actually used is always in the range 0 to 63, inclusive.<p>
<a name="125524"></a>
<p>
<a name="lxor"></a>
<hr><h2>lxor</h2>
<a name="lxor.Operation"></a>
<b>Operation</h3></b>
<a name="69692"></a>
Boolean XOR <code>long</code><p><Table Border="1">
<tr><td><a name="69691"></a>
<i>lxor</i>
<td><a name="87568"></a>
</Table><br><br><p>
<a name="lxor.Forms"></a>
<b>Forms</h3></b>
<a name="69693"></a>
<i>lxor</i> = 131 (0x83)<p>
<a name="lxor.Stack"></a>
<b>Stack</h3></b>
<a name="69694"></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="lxor.Description"></a>
<b>Description</h3></b>
<a name="69695"></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 exclusive OR of <i>value1</i> and <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p>
<hr>
<!-- This inserts footnotes--><p>
<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>
<p>
<font size = -1>Java Virtual Machine Specification <br>
<!--(HTML generated by dkramer on March 31, 1997)-->
<!--
(HTML generated by dkramer on March 25, 1997)-->
<br>
<i><a href="Copyright.doc.html">Copyright © 1996, 1997 Sun Microsystems, Inc.</a>
All rights reserved</i>
<br>
Please send any comments or corrections to <a href="mailto:jvm@java.sun.com">jvm@java.sun.com</a>
</font>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -