Skip to content

65c02 BRA cycle count might be incorrect #83

Description

@VinDuv

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions