blob: 791456b60da310cfadc8800c1fce74365d761d32 [file] [log] [blame]
The Android Open Source Projectf6c38712009-03-03 19:28:47 -08001<!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>goto/16</title>
7<link rel=stylesheet href="opcode.css">
8</head>
9
10<body>
11
12<h1>goto/16</h1>
13
14<h2>Purpose</h2>
15
16<p>
17Unconditionally jump to the indicated instruction.
18</p>
19<p>
20Note: The branch offset may not be 0. (A spin loop may be legally constructed
Carl Shapirode750892010-06-08 16:37:12 -070021either with goto/32 or by including a nop as a target before the branch.)
The Android Open Source Projectf6c38712009-03-03 19:28:47 -080022</p>
23
24<h2>Details</h2>
25
26<table class="instruc">
27<thead>
28<tr>
29 <th>Op &amp; Format</th>
30 <th>Mnemonic / Syntax</th>
31 <th>Arguments</th>
32</tr>
33</thead>
34<tbody>
35<tr>
36 <td>29 20t</td>
37 <td>goto/16 +AAAA</td>
38 <td><code>A:</code> signed branch offset (16 bits)<br/></td>
39</tr>
40</tbody>
41</table>
42
43<h2>Constraints</h2>
44
45<ul>
46 <li>
47 A must point to a valid bytecode instruction inside the current method.
48 </li>
49 <li>
50 A must not be 0.
Carl Shapirode750892010-06-08 16:37:12 -070051 </li>
The Android Open Source Projectf6c38712009-03-03 19:28:47 -080052</ul>
53
54<h2>Behavior</h2>
55
56<ul>
57 <li>
58 The (otherwise invisible) program counter PC is set to the address of the
59 instruction plus the given offset, that is, PC' = PC(goto) + A.
60 </li>
61 <li>
62 Executions resumes at PC'.
Carl Shapirode750892010-06-08 16:37:12 -070063 </li>
The Android Open Source Projectf6c38712009-03-03 19:28:47 -080064</ul>
65
66<h2>Exceptions</h2>
67
68<p>
69None.
70</p>
71
72</body>
73</html>