Avoid spurious errors when evaluating EQU/GEQU expressions.

Shifting is now prohibited only for relocatable expressions. It is fine if a shift operator is used with constant operands, simply producing another constant.

Also, spurious errors about using multiple load segments in an expression are no longer reported just because of the load segment "containing" the EQU/GEQU record. Since it does not actually translate to anything in the load file, that segment does not matter.
This commit is contained in:
Stephen Heumann 2022-09-25 21:48:38 -05:00
parent da13b94a43
commit 9f232e883a
1 changed files with 5 additions and 9 deletions

View File

@ -859,17 +859,13 @@ sv1 ldy #symExp if the value is an expression then
jsr Evaluate jsr Evaluate
sta symbolValue save the value sta symbolValue save the value
stx symbolValue+2 stx symbolValue+2
lda shiftFlag if the value is shifted then
beq sv1a
ph4 name flag the error
ph2 #2
jsr Error
sv1a lda symbolRelocatable if the symbol is relocatable then sv1a lda symbolRelocatable if the symbol is relocatable then
beq sv1c beq sv1c
jsr CheckSegment check for errors lda shiftFlag if the value is shifted then
ldy #symSeg set the expression file beq sv1c
lda [sym],Y ph4 name flag the error
sta expSegment ph2 #2
jsr Error
sv1c pl4 shiftValue restore volatile variables sv1c pl4 shiftValue restore volatile variables
pl2 shiftFlag pl2 shiftFlag
pl4 shiftCount pl4 shiftCount