📄 instructions2.doc6.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.doc5.html">Prev</a> | <a href="Instructions2.doc7.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="i2b"></a><hr><h2>i2b</h2><a name="i2b.Operation"></a><p><b>Operation</b><br><blockquote><a name="68328"></a>Convert <code>int</code> to <code>byte</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68327"></a> <i>i2b</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2b.Forms"></a><p><b>Forms</b><br><blockquote><a name="68329"></a><i>i2b</i> = 145 (0x91)</blockquote><p><a name="i2b.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68330"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2b.Description"></a><p><b>Description</b><br><blockquote><a name="68331"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack, truncated to a <code>byte</code>, then sign-extended to an <code>int</code> <i>result</i>. That <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="i2b.Notes"></a><p><b>Notes</b><br><blockquote><a name="68332"></a>The <i>i2b</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><a name="i2c"></a><hr><h2>i2c</h2><a name="i2c.Operation"></a><p><b>Operation</b><br><blockquote><a name="68342"></a>Convert <code>int</code> to <code>char</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68341"></a> <i>i2c</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2c.Forms"></a><p><b>Forms</b><br><blockquote><a name="68343"></a><i>i2c</i> = 146 (0x92)</blockquote><p><a name="i2c.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68344"></a>..., <i>value</i><em> </em><img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2c.Description"></a><p><b>Description</b><br><blockquote><a name="68345"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack, truncated to <code>char</code>, then zero-extended to an <code>int</code> <i>result</i>. That <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="i2c.Notes"></a><p><b>Notes</b><br><blockquote><a name="68346"></a>The <i>i2c</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> (which is always positive) may also not have the same sign as <i>value</i>.</blockquote><p><a name="i2d"></a><hr><h2>i2d</h2><a name="i2d.Operation"></a><p><b>Operation</b><br><blockquote><a name="68359"></a>Convert <code>int</code> to <code>double</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68358"></a> <i>i2d</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2d.Forms"></a><p><b>Forms</b><br><blockquote><a name="68360"></a><i>i2d</i> = 135 (0x87)</blockquote><p><a name="i2d.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68361"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2d.Description"></a><p><b>Description</b><br><blockquote><a name="68362"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack and converted to a <code>double</code> <i>result</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="i2d.Notes"></a><p><b>Notes</b><br><blockquote><a name="68363"></a>The <i>i2d</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(§2.6.2)</a>. Because all values of type <code>int</code> are exactly representable by type <code>double</code>, the conversion is exact.</blockquote><p><a name="i2f"></a><hr><h2>i2f</h2><a name="i2f.Operation"></a><p><b>Operation</b><br><blockquote><a name="68379"></a>Convert <code>int</code> to <code>float</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68378"></a> <i>i2f</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2f.Forms"></a><p><b>Forms</b><br><blockquote><a name="68380"></a><i>i2f</i> = 134 (0x86)</blockquote><p><a name="i2f.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68381"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2f.Description"></a><p><b>Description</b><br><blockquote><a name="68382"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack and converted to the <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="i2f.Notes"></a><p><b>Notes</b><br><blockquote><a name="344471"></a>The <i>i2f</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(§2.6.2)</a>, but may result in a loss of precision because values of type <code>float</code> have only 24 significand bits.</blockquote><p><a name="i2l"></a><hr><h2>i2l</h2><a name="i2l.Operation"></a><p><b>Operation</b><br><blockquote><a name="68393"></a>Convert <code>int</code> to <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68392"></a> <i>i2l</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2l.Forms"></a><p><b>Forms</b><br><blockquote><a name="68394"></a><i>i2l</i> = 133 (0x85)</blockquote><p><a name="i2l.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68395"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2l.Description"></a><p><b>Description</b><br><blockquote><a name="68396"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack and sign-extended to a <code>long</code> <i>result</i>. That <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="i2l.Notes"></a><p><b>Notes</b><br><blockquote><a name="68397"></a>The <i>i2l</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(§2.6.2)</a>. Because all values of type <code>int</code> are exactly representable by type <code>long</code>, the conversion is exact.</blockquote><p><a name="i2s"></a><hr><h2>i2s</h2><a name="i2s.Operation"></a><p><b>Operation</b><br><blockquote><a name="68407"></a><p>Convert <code>int</code> to <code>short</code><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68406"></a> <i>i2s</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="i2s.Forms"></a><p><b>Forms</b><br><blockquote><a name="68408"></a><i>i2s</i> = 147 (0x93)</blockquote><p><a name="i2s.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="68409"></a>..., <i>value</i><em> </em><img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="i2s.Description"></a><p><b>Description</b><br><blockquote><a name="68410"></a>The <i>value</i> on the top of the operand stack must be of type <code>int</code>. It is popped from the operand stack, truncated to a <code>short</code>, then sign-extended to an <code>int</code> <i>result</i>. That <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="i2s.Notes"></a><p><b>Notes</b><br><blockquote><a name="68411"></a>The <i>i2s</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><a name="iadd"></a><hr><h2>iadd</h2><a name="iadd.Operation"></a><p><b>Operation</b><br><blockquote><a name="68421"></a>Add <code>int</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="68420"></a> <i>iadd</i>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -