We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
TYA: Difference between revisions
From SnesLab
(added Carr page) |
(2 cycle Instructions) |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{| class="wikitable" style="float:right;clear:right;width:40%" | |||
{| class="wikitable" style="float:right;clear:right;width: | |||
!colspan="8"|Basic Info | !colspan="8"|Basic Info | ||
|+ | |+ | ||
Line 9: | Line 7: | ||
|'''Speed''' | |'''Speed''' | ||
|+ | |+ | ||
| | |[[Implied]] (type 1) | ||
|98 | |98 | ||
|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="8"|Flags | !colspan="8"|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 35: | Line 33: | ||
| | | | ||
|. | |. | ||
|} | |||
'''TYA''' is a 65x instruction that transfers the value of the [[Y index register]] to the [[accumulator]]. | |||
{| class="wikitable" style="float:right;clear:right;width:40%" | |||
!colspan="3"|Instruction Behavior | |||
|+ | |||
| | |||
|'''8-bit accumulator (m=1)''' | |||
|'''16-bit accumulator (m=0)''' | |||
|+ | |||
|'''8-bit index registers (x=1)''' | |||
|8 bits are transferred | |||
|8 bits are transferred to the low byte of accumulator and high byte of the accumulator is zeroed | |||
|+ | |||
|'''16-bit index registers (x=0)''' | |||
|8 bits (the low byte of the index register) are transferred and the hidden byte of the B accumulator is unaffected | |||
|16 bits are transferred | |||
|} | |} | ||
=== See Also === | === See Also === | ||
* [[TXA]] | * [[TXA]] | ||
* [[TAY]] | |||
=== External Links === | === External Links === | ||
* [[Eyes & Lichty]] page on TYA: https://archive.org/details/0893037893ProgrammingThe65816/page/n546 | * [[Eyes & Lichty]] page 520, on TYA: https://archive.org/details/0893037893ProgrammingThe65816/page/n546 | ||
* [[Labiak]] page on TYA: https://archive.org/details/Programming_the_65816/page/n211 | * [[Labiak]] page 201 on TYA: https://archive.org/details/Programming_the_65816/page/n211 | ||
* [[MCS6500 Manual]] page on TYA: https://archive.org/details/mos_microcomputers_programming_manual/page/n119 | * [[MCS6500 Manual]] page 101 on TYA: https://archive.org/details/mos_microcomputers_programming_manual/page/n119 | ||
* [[Carr]] page on TYA: https://archive.org/details/6502UsersManual/page/n288 | * [[Carr]] page 275 on TYA: https://archive.org/details/6502UsersManual/page/n288 | ||
* [[Leventhal]] page 3-104 on TYA: https://archive.org/details/6502-assembly-language-programming/page/n153 | |||
* snes9x implementation of TYA: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2455 | |||
[[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 11:57, 14 December 2023
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | Speed | ||||
Implied (type 1) | 98 | 1 byte | 2 cycles |
Flags Affected | |||||||
---|---|---|---|---|---|---|---|
N | V | M | X | D | I | Z | C |
. | . | . | . | . | . |
TYA is a 65x instruction that transfers the value of the Y index register to the accumulator.
Instruction Behavior | ||
---|---|---|
8-bit accumulator (m=1) | 16-bit accumulator (m=0) | |
8-bit index registers (x=1) | 8 bits are transferred | 8 bits are transferred to the low byte of accumulator and high byte of the accumulator is zeroed |
16-bit index registers (x=0) | 8 bits (the low byte of the index register) are transferred and the hidden byte of the B accumulator is unaffected | 16 bits are transferred |
See Also
External Links
- Eyes & Lichty page 520, on TYA: https://archive.org/details/0893037893ProgrammingThe65816/page/n546
- Labiak page 201 on TYA: https://archive.org/details/Programming_the_65816/page/n211
- MCS6500 Manual page 101 on TYA: https://archive.org/details/mos_microcomputers_programming_manual/page/n119
- Carr page 275 on TYA: https://archive.org/details/6502UsersManual/page/n288
- Leventhal page 3-104 on TYA: https://archive.org/details/6502-assembly-language-programming/page/n153
- snes9x implementation of TYA: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2455