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

Problem with JMP instruction #6

Open
dbuchwald opened this issue Jan 10, 2020 · 0 comments
Open

Problem with JMP instruction #6

dbuchwald opened this issue Jan 10, 2020 · 0 comments

Comments

@dbuchwald
Copy link

Hello,

Consider the following code:

.org 8000 loop: jmp loop

This will translate to 4c 00 80 and will not be properly executed by the emulator, because of this part of the code:

if (m->pc == pc_start) { m->pc += pc_offset; }

x6502/emu.c

Line 73 in 5a3c040

if (m->pc == pc_start) {

This line checks if new PC was set during execution of the last instruction, and if it wasn't, moves to next instruction. The thing is, that in this particular scenario PC was set, but to the same value as previously, so it's not detected correctly.

I fixed this in my fork of x6502 - but it deviated too far to create pull request, so check my commit instead:

dbuchwald@21361c3

Ignore paths starting with samples/ and check the src/ instead.

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

1 participant