We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
BRA (Super FX): Difference between revisions
From SnesLab
(linkify S) |
(→External Links: lowercase p) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{| class="wikitable" style="float:right;clear:right;width: | {| class="wikitable" style="float:right;clear:right;width:50%" | ||
!colspan="8"|Basic Info | !colspan="8"|Basic Info | ||
|+ | |+ | ||
|'''Addressing Mode''' | |||
|'''Opcode''' | |'''Opcode''' | ||
|'''Length''' | |'''Length''' | ||
Line 8: | Line 9: | ||
|'''Cache Speed''' | |'''Cache Speed''' | ||
|+ | |+ | ||
|[[Program Counter Relative]] | |||
|05?? | |05?? | ||
|2 bytes | |2 bytes | ||
Line 18: | Line 20: | ||
!colspan="9"|Flags Affected | !colspan="9"|Flags Affected | ||
|+ | |+ | ||
|B | |[[B Flag|B]] | ||
|[[ALT1]] | |[[ALT1]] | ||
|[[ALT2]] | |[[ALT2]] | ||
Line 24: | Line 26: | ||
|[[Sign Flag|S]] | |[[Sign Flag|S]] | ||
|[[CY]] | |[[CY]] | ||
|Z | |[[Zero Flag|Z]] | ||
|+ | |+ | ||
|. | |. | ||
Line 35: | Line 37: | ||
|} | |} | ||
'''BRA''' (Branch) is a [[Super FX]] instruction that performs an unconditional jump. | '''BRA''' (Branch) is a [[Super FX]] instruction that performs an unconditional jump. A relative offset of -128 to 127 bytes from the address following the BRA instruction is added into R<sub>15</sub> (the program counter). | ||
No flags are affected. | No flags are affected. | ||
The instruction after BRA is already in the pipeline and will be run before the instruction at the branch destination. | |||
==== Syntax ==== | |||
<pre> | |||
BRA e | |||
</pre> | |||
==== Example ==== | |||
This instruction jumps the program backward in an infinite loop: | |||
<pre> | |||
BRA $0h | |||
</pre> | |||
=== See Also === | === See Also === | ||
Line 45: | Line 60: | ||
=== External Links === | === External Links === | ||
* Official Nintendo documentation on BRA: [https://archive.org/details/SNESDevManual/book2/page/n188 | * Official Nintendo documentation on BRA: 9.24 on [https://archive.org/details/SNESDevManual/book2/page/n188 page 2-9-32 of Book II] | ||
* example: [https://archive.org/details/SNESDevManual/book2/page/n189 page 2-9-33 of Book II], lbid. | * example: [https://archive.org/details/SNESDevManual/book2/page/n189 page 2-9-33 of Book II], lbid. | ||
Line 51: | Line 66: | ||
[[Category:ASM]] | [[Category:ASM]] | ||
[[Category:Two-byte Instructions]] | [[Category:Two-byte Instructions]] | ||
[[Category:Instructions with Delay Slots]] |
Latest revision as of 00:37, 17 July 2024
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | ROM Speed | RAM Speed | Cache Speed | ||
Program Counter Relative | 05?? | 2 bytes | 6 cycles | 6 cycles | 2 cycles |
Flags Affected | ||||||||
---|---|---|---|---|---|---|---|---|
B | ALT1 | ALT2 | O/V | S | CY | Z | ||
. | . | . | . | . | . | . |
BRA (Branch) is a Super FX instruction that performs an unconditional jump. A relative offset of -128 to 127 bytes from the address following the BRA instruction is added into R15 (the program counter).
No flags are affected.
The instruction after BRA is already in the pipeline and will be run before the instruction at the branch destination.
Syntax
BRA e
Example
This instruction jumps the program backward in an infinite loop:
BRA $0h
See Also
External Links
- Official Nintendo documentation on BRA: 9.24 on page 2-9-32 of Book II
- example: page 2-9-33 of Book II, lbid.