Ex6502.CPU.Executor.LSR (ex6502 v0.1.0) View Source

Shift the accumlator or address 1 bit right

Bit 7 is always 0 and bit 0 pre-shift enters the carry flag.

Operation

0 -> M7...M0 -> C

Table

LSR Shift One Bit Right (Memory or Accumulator)

0 -> [76543210] -> C N Z C I D V

                                0 + + - - -

addressing assembler opc bytes cyles


accumulator LSR A 4A 1 2 zeropage LSR oper 46 2 5 zeropage,X LSR oper,X 56 2 6 absolute LSR oper 4E 3 6 absolute,X LSR oper,X 5E 3 7

Flags

  • Carry: 1 if bit 0 was 1; 0 if bit 0 was 0
  • Zero: 1 if result is zero; 0 otherwise
  • Negative: 1 if bit 7 of result is set; 0 otherwise

Link to this section Summary

Link to this section Functions