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

MOVE (Super FX): Difference between revisions

From SnesLab
Jump to: navigation, search
(→‎Syntax: (xx) 2)
 
(10 intermediate revisions by 2 users not shown)
Line 26: Line 26:
|[[Sign Flag|S]]
|[[Sign Flag|S]]
|[[CY]]
|[[CY]]
|Z
|[[Zero Flag|Z]]
|+
|+
|0
|0
Line 37: Line 37:
|}
|}


'''MOVE''' is the name of a [[Super FX]] instruction and macro instructions that moves the value of a register.
'''MOVE''' is the name of a [[Super FX]] instruction and macro instructions that moves the value of a register or immediate value into another register or RAM.
 
The [[ALT0]] state is restored.


==== Syntax ====
==== Syntax ====
Line 46: Line 48:
MOVE (xx), Rn
MOVE (xx), Rn
</pre>
</pre>
==== MOVE R<sub>n</sub>, R<sub>n'</sub> ====
MOVE R<sub>n</sub>, R<sub>n'</sub> as a GSU instruction transfers the value from R<sub>n'</sub> to R<sub>n</sub>. The opcode is strictly speaking an alterantive execution of [[TO]], namely when the [[B flag]] is set i.e. a TO is executed immediately after a [[WITH]]. The register of WITH R<sub>n'</sub> is the source and the register of TO R<sub>n</sub> is the destination (for this reason, it is safe to assume that the transfer happens from S<sub>reg</sub> to D<sub>reg</sub>).
As such, the execution of both codes are identical:
<pre>
; R0 = 52BAh
WITH R0
TO R13
; R13 also is now 52BAh
; R0 = 52BAh
WITH R13,R0
; R13 also is now 52BAh
</pre>
==== Example 1 ====
Let:
R<sub>14</sub> = 4983h
R<sub>8</sub> = 9264h
when MOVE R<sub>8</sub>, R<sub>14</sub> is executed:
R<sub>8</sub> = 4983h
==== Example 2 ====
MOVE R<sub>8</sub>, #070h  ; 0070h -> R<sub>8</sub>  (IBT R<sub>8</sub>, #070h)
MOVE R<sub>8</sub>, #0A4h  ; 00a4h -> R<sub>8</sub>  (IWT R<sub>8</sub>, #0A4h)
MOVE R<sub>8</sub>, #-128  ; ff80h -> R<sub>8</sub>  (IBT R<sub>8</sub>, #-128)


=== See Also ===
=== See Also ===
* [[B flag]]
* [[MOVES]]
* [[MOVES]]
* [[MOVEW]]
* [[MOVEW]]
* [[MOVEB]]
* [[MOVEB]]
* [[LM]]
* [[LM (Super FX)|LM]]
* [[LMS]]
* [[LMS]]
* [[IBT]]
* [[IWT]]
* [[MOV]]


=== External Links ===
=== External Links ===
* Official Super Nintendo development manual on MOVE: 9.57 on [https://archive.org/details/SNESDevManual/book2/page/n237 page 2-9-81 of Book II]
* Official Super Nintendo development manual on MOVE: 9.57 on [https://archive.org/details/SNESDevManual/book2/page/n237 page 2-9-81 of Book II]
* Official Super Nintendo development manual on TO: 9.57 on [https://archive.org/details/SNESDevManual/book2/page/n277 page 2-9-48 of Book II]


[[Category:ASM]]
[[Category:ASM]]

Latest revision as of 05:31, 16 July 2024

Basic Info
Addressing Mode Opcode Length ROM Speed RAM Speed Cache Speed
2n'1n 2 bytes 6 cycles 6 cycles 2 cycles
Flags Affected
B ALT1 ALT2 O/V S CY Z
0 0 0 . . . .

MOVE is the name of a Super FX instruction and macro instructions that moves the value of a register or immediate value into another register or RAM.

The ALT0 state is restored.

Syntax

MOVE Rn, Rn'
MOVE Rn, #xx
MOVE Rn, (xx)
MOVE (xx), Rn

MOVE Rn, Rn'

MOVE Rn, Rn' as a GSU instruction transfers the value from Rn' to Rn. The opcode is strictly speaking an alterantive execution of TO, namely when the B flag is set i.e. a TO is executed immediately after a WITH. The register of WITH Rn' is the source and the register of TO Rn is the destination (for this reason, it is safe to assume that the transfer happens from Sreg to Dreg).

As such, the execution of both codes are identical:

; R0 = 52BAh
WITH R0
TO R13
; R13 also is now 52BAh

; R0 = 52BAh
WITH R13,R0
; R13 also is now 52BAh

Example 1

Let:

R14 = 4983h
R8 = 9264h

when MOVE R8, R14 is executed:

R8 = 4983h

Example 2

MOVE R8, #070h   ; 0070h -> R8  (IBT R8, #070h)
MOVE R8, #0A4h   ; 00a4h -> R8  (IWT R8, #0A4h)
MOVE R8, #-128   ; ff80h -> R8  (IBT R8, #-128)

See Also

External Links