• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
3<html>
4
5<head>
6<title>unop</title>
7<link rel=stylesheet href="opcode.css">
8</head>
9
10<body>
11
12<h1>unop</h1>
13
14<h2>Purpose</h2>
15
16<p>
17Perform the identified unary operation on the source register, storing the
18result in the destination register.
19</p>
20
21<h2>Details</h2>
22
23<table class="instruc">
24<thead>
25<tr>
26  <th>Op &amp; Format</th>
27  <th>Mnemonic / Syntax</th>
28  <th>Arguments</th>
29</tr>
30</thead>
31<tbody>
32<tr>
33  <td>7b..8f 12x</td>
34  <td><i>unop</i> vA, vB<br/>
35    7b: neg-int<br/>
36    7c: not-int<br/>
37    7d: neg-long<br/>
38    7e: not-long<br/>
39    7f: neg-float<br/>
40    80: neg-double<br/>
41    81: int-to-long<br/>
42    82: int-to-float<br/>
43    83: int-to-double<br/>
44    84: long-to-int<br/>
45    85: long-to-float<br/>
46    86: long-to-double<br/>
47    87: float-to-int<br/>
48    88: float-to-long<br/>
49    89: float-to-double<br/>
50    8a: double-to-int<br/>
51    8b: double-to-long<br/>
52    8c: double-to-float<br/>
53    8d: int-to-byte<br/>
54    8e: int-to-char<br/>
55    8f: int-to-short
56  </td>
57  <td><code>A:</code> destination register or pair (4 bits)<br/>
58    <code>B:</code> source register or pair (4 bits)</td>
59</tr>
60</tbody>
61</table>
62
63<h2>Constraints</h2>
64
65<ul>
66  <li>
67    Both A and B must be valid register indices for the current stackframe.
68  </li>
69  <li>
70    If the input type of &lt;unop&gt; is double or long, also B+1 must be a
71    valid register index in the current stackframe.
72  </li>
73  <li>
74    If the output type of &lt;unop&gt; is double or long, also A+1 must be a
75    valid register index in the current stackframe.
76  </li>
77  <li>
78    The type of register vB must match the source type of the instruction (this
79    probably needs more detail).
80  </li>
81</ul>
82
83<h2>Behavior</h2>
84
85<ul>
86  <li>
87    The given operation &lt;unop&gt; is performed according to the semantics
88    specified in table XXX.
89  </li>
90  <li>
91    The result is stored in register vA, that is, vA'=&lt;unop&gt; vB.
92  </li>
93  <li>
94    It gets a bit messy if we want to describe all the combinations of input and
95    output with and without pairs here. Probably it's better to split it up.
96  </li>
97</ul>
98
99<h2>Exceptions</h2>
100
101<ul>
102  <li>
103    ArithmeticException if an arithmetic error occurs during the instruction.
104  </li>
105</ul>
106
107</body>
108</html>
109