// LSR - Logical Shift Right
Logical Shift Right
// LSR - Logical Shift Right
func (cpu *CPU) op_lsr(info *stepInfo) {
	if info.mode == m_Accumulator {
		if cpu.M == 1 {
			cpu.C     = cpu.RAl & 1
			cpu.RAl >>= 1
			cpu.setZN8(cpu.RAl)
		} else {
			cpu.C     = byte(cpu.RA & 1)
			cpu.RA  >>= 1
			cpu.setZN16(cpu.RA)
		}
	} else {
		if cpu.M == 1 {
			value  := cpu.cmdRead(info)
			cpu.C   = value & 1
			value >>= 1
			cpu.cmdWrite(info, value)
			cpu.setZN8(value)
		} else {
			value  := cpu.cmdRead16(info)
			cpu.C   = byte(value & 1)
			value >>= 1
			cpu.cmdWrite16(info, value)
			cpu.setZN16(value)
		}
	}
}
func ( cpu * CPU ) op_lsr ( info * stepInfo ) { if info . mode == m_Accumulator { if cpu . M == 1 { cpu . C = cpu . RAl & 1 cpu . RAl >>= 1 cpu . setZN8 ( cpu . RAl ) } else { cpu . C = byte ( cpu . RA & 1 ) cpu . RA >>= 1 cpu . setZN16 ( cpu . RA ) } } else { if cpu . M == 1 { value := cpu . cmdRead ( info ) cpu . C = value & 1 value >>= 1 cpu . cmdWrite ( info , value ) cpu . setZN8 ( value ) } else { value := cpu . cmdRead16 ( info ) cpu . C = byte ( value & 1 ) value >>= 1 cpu . cmdWrite16 ( info , value ) cpu . setZN16 ( value ) } } }
Logical Shift Right
Logical Shift Right