From 9f232e883ac9695c2d37dbd4ee82744f9187f5fa Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 25 Sep 2022 21:48:38 -0500 Subject: [PATCH] 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. --- symbol.asm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/symbol.asm b/symbol.asm index 319f492..c5b4d44 100644 --- a/symbol.asm +++ b/symbol.asm @@ -859,17 +859,13 @@ sv1 ldy #symExp if the value is an expression then jsr Evaluate sta symbolValue save the value 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 beq sv1c - jsr CheckSegment check for errors - ldy #symSeg set the expression file - lda [sym],Y - sta expSegment + lda shiftFlag if the value is shifted then + beq sv1c + ph4 name flag the error + ph2 #2 + jsr Error sv1c pl4 shiftValue restore volatile variables pl2 shiftFlag pl4 shiftCount