From C64-Wiki
Jump to navigationJump to search

TSX (short for "Transfer Stack pointer to X") is the mnemonic for a machine language instruction which transfers ("copies") the contents of the stack pointer into the X index register.

Addressing mode[edit | edit source]

Opcode Addressing
in bytes
Number of
Dec Hex
186 BA Implied TSX 1 2

TSX only supports the Implied addressing mode, as shown in the table at right.

CPU flags[edit | edit source]

TSX affects 2 of the CPU's status flags:

  • The negative status flag is set if the byte transferred is negative, i.e. has it's most significant bit set.
  • The zero flag is set if the byte transferred is zero, or cleared if it is non-zero.