summaryrefslogtreecommitdiff
path: root/docs/opcodes/opcode-29-goto-16.html
blob: 791456b60da310cfadc8800c1fce74365d761d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>
<title>goto/16</title>
<link rel=stylesheet href="opcode.css">
</head>

<body>

<h1>goto/16</h1>

<h2>Purpose</h2>

<p>
Unconditionally jump to the indicated instruction.
</p>
<p>
Note: The branch offset may not be 0. (A spin loop may be legally constructed
either with goto/32 or by including a nop as a target before the branch.)
</p>

<h2>Details</h2>

<table class="instruc">
<thead>
<tr>
  <th>Op &amp; Format</th>
  <th>Mnemonic / Syntax</th>
  <th>Arguments</th>
</tr>
</thead>
<tbody>
<tr>
  <td>29 20t</td>
  <td>goto/16 +AAAA</td>
  <td><code>A:</code> signed branch offset (16 bits)<br/></td>
</tr>
</tbody>
</table>

<h2>Constraints</h2>

<ul>
  <li>
    A must point to a valid bytecode instruction inside the current method.
  </li>
  <li>
    A must not be 0.
  </li>
</ul>

<h2>Behavior</h2>

<ul>
  <li>
    The (otherwise invisible) program counter PC is set to the address of the
    instruction plus the given offset, that is, PC' = PC(goto) + A.
  </li>
  <li>
    Executions resumes at PC'.
  </li>
</ul>

<h2>Exceptions</h2>

<p>
None.
</p>

</body>
</html>