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

TXS: Difference between revisions

From SnesLab
Jump to: navigation, search
(snes9x implementation)
(→‎External Links: hid archive URL for MCS)
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''TXS''' (Transfer X to Stack Pointer) is a 65x instruction that transfers the value of the [[X index register]] to the [[stack pointer]].
{| class="wikitable" style="float:right;clear:right;width:40%"
 
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="8"|Basic Info
!colspan="8"|Basic Info
|+
|+
Line 9: Line 7:
|'''Speed'''
|'''Speed'''
|+
|+
|implied
|[[Implied]] (type 1)
|9A
|9A
|1 byte
|1 byte
Line 16: Line 14:


{| 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
|+
|+
|N
|[[Negative Flag|N]]
|V
|[[Overflow Flag|V]]
|M
|[[M Flag|M]]
|X
|[[X Flag|X]]
|D
|[[Decimal Flag|D]]
|I
|[[I Flag|I]]
|Z
|[[Zero Flag|Z]]
|C
|[[Carry Flag|C]]
|+
|+
|.
|.
Line 36: Line 34:
|.
|.
|}
|}
'''TXS''' (Transfer X to Stack Pointer) is a 65x instruction that transfers the value of the [[X index register]] to the [[stack pointer]].
* If X is 16 bits wide then all 16 bits are transferred.
* If X is 8 bits wide but the stack pointer is 16 bits wide then X is transferred to the low byte and the high byte of the stack pointer is cleared.
* If both X and the stack pointer are 8 bits wide (aka [[emulation mode]]) then 8 bits are transferred
No flags are affected.
==== Syntax ====
<pre>
TXS
</pre>


=== See Also ===
=== See Also ===
* [[TSX]]
* [[TCS]]
* [[TCS]]
* [[TXA]]


=== External Links ===
=== External Links ===
* [[Eyes & Lichty]] page on TXS: https://archive.org/details/0893037893ProgrammingThe65816/page/n544
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/518 page 518] on TXS
* [[Labiak]] page on TXS: https://archive.org/details/Programming_the_65816/page/n209
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n209 page 199] on TXS
* [[MCS6500 Manual]] page on TXS: https://archive.org/details/mos_microcomputers_programming_manual/page/n139
* 8.8 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n139 page 120] on TXS
* [[Carr]] page on TXS: https://archive.org/details/6502UsersManual/page/n290
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n290 page 277] on TXS
* [[Leventhal]] page on TXS: https://archive.org/details/6502-assembly-language-programming/page/n152
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n152 page 3-103] on TXS
* snes9x implementation of TXS: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2415
* snes9x implementation of TXS: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2415


[[Category:ASM]]
[[Category:ASM]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]
[[Category:Transfer Instructions]]
[[Category:One-byte Instructions]]
[[Category:Implied Instructions]]
[[Category:Two-cycle Instructions]]

Latest revision as of 21:07, 7 August 2024

Basic Info
Addressing Mode Opcode Length Speed
Implied (type 1) 9A 1 byte 2 cycles
Flags Affected
N V M X D I Z C
. . . . . . . .

TXS (Transfer X to Stack Pointer) is a 65x instruction that transfers the value of the X index register to the stack pointer.

  • If X is 16 bits wide then all 16 bits are transferred.
  • If X is 8 bits wide but the stack pointer is 16 bits wide then X is transferred to the low byte and the high byte of the stack pointer is cleared.
  • If both X and the stack pointer are 8 bits wide (aka emulation mode) then 8 bits are transferred

No flags are affected.

Syntax

TXS

See Also

External Links