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

Make sure an indirect jump never uses an address beginning on the last byte of a page #1

Open
munshkr opened this issue Aug 5, 2016 · 0 comments
Labels

Comments

@munshkr
Copy link
Owner

munshkr commented Aug 5, 2016

There is a bug in the 6502 where an indirect JMP will never cross page boundaries. E.g: If address $3000 contains $40, $30FF contains $80, and $3100 contains $50, the result of JMP ($30FF) will be a transfer of control to $4080 rather than $5080.

Assembler should do both of these:

  • If JMP uses a label that references an address on the last byte of a page (i.e. low byte of address is $ff), shift up or down code referenced by label 1 byte.
  • If JMP uses a hardcoded address that is on the last byte of a page, throw a warning.
@munshkr munshkr added the bug label Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant