Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force break "BRK" is implied not immediate addressing mode #5

Open
jchristof opened this issue Aug 26, 2019 · 1 comment
Open

Force break "BRK" is implied not immediate addressing mode #5

jchristof opened this issue Aug 26, 2019 · 1 comment

Comments

@jchristof
Copy link

{ "BRK", &a::BRK, &a::IMM, 7 } should be { "BRK", &a::BRK, &a::IMP, 7 }

@mebusy
Copy link

mebusy commented May 7, 2020

This has troubled me as well. In fact PC was incremented in 3 places: after reading BRK byte, IMM addressing, BRK() subroutine. It should not the expected behavior.

BRK causes a non-maskable interrupt and increments the program counter by one. Therefore an RTI will go to the address of the BRK +2 so that BRK may be used to replace a two-byte instruction for debugging and the subsequent RTI will be correct.

PA055 added a commit to PA055/olcNES that referenced this issue Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants