Accumulator addressing

From C64-Wiki
Jump to navigationJump to search

Accumulator addressing is an addressing mode supported by the four machine language instructions that "shifts" bits within a byte: These instructions also supports a number of "RAM-oriented" addressing modes, but with accumulator addressing, the "input" for the shift operation is picked up from the CPU'saccumulator, and the output is stored back into the accumulator.

Some assemblers and machine language monitors "format" instructions in the accumulator addressing mode like "ASL" for the accumulator mode of that instruction, whereas other assemblers and monitors require an "A" to follow the mnemonic, e.g. "ASL A".

Regardless of the formatting, an instruction in accumulator addressing mode always take up just a single byte for the opcode.

The four instructions that support accumulator addressing are: ASL, LSR, ROL, and ROR.