The BRA instruction currently executes in 2 processor cycles (3 if crossing a page):
from py65.devices.mpu65c02 import MPU as MPU_65C02
prog = bytearray([0x80, 0xFE]) # BRA -2
mpu = MPU_65C02(memory=prog, pc=0x0000)
mpu.reset()
mpu.step()
print(mpu.processorCycles) # prints 2
However, all documentation I can find on the Internet indicates that BRA executes in 3 cycles (4 when crossing a page). Other branch instructions like BNE execute in 3 cycles (or 4) if the branch is taken, so I’d expect BRA to behave the same.
The BRA instruction currently executes in 2 processor cycles (3 if crossing a page):
However, all documentation I can find on the Internet indicates that BRA executes in 3 cycles (4 when crossing a page). Other branch instructions like BNE execute in 3 cycles (or 4) if the branch is taken, so I’d expect BRA to behave the same.