ROR - Rotate Right
(info *stepInfo)
| 805 | |
| 806 | // ROR - Rotate Right |
| 807 | func (cpu *CPU) ror(info *stepInfo) { |
| 808 | if info.mode == modeAccumulator { |
| 809 | c := cpu.C |
| 810 | cpu.C = cpu.A & 1 |
| 811 | cpu.A = (cpu.A >> 1) | (c << 7) |
| 812 | cpu.setZN(cpu.A) |
| 813 | } else { |
| 814 | c := cpu.C |
| 815 | value := cpu.Read(info.address) |
| 816 | cpu.C = value & 1 |
| 817 | value = (value >> 1) | (c << 7) |
| 818 | cpu.Write(info.address, value) |
| 819 | cpu.setZN(value) |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | // RTI - Return from Interrupt |
| 824 | func (cpu *CPU) rti(info *stepInfo) { |