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

Method ror

nes/cpu.go:807–821  ·  view source on GitHub ↗

ROR - Rotate Right

(info *stepInfo)

Source from the content-addressed store, hash-verified

805
806// ROR - Rotate Right
807func (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
824func (cpu *CPU) rti(info *stepInfo) {

Callers

nothing calls this directly

Calls 3

setZNMethod · 0.95
ReadMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected