STX

From NES Hacker Wiki
Jump to: navigation, search
Store X Index In Memory
Opcode: STX
Operation: X → M
Status Register: Status-List.png
Status-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.pngStatus-Space.pngStatus-Ignore.png

STX (Store X Index In Memory) stores the X index into a specified memory address. It is similar in function to STA and STY.

Operation

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

STORE(Operand, X);   // Stores the X Index Register into the memory address specified in the operand.

Addressing Modes

Addressing Mode Assembly Language Form Opcode # Bytes # Cycles
Zero Page STX Operand 86 2 3
Zero Page, Y STX Operand, Y 96 2 4
Absolute STX Operand 8E 3 4

Examples