⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructions2.doc7.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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.doc6.html">Prev</a> | <a href="Instructions2.doc8.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="i2b">
</a><h2>i2b</h2>
<a name="i2b.Operation"></a>
<b>Operation</h3></b>
<a name="68328"></a>
Convert <code>int</code> to <code>byte</code><p><Table Border="1">
<tr><td><a name="68327"></a>
 <i>i2b</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="i2b.Forms"></a>
<b>Forms</h3></b>
<a name="68329"></a>
<i>i2b</i> = 145 (0x91)<p>
<a name="i2b.Stack"></a>
<b>Stack</h3></b>
<a name="68330"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="i2b.Description"></a>
<b>Description</h3></b>
<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>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="i2b.Notes"></a>
<b>Notes</h3></b>
<a name="68332"></a>
The <i>i2b</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(&#167;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="i2c"></a>
<hr><h2>i2c</h2>
<a name="i2c.Operation"></a>
<b>Operation</h3></b>
<a name="68342"></a>
Convert <p><Table Border="1">
<tr><td><a name="68341"></a>
 <i>i2c</i>
<td><a name="87568"></a>
 

</Table><br><br><code>int</code> to <code>char</code><p>
<a name="i2c.Forms"></a>
<b>Forms</h3></b>
<a name="68343"></a>
<i>i2c</i> = 146 (0x92)<p>
<a name="i2c.Stack"></a>
<b>Stack</h3></b>
<a name="68344"></a>
..., <i>value</i><em> </em><img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="i2c.Description"></a>
<b>Description</h3></b>
<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>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="i2c.Notes"></a>
<b>Notes</h3></b>
<a name="68346"></a>
The <i>i2c</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(&#167;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>.<p>

<a name="i2d"></a>
<hr><h2>i2d</h2>
<a name="i2d.Operation"></a>
<b>Operation</h3></b>
<a name="68359"></a>
Convert <code>int</code> to <code>double</code><p><Table Border="1">
<tr><td><a name="68358"></a>
 <i>i2d</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="i2d.Forms"></a>
<b>Forms</h3></b>
<a name="68360"></a>
<i>i2d</i> = 135 (0x87)<p>
<a name="i2d.Stack"></a>
<b>Stack</h3></b>
<a name="68361"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="i2d.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="i2d.Notes"></a>
<b>Notes</h3></b>
<a name="68363"></a>
The <i>i2d</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(&#167;2.6.2)</a>. Because all values of type <code>int</code> are exactly representable by type <code>double</code>, the conversion is exact.<p>

<a name="i2f"></a>
<hr><h2>i2f</h2>
<a name="i2f.Operation"></a>
<b>Operation</h3></b>
<a name="68379"></a>
Convert <code>int</code> to <code>float</code><p><Table Border="1">
<tr><td><a name="68378"></a>
 <i>i2f</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="i2f.Forms"></a>
<b>Forms</h3></b>
<a name="68380"></a>
<i>i2f</i> = 134 (0x86)<p>
<a name="i2f.Stack"></a>
<b>Stack</h3></b>
<a name="68381"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="i2f.Description"></a>
<b>Description</h3></b>
<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.<p>
<a name="i2f.Notes"></a>
<b>Notes</h3></b>
<a name="68383"></a>
The <i>i2f</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(&#167;2.6.2)</a>, but may result in a loss of precision because type <code>float</code> has only 24 mantissa bits.<p>

<a name="i2l"></a>
<hr><h2>i2l</h2>
<a name="i2l.Operation"></a>
<b>Operation</h3></b>
<a name="68393"></a>
Convert <code>int</code> to <code>long</code><p><Table Border="1">
<tr><td><a name="68392"></a>
 <i>i2l</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="i2l.Forms"></a>
<b>Forms</h3></b>
<a name="68394"></a>
<i>i2l</i> = 133 (0x85)<p>
<a name="i2l.Stack"></a>
<b>Stack</h3></b>
<a name="68395"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result.word1</i>, <i>result.word2</i><p>
<a name="i2l.Description"></a>
<b>Description</h3></b>
<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>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="i2l.Notes"></a>
<b>Notes</h3></b>
<a name="68397"></a>
The <i>i2l</i> instruction performs a widening primitive conversion <a href="Concepts.doc.html#23435">(&#167;2.6.2)</a>. Because all values of type <code>int</code> are exactly representable by type <code>long</code>, the conversion is exact.<p>

<a name="i2s"></a>
<hr><h2>i2s</h2>
<a name="i2s.Operation"></a>
<b>Operation</h3></b>
<a name="68407"></a>
<p><Table Border="1">
<tr><td><a name="68406"></a>
 <i>i2s</i>
<td><a name="87568"></a>
 

</Table><br><br>Convert <code>int</code> to <code>short</code><p>
<a name="i2s.Forms"></a>
<b>Forms</h3></b>
<a name="68408"></a>
<i>i2s</i> = 147 (0x93)<p>
<a name="i2s.Stack"></a>
<b>Stack</h3></b>
<a name="68409"></a>
..., <i>value</i><em> </em><img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="i2s.Description"></a>
<b>Description</h3></b>
<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>. The <i>result</i> is pushed onto the operand stack.<p>
<a name="i2s.Notes"></a>
<b>Notes</h3></b>
<a name="68411"></a>
The <i>i2s</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(&#167;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="iadd"></a>
<hr><h2>iadd</h2>
<a name="iadd.Operation"></a>
<b>Operation</h3></b>
<a name="68421"></a>
Add <code>int</code><p><Table Border="1">
<tr><td><a name="68420"></a>
 <i>iadd</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="iadd.Forms"></a>
<b>Forms</h3></b>
<a name="68422"></a>
<i>iadd</i> = 96 (0x60)<p>
<a name="iadd.Stack"></a>
<b>Stack</h3></b>
<a name="68423"></a>
..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p>
<a name="iadd.Description"></a>
<b>Description</h3></b>
<a name="68424"></a>
Both <i>value1</i> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. The <code>int</code> <i>result</i> is <i>value1</i> + <i>value2</i>. The <i>result</i> is pushed onto the operand stack. <p>
<a name="68425"></a>
If an <i>iadd</i> overflows, then the result is the low-order bits of the true mathematical result in a sufficiently wide two's-complement format. 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="iaload"></a>
<hr><h2>iaload</h2>
<a name="iaload.Operation"></a>
<b>Operation</h3></b>
<a name="68438"></a>
Load <code>int</code> from array<p><Table Border="1">
<tr><td><a name="68437"></a>
 <i>iaload</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="iaload.Forms"></a>
<b>Forms</h3></b>
<a name="68439"></a>
<i>iaload</i> = 46 (0x2e)<p>
<a name="iaload.Stack"></a>
<b>Stack</h3></b>
<a name="68440"></a>
..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i><p>
<a name="iaload.Description"></a>
<b>Description</h3></b>
<a name="68441"></a>
The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>int</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>int</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="iaload.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="68443"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>iaload</i> throws a <code>NullPointerException</code>. <p>
<a name="68444"></a>
Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>iaload</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.<p>

<a name="iand"></a>
<hr><h2>iand</h2>
<a name="iand.Operation"></a>
<b>Operation</h3></b>
<a name="68454"></a>
Boolean AND <code>int</code><p><Table Border="1">
<tr><td><a name="68453"></a>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -