MCPcopy Index your code
hub / github.com/fogleman/nes / rol

Method rol

nes/cpu.go:790–804  ·  view source on GitHub ↗

ROL - Rotate Left

(info *stepInfo)

Source from the content-addressed store, hash-verified

788
789// ROL - Rotate Left
790func (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
807func (cpu *CPU) ror(info *stepInfo) {

Callers

nothing calls this directly

Calls 3

setZNMethod · 0.95
ReadMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected