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

TO (Super FX): Difference between revisions

From SnesLab
Jump to: navigation, search
(made basic info table shorter)
(Z)
 
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
!colspan="8"|Basic Info
!colspan="8"|Basic Info
|+
|+
|'''Addressing Mode'''
|'''Opcode'''
|'''Opcode'''
|'''Length'''
|'''Length'''
Line 8: Line 9:
|'''Cache Speed'''
|'''Cache Speed'''
|+
|+
|[[Implied]] (type 1)
|1n
|1n
|1 byte
|1 byte
Line 16: Line 18:


{| class="wikitable" style="float:right;clear:right;width:30%"
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="9"|Flags Clobbered
!colspan="9"|Flags Affected
|+
|+
|B
|[[B Flag|B]]
|ALT1
|[[ALT1]]
|ALT2
|[[ALT2]]
|O/V
|[[O/V]]
|S
|[[Sign Flag|S]]
|CY
|[[CY]]
|Z
|[[Zero Flag|Z]]
|+
|+
|.
|.
Line 35: Line 37:
|}
|}


'''TO''' is a [[Super FX]] register prefix instruction that specifies the [[destination register]].
'''TO''' is a [[Super FX]] register prefix instruction that specifies the [[destination register]]. Any register from R<sub>0</sub> to R<sub>15</sub> can be specified.  The exception is when the [[B Flag]] is set (i.e. a [[WITH]] instruction is executed immediately before) in which case a [[MOVE]] is executed instead with WITH acting as the source and TO as the destination.
 
No flags are affected.
 
==== Syntax ====
<pre>
TO Rn
</pre>
 
==== Example ====
Let:
R<sub>6</sub> = 7106h
R<sub>3</sub> = 0028h
After executing this program:
FROM R<sub>6</sub>
TO  R<sub>4</sub>
ADD  R<sub>3</sub>
We have:
R<sub>4</sub> = 712eh


=== See Also ===
=== See Also ===
* [[FROM]]
* [[FROM (Super FX)]]
* [[WITH]]
* [[WITH (Super FX)]]
* [[MOVE (Super FX)]]


=== External Links ===
=== External Links ===
* Official Nintendo documentation on TO: [https://archive.org/details/SNESDevManual/book2/page/n277 page 2-9-121 of Book II]
* Official Nintendo documentation on TO: 9.89 on [https://archive.org/details/SNESDevManual/book2/page/n277 page 2-9-121 of Book II]
* Official Nintendo documentation on Register Prefixes: [https://archive.org/details/SNESDevManual/book2/page/n129 page 2-6-7 of Book II]


[[Category:ASM]]
[[Category:ASM]]
[[Category:Super FX]]
[[Category:Super FX]]
[[Category:Register Prefix Instructions]]
[[Category:Register Prefix Instructions]]
[[Category:One-byte Instructions]]

Latest revision as of 20:59, 12 July 2024

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

TO is a Super FX register prefix instruction that specifies the destination register. Any register from R0 to R15 can be specified. The exception is when the B Flag is set (i.e. a WITH instruction is executed immediately before) in which case a MOVE is executed instead with WITH acting as the source and TO as the destination.

No flags are affected.

Syntax

TO Rn

Example

Let:

R6 = 7106h
R3 = 0028h

After executing this program:

FROM R6
TO   R4
ADD  R3

We have:

R4 = 712eh

See Also

External Links