📄 instructions2.doc173.html
字号:
<html><head><title>VM Spec </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000> <a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc172.html">Prev</a> | <a href="Instructions2.doc174.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="ret"></a><h2>ret</h2><a name="ret.Operation"></a><b>Operation</b><br><a name="70002"></a>Return from subroutine<p><Table Border="3"><tr><td><a name="69999"></a> <i>ret</i><td><a name="87568"></a> <tr><td><a name="70001"></a> <i>index</i><td><a name="87568"></a> </Table><Table><tr><td></Table><p><a name="ret.Forms"></a><b>Forms</b><br><a name="70003"></a><i>ret</i> = 169 (0xa9)<p><a name="ret.Stack"></a><b>Stack</b><br><a name="70004"></a>No change<p><a name="ret.Description"></a><b>Description</b><br><a name="70005"></a>The <i>index</i> is an unsigned byte between 0 and 255, inclusive. <em>The local variable </em>at<em> </em><i>index</i> in t<em>he current frame </em><a href="Overview.doc.html#17257">(§3.6)</a><em> must contain a value of type </em><code>returnAddress</code><em>. </em>The contents of the local variable are written into the Java Virtual Machine's <code>pc</code> register, and execution continues there.<p><a name="ret.Notes"></a><b>Notes</b><br><a name="70009"></a>The <i>ret</i> instruction is used with <i>jsr</i> or <i>jsr_w</i> instructions in the implementation of the <code>finally</code> keyword of the Java language (see <a href="Compiling.doc.html#13789">Section 7.13, "Compiling finally"</a>). Note that <i>jsr</i> pushes the address onto the stack and <i>ret</i> gets it out of a local variable. This asymmetry is intentional.<p><a name="100993"></a>The <i>ret</i> instruction should not be confused with the <i>return</i> instruction. A <i>return</i> instruction returns control from a Java method to its invoker, without passing any value back to the invoker.<p><a name="166941"></a>The <i>ret</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="166939"></a><p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc172.html">Prev</a> | <a href="Instructions2.doc174.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><p><font size=-1>Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)<br><i><a href="Copyright.doc.html">Copyright © 1996 Sun Microsystems, Inc.</a>All rights reserved</i><br>Please send any comments or corrections to <a href="mailto:doug.kramer@sun.com">doug.kramer@sun.com</a></font></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -