diff --git a/exp.asm b/exp.asm index a545482..73e4a6b 100644 --- a/exp.asm +++ b/exp.asm @@ -727,6 +727,7 @@ addr dc a'EndExp' $00 End * shiftFlag - 1 if the value is shifted, else 0 * shiftValue - expression result before shifting * shiftCount - shift counter +* symbolRelocatable - non-zero if sym is relocatable * returns the value of the expression * **************************************************************** diff --git a/linker.notes b/linker.notes index 9f2c539..dbd56c6 100644 --- a/linker.notes +++ b/linker.notes @@ -10,6 +10,9 @@ Updated 2022 2. A load segment is now flagged as position-independent only if 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 address calculation for a BRL instruction if it branched forward or backward more than 32 KB. Since the address diff --git a/symbol.asm b/symbol.asm index eccdb34..319f492 100644 --- a/symbol.asm +++ b/symbol.asm @@ -845,15 +845,10 @@ gb3 ldy #symPriv if sym^.symPriv then sv1 ldy #symExp if the value is an expression then lda [sym],Y jeq sv2 - ph2 copiedExpression save volitile variables + ph2 copiedExpression save volatile variables ph4 shiftCount ph2 shiftFlag ph4 shiftValue - ph2 symbolCount - ph2 symbolLength - ph2 symbolRelocatable - ph2 symbolType - ph4 symbolValue ldy #symVal+2 evaluate the expression lda [sym],Y pha @@ -875,12 +870,7 @@ sv1a lda symbolRelocatable if the symbol is relocatable then ldy #symSeg set the expression file lda [sym],Y sta expSegment -sv1c pl4 symbolValue restore volitile variables - pl2 symbolType - pl2 symbolRelocatable - pl2 symbolLength - pl2 symbolCount - pl4 shiftValue +sv1c pl4 shiftValue restore volatile variables pl2 shiftFlag pl4 shiftCount pl2 copiedExpression