RLA

From C64-Wiki
Jump to navigationJump to search

RLA is the mnemonic for the illegal opcode machine language instruction which rotates one bit left in memory then AND accumulator with memory.

This illegal opcode is a combination of two operations with the same addressing mode: ROL, AND.

Addressing modes[edit | edit source]

Opcode Addressing
mode
Assembler
format
Length
in bytes
Number of
cycles
Dec Hex
47 2F Absolute RLA nnnn 3 6
63 3F Absolute,X RLA nnnn,X 3 7
59 3B Absolute,Y RLA nnnn,Y 3 7
39 27 Zeropage RLA nn 2 5
55 37 Zeropage,X RLA nn,X 2 6
35 23 Indexed-indirect RLA (nn,X) 2 8
51 33 Indirect-indexed RLA (nn),Y 2 8

RLA supports 7 different 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 | edit source]

LAX affects 2 of the CPU's status flags:

  • The negative flag is set if the result is negative, i.e. has it's most significant bit set.
  • The zero flag is set if the result is zero, or cleared if it is non-zero.
  • The carryflag is set according to left bit rotate.