Properly evaluate non-constant expressions in EQU/GEQU records.
Previously, the values of such expressions were essentially ignored, resulting in incorrect output. This affected code like the following example: test1 start lda >p rtl end D1 data p gequ val end val data dc i'123' end Note that the EQU/GEQU expression is evaluated within the context of the location that references it, not the location where it is defined. This affects the value of the location counter, as well as the symbol search behavior. The references for the OMF format do not clearly define which way this should be done, but the current behavior can cause problems with certain object files produced by ORCA/M.
This commit is contained in:
parent
0b275e5b22
commit
da13b94a43
1
exp.asm
1
exp.asm
|
@ -727,6 +727,7 @@ addr dc a'EndExp' $00 End
|
||||||
* shiftFlag - 1 if the value is shifted, else 0
|
* shiftFlag - 1 if the value is shifted, else 0
|
||||||
* shiftValue - expression result before shifting
|
* shiftValue - expression result before shifting
|
||||||
* shiftCount - shift counter
|
* shiftCount - shift counter
|
||||||
|
* symbolRelocatable - non-zero if sym is relocatable
|
||||||
* returns the value of the expression
|
* returns the value of the expression
|
||||||
*
|
*
|
||||||
****************************************************************
|
****************************************************************
|
||||||
|
|
|
@ -10,6 +10,9 @@ Updated 2022
|
||||||
2. A load segment is now flagged as position-independent only if
|
2. A load segment is now flagged as position-independent only if
|
||||||
all the constituent object segments have that attribute set.
|
all the constituent object segments have that attribute set.
|
||||||
|
|
||||||
|
3. Fixed bug that caused EQU or GEQU expressions with non-constant
|
||||||
|
operands to be evaluated incorrectly.
|
||||||
|
|
||||||
2.0.6 1. The linker could give a spurious error about the relative
|
2.0.6 1. The linker could give a spurious error about the relative
|
||||||
address calculation for a BRL instruction if it branched
|
address calculation for a BRL instruction if it branched
|
||||||
forward or backward more than 32 KB. Since the address
|
forward or backward more than 32 KB. Since the address
|
||||||
|
|
14
symbol.asm
14
symbol.asm
|
@ -845,15 +845,10 @@ gb3 ldy #symPriv if sym^.symPriv then
|
||||||
sv1 ldy #symExp if the value is an expression then
|
sv1 ldy #symExp if the value is an expression then
|
||||||
lda [sym],Y
|
lda [sym],Y
|
||||||
jeq sv2
|
jeq sv2
|
||||||
ph2 copiedExpression save volitile variables
|
ph2 copiedExpression save volatile variables
|
||||||
ph4 shiftCount
|
ph4 shiftCount
|
||||||
ph2 shiftFlag
|
ph2 shiftFlag
|
||||||
ph4 shiftValue
|
ph4 shiftValue
|
||||||
ph2 symbolCount
|
|
||||||
ph2 symbolLength
|
|
||||||
ph2 symbolRelocatable
|
|
||||||
ph2 symbolType
|
|
||||||
ph4 symbolValue
|
|
||||||
ldy #symVal+2 evaluate the expression
|
ldy #symVal+2 evaluate the expression
|
||||||
lda [sym],Y
|
lda [sym],Y
|
||||||
pha
|
pha
|
||||||
|
@ -875,12 +870,7 @@ sv1a lda symbolRelocatable if the symbol is relocatable then
|
||||||
ldy #symSeg set the expression file
|
ldy #symSeg set the expression file
|
||||||
lda [sym],Y
|
lda [sym],Y
|
||||||
sta expSegment
|
sta expSegment
|
||||||
sv1c pl4 symbolValue restore volitile variables
|
sv1c pl4 shiftValue restore volatile variables
|
||||||
pl2 symbolType
|
|
||||||
pl2 symbolRelocatable
|
|
||||||
pl2 symbolLength
|
|
||||||
pl2 symbolCount
|
|
||||||
pl4 shiftValue
|
|
||||||
pl2 shiftFlag
|
pl2 shiftFlag
|
||||||
pl4 shiftCount
|
pl4 shiftCount
|
||||||
pl2 copiedExpression
|
pl2 copiedExpression
|
||||||
|
|
Loading…
Reference in New Issue