STA

From C64-Wiki
Jump to navigationJump to search

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

Addressing modes[edit]

Opcode Addressing
mode
Assembler
format
Length
in bytes
Number of
cycles
Dec Hex
141 8D Absolute STA nnnn 3 4
157 9D Absolute,X STA nnnn,X 3 5
153 99 Absolute,Y STA nnnn,Y 3 5
133 85 Zeropage STA nn 2 3
149 95 Zeropage,X STA nn,X 2 4
129 81 Indexed-indirect STA (nn,X) 2 6
145 91 Indirect-indexed STA (nn),Y 2 6

STA supports the 7 different addressing modes 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]

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