Skip to content

Fix and improve debugging for relative addresses#11

Open
binary-sequence wants to merge 1 commit intowutka:mainfrom
binary-sequence-forks:fix-debug-rel-addr
Open

Fix and improve debugging for relative addresses#11
binary-sequence wants to merge 1 commit intowutka:mainfrom
binary-sequence-forks:fix-debug-rel-addr

Conversation

@binary-sequence
Copy link
Contributor

@binary-sequence binary-sequence commented May 11, 2025

Sample program to reproduce:
0: A9 FF 30 FC

                            * = $0000
0000   A9 FF      LOOP      LDA #$FF
0002   30 FC                BMI LOOP
                            .END
  1. Type in program
  2. Start debugger (CTRL-D)
  3. See disassembled output for 30 FC

Before this fix (wrong)

pc = 0002  a=ff  x=00  y=01  sp=fd  status=N      C
0002: 30 fc     bmi $0100

After this fix (right)

pc = 0002  a=ff  x=00  y=01  sp=fd  status=N      C
0002: 30 fc     bmi -4  ; $0000

Sample program to reproduce:
`0: A9 FF 30 FC`

```
                            * = $0000
0000   A9 FF      LOOP      LDA #$FF
0002   30 FC                BMI LOOP
                            .END
```

1. Type in program
2. Start debugger (CTRL-D)
3. See disassembled output for `30 FC`

Before this fix (wrong)
```
pc = 0002  a=ff  x=00  y=01  sp=fd  status=N      C
0002: 30 fc     bmi $0100
```

After this fix (right)
```
pc = 0002  a=ff  x=00  y=01  sp=fd  status=N      C
0002: 30 fc     bmi -4  ; $0000
```
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

Successfully merging this pull request may close these issues.

1 participant