Hi,
The following forward reference does not work:


; Code begins here:
chr_toUpper :
mov al, ;/* */
cmp al, 061h ;/* 'a' */
jnae L13_be__hla_
cmp al, 07ah ;/* 'z' */
jnbe L13_be__hla_
and al, 95
L13_false__hla_:
ret 4
xchr_toUpper__hla_:
;chr_toUpper endp

L13_be__hla_ equ L13_false__hla_


However, if I move the equ before the first usage, it
assembles fine, e.g.,

; Code begins here:
L13_be__hla_ equ L13_false__hla_

chr_toUpper :
mov al, ;/* */
cmp al, 061h ;/* 'a' */
jnae L13_be__hla_
cmp al, 07ah ;/* 'z' */
jnbe L13_be__hla_
and al, 95
L13_false__hla_:
ret 4
xchr_toUpper__hla_:
;chr_toUpper endp

I *think* I can fix this in my compiler, but intuition
suggests that FASM should be able to handle forward
references like this one (since it handles others so well).
Indeed, I would have guessed that an assembler would have
an easier time handling the original code rather than the
modified code. Oh well, something to consider...
Randy Hyde
Posted on 2003-01-25 12:08:49 by rhyde
Forward references are allowed for assembler-defined symbols only. "equ" is a preprocessor's operator, use "=" instead.
Posted on 2003-01-25 14:05:13 by Tomasz Grysztar

Forward references are allowed for assembler-defined symbols only. "equ" is a preprocessor's operator, use "=" instead.


Okay, that's good to know.
I actually solved the problem by outputting all the EQUs at the
beginning of the file (in an include, the same way I handle forward
references for some other assemblers).
But I'll keep this in mind.
Randy Hyde
Posted on 2003-01-25 19:13:47 by rhyde