21 lines
503 B
Kotlin
21 lines
503 B
Kotlin
package android.emu6502.instructions.impl
|
|
|
|
import android.emu6502.CPU
|
|
import android.emu6502.Memory
|
|
import android.emu6502.instructions.BaseInstruction
|
|
import android.emu6502.instructions.Instruction
|
|
|
|
/** STore Accumulator */
|
|
class STA(private val memory: Memory, private val cpu: CPU)
|
|
: BaseInstruction(Instruction.STA, cpu.instructionList) {
|
|
|
|
override fun absolute() {
|
|
memory.storeByte(cpu.popWord(), cpu.A)
|
|
}
|
|
|
|
override fun zeroPage() {
|
|
memory.storeByte(cpu.popByte(), cpu.A)
|
|
}
|
|
}
|
|
|