Forum
conflict between "label EQU" and "#DEFINE label"? - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15)
+---- Thread: conflict between "label EQU" and "#DEFINE label"? (/showthread.php?tid=204)



conflict between "label EQU" and "#DEFINE label"? - programandala.net - 04-18-2010

I got the following error:

Quote:random.asm:10: Error: Syntax error. Unexpected token '23672' [INTEGER]

I took a look at the random.asm library. Lines 10 are 11 are the following:

Code:
    LOCAL TAKE_FRAMES
    LOCAL FRAMES

And line 31:

Code:
FRAMES EQU    23672

So I suspected the problem had something to do with this line of my program:

Code:
#define FRAMES 23672

I defined FRAMES because I use it for several calculations.

I was right: I renamed it MYFRAMES and the error didn't happen again.

Does it means the EQU assembler labels conflict with #DEFINEd labels?


Re: conflict between "label EQU" and "#DEFINE label"? - boriel - 04-18-2010

programandala.net Wrote:I got the following error:

Quote:random.asm:10: Error: Syntax error. Unexpected token '23672' [INTEGER]

I took a look at the random.asm library. Lines 10 are 11 are the following:

Code:
    LOCAL TAKE_FRAMES
    LOCAL FRAMES

And line 31:

Code:
FRAMES EQU    23672

So I suspected the problem had something to do with this line of my program:

Code:
#define FRAMES 23672

I defined FRAMES because I use it for several calculations.

I was right: I renamed it MYFRAMES and the error didn't happen again.

Does it means the EQU assembler labels conflict with #DEFINEd labels?
That's right. But it's a bug in the RANDOM.ASM file, since it's possible to define local labels using PROC end ENDP as in Pasmo assembler.
I will fix it too.

Update: I was wrong. Random.asm file is Ok. This name collision should not happend since the #define only affects at 1st compiler stage. I will try to debug this...