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

.ds inside .rept does not work #31

Open
ivop opened this issue Oct 24, 2023 · 0 comments
Open

.ds inside .rept does not work #31

ivop opened this issue Oct 24, 2023 · 0 comments

Comments

@ivop
Copy link

ivop commented Oct 24, 2023

Hi,

It seems that the labels are not correctly assigned when I use .ds inside a repeat loop. Short program to demonstrate the problem:

Code:

    org $1000

    lda #$e5

    .rept 8,#+1
        sta foo:1
    .endr

    .rept 8,#+1
        sta bar:1
    .endr

    jmp *

; works

    .rept 8,#+1
foo:1 dta 0
    .endr

; does not work

    .rept 8,#+1
bar:1 .ds 0
    .endr

Output:

1000: A9 E5     LDA #$E5
1002: 8D 35 10  STA $1035
1005: 8D 36 10  STA $1036
1008: 8D 37 10  STA $1037
100B: 8D 38 10  STA $1038
100E: 8D 39 10  STA $1039
1011: 8D 3A 10  STA $103A
1014: 8D 3B 10  STA $103B
1017: 8D 3C 10  STA $103C
101A: 8D 3D 10  STA $103D    <---- and all below are the same address
101D: 8D 3D 10  STA $103D
1020: 8D 3D 10  STA $103D
1023: 8D 3D 10  STA $103D
1026: 8D 3D 10  STA $103D
1029: 8D 3D 10  STA $103D
102C: 8D 3D 10  STA $103D
102F: 8D 3D 10  STA $103D
1032: 4C 32 10  JMP $1032

Regards,
Ivo

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