.ds directive breaks .adr operator
Opened this issue · 1 comments
phaeron1024 commented
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 commented
after changing the assembly address of the .PROC, .LOCAL block, it is not possible to use the .DS directive
mads.pas, listing line: 10969