We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
MOVW (SPC700): Difference between revisions
From SnesLab
(→See Also: ADDW, SUBW, CMPW) |
(linkify direct page) |
||
Line 9: | Line 9: | ||
|+ | |+ | ||
|to YA | |to YA | ||
| | |[[Direct Page Addressing | Direct Page]] | ||
|BA | |BA | ||
|2 bytes | |2 bytes | ||
Line 15: | Line 15: | ||
|+ | |+ | ||
|from YA | |from YA | ||
| | |[[Direct Page Addressing | Direct Page]] | ||
|DA | |DA | ||
|2 bytes | |2 bytes | ||
Line 22: | Line 22: | ||
{| class="wikitable" style="float:right;clear:right;width:30%" | {| class="wikitable" style="float:right;clear:right;width:30%" | ||
!colspan="9"|Flags | !colspan="9"|Flags Affected | ||
|+ | |+ | ||
|Direction | |Direction | ||
Line 56: | Line 56: | ||
'''MOVW''' (Move Word) is an [[SPC700]] instruction that moves a 16-bit [[ | '''MOVW''' (Move Word) is an [[SPC700]] instruction that moves a 16-bit [[direct page]] value to or from the [[YA]] register. There are no variations of MOVW that do not operate on YA. | ||
=== Example === | === Example === | ||
Line 63: | Line 63: | ||
<pre> | <pre> | ||
MOVW YA, $F6 ; load the byte at | MOVW YA, $F6 ; load the byte at direct page location $F6 into A and the byte at direct page location $F7 into Y | ||
MOVW $00, YA ; store the value in Y to | MOVW $00, YA ; store the value in Y to direct page location $01 and the value in A to direct page location $00 | ||
</pre> | </pre> | ||
Revision as of 20:20, 23 July 2023
Basic Info | ||||
---|---|---|---|---|
Direction | Addressing Mode | Opcode | Length | Speed |
to YA | Direct Page | BA | 2 bytes | 5 cycles |
from YA | Direct Page | DA | 2 bytes | 4 cycles |
Flags Affected | ||||||||
---|---|---|---|---|---|---|---|---|
Direction | N | V | P | B | H | I | Z | C |
to YA | . | . | . | . | . | |||
from YA | . | . | . | . | . | . | . | . |
MOVW (Move Word) is an SPC700 instruction that moves a 16-bit direct page value to or from the YA register. There are no variations of MOVW that do not operate on YA.
Example
From the IPL ROM,
MOVW YA, $F6 ; load the byte at direct page location $F6 into A and the byte at direct page location $F7 into Y MOVW $00, YA ; store the value in Y to direct page location $01 and the value in A to direct page location $00
See Also
External Links
- Official Super Nintendo development manual on MOVW: Appendix C-8 of Book I