TAY

From NES Hacker Wiki
Revision as of 14:08, 11 April 2014 by TheAlmightyGuru (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Transfer Accumulator to Y Index
Opcode: TAY
Operation: A → Y
Status Register: Status-List.png
Status-Change.pngStatus-Space.pngStatus-Change.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.png

TAY (Transfer Accumulator to Y Index) transfers the value in the accumulator to the Y index. The reverse of this opcode is TYA.

Operation

This pseudo C code shows how the TAY opcode functions when it is executed.

unsigned src = A;             // Load the value of the accumulator as an unsigned byte.
SET_NEGATIVE(src);            // Sets the Negative Flag equal to the 7th bit.
SET_ZERO(src);                // Sets the Zero Flag if the Operand is $#00, otherwise clears it.
Y = (src);                    // Stores the value of the Accumulator into the Y index.

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Implied TAY A8 1 2

Examples