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 directive breaks .adr operator #22

Open
phaeron1024 opened this issue Jun 18, 2023 · 1 comment
Open

.ds directive breaks .adr operator #22

phaeron1024 opened this issue Jun 18, 2023 · 1 comment

Comments

@phaeron1024
Copy link

Labels declared with separate load and run addresses via the ORG directive no longer have the correct aliased address after a .ds directive, breaking the .adr operator on those labels.

Repro code:

        org     $2000

        lda     r1
        lda     r2
        lda     r3
        lda     .adr r1
        lda     .adr r2
        lda     .adr r3

        org     0,$4000
r1:
        nop
r2:
        .ds     1
r3:

Listing output:

mads 2.1.5 build 3 (21 Feb 22)
Source: ds.s
     1                                  org     $2000
     2
     3 FFFF> 2000-200D> A5 00           lda     r1
     4 2002 A5 01                       lda     r2
     5 2004 A5 02                       lda     r3
     6 2006 AD 00 40                    lda     .adr r1
     7 2009 AD 01 40                    lda     .adr r2
     8 200C A5 02                       lda     .adr r3
     9
    10 200E                             org     0,$4000
    11 0000                     r1:
    12 4000-4000> EA                    nop
    13 0001                     r2:
    14 = 0001                           .ds     1
    15 0002                     r3:

After the .ds directive, r3 and .adr r3 have the same address. This is apparently because .ds resets both ORG addresses to be the same instead of maintaining the offset.

@tebe6502
Copy link
Owner

tebe6502 commented Aug 7, 2023

after changing the assembly address of the .PROC, .LOCAL block, it is not possible to use the .DS directive

mads.pas, listing line: 10969

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

2 participants