16 lines
416 B
Kotlin
16 lines
416 B
Kotlin
package android.emu6502.instructions.impl
|
|
|
|
import android.emu6502.CPU
|
|
import android.emu6502.instructions.BaseInstruction
|
|
import android.emu6502.instructions.Instruction
|
|
|
|
/** Logical Shift Right */
|
|
final class LSR(private val cpu: CPU) : BaseInstruction(Instruction.LSR, cpu.instructionList) {
|
|
override fun single() {
|
|
cpu.setCarryFlagFromBit0(cpu.A)
|
|
cpu.A = cpu.A.shr(1)
|
|
cpu.setSZFlagsForRegA()
|
|
}
|
|
}
|
|
|