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

The v6502 disassembly command is displaying incorrect values #1

Open
jmlayman opened this issue Nov 7, 2020 · 0 comments
Open

The v6502 disassembly command is displaying incorrect values #1

jmlayman opened this issue Nov 7, 2020 · 0 comments

Comments

@jmlayman
Copy link

jmlayman commented Nov 7, 2020

Hi - commit 11d86f1 seems to have introduced a regression in the v6502 disassembly command. Here's a disassembly of the snake.o object file using this commit:

(0x600) dis
0x0600: 20 06 06 - jsr $0606
0x0603: 20 38 06 - jsr $3806
0x0606: 20 0d 06 - jsr $0d06
0x0609: 20 2a 06 - jsr $2a06
0x060c: 60 - rts
0x060d: a9 02 - lda #$85
0x060f: 85 02 - sta *$a9
0x0611: a9 04 - lda #$85
0x0613: 85 03 - sta *$a9
0x0615: a9 11 - lda #$85

Note how all the lda/sta instructions are displaying the opcode of the next instruction as their operand, even though the operand is correct in the hex listing.

Here's the same disassembly of snake.o with the previous commit (96079aa):

(0x600) dis
0x0600: 20 06 06 - jsr $0606
0x0603: 20 38 06 - jsr $0638
0x0606: 20 0d 06 - jsr $060d
0x0609: 20 2a 06 - jsr $062a
0x060c: 60 - rts
0x060d: a9 02 - lda #$02
0x060f: 85 02 - sta *$02
0x0611: a9 04 - lda #$04
0x0613: 85 03 - sta *$03
0x0615: a9 11 - lda #$11

Note how things line up correctly in this version.

The problem seems to only happen with the v6502 disassembly command - the disassembly from dis6502 is correct.

The machine used for this test is running Debian 10, kernel 4.19.0-12-amd64.

Let me know if I can be of further assistance.

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