We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

LOOP (Super FX): Difference between revisions

From SnesLab
Jump to: navigation, search
(added example)
(Z)
Line 26: Line 26:
|[[Sign Flag|S]]
|[[Sign Flag|S]]
|[[CY]]
|[[CY]]
|Z
|[[Zero Flag|Z]]
|+
|+
|0
|0

Revision as of 21:00, 12 July 2024

Basic Info
Addressing Mode Opcode Length ROM Speed RAM Speed Cache Speed
Implied (type 1) 3C 1 byte 3 cycles 3 cycles 1 cycle
Flags Affected
B ALT1 ALT2 O/V S CY Z
0 0 0 . .

LOOP is a Super FX instruction that decrements R12. If the zero flag is set afterwards, R15 is incremented. Otherwise, R13 is stored to R15.

The next instruction after LOOP is already loaded into the pipeline.

Syntax

LOOP

Example

In this program:

00:8014 INC R7
00:8015 INC R6
00:8016 LOOP
00:8017 NOP
00:8018 ADD R4

If R13 is 8014h and R12 is not 0001h, the program jumps to 00:8014h after the NOP. If R12 is 0001h, the program does not jump and control falls through to the ADD.

External Links