STX

From C64-Wiki
Jump to navigationJump to search

STX (short for "STore X") is the mnemonic for a machine language instruction which stores a copy of the byte held in the X index register at the RAM or I/O address specified. The contents of the X index register itself remains unchanged through the operation.

Addressing modes[edit]

Opcode Addressing
mode
Assembler
format
Length
in bytes
Number of
cycles
Dec Hex
142 8E Absolute STX nnnn 3 4
134 86 Zeropage STX nn 2 3
150 96 Zeropage,Y STX nn,Y 2 4

STX supports 3 addressing modes, as shown in the table at right. In the assembler formats listed, nn represents a single-byte (8-bit) figure, and nnnn is a two-byte (16-bit) address.

CPU flags[edit]

STX does not affect any of the CPU's status flags.