ROL - Rotate Left
(info *stepInfo)
| 788 | |
| 789 | // ROL - Rotate Left |
| 790 | func (cpu *CPU) rol(info *stepInfo) { |
| 791 | if info.mode == modeAccumulator { |
| 792 | c := cpu.C |
| 793 | cpu.C = (cpu.A >> 7) & 1 |
| 794 | cpu.A = (cpu.A << 1) | c |
| 795 | cpu.setZN(cpu.A) |
| 796 | } else { |
| 797 | c := cpu.C |
| 798 | value := cpu.Read(info.address) |
| 799 | cpu.C = (value >> 7) & 1 |
| 800 | value = (value << 1) | c |
| 801 | cpu.Write(info.address, value) |
| 802 | cpu.setZN(value) |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | // ROR - Rotate Right |
| 807 | func (cpu *CPU) ror(info *stepInfo) { |