Skip to contentSkip to conversation

non-constant in current section subtraction???

DISCUSSION [email protected] 1 participant 1 message Apr 26, 2002

lore
Share & tools
lore
#0 lore raw

I'm having some trouble with the GNU assembler and the special '.' symbol. The following code is an example:

LABEL1:
some stuff
more stuff

VAR1 = . - LABEL1
.IF (VAR1)
do something

.ENDIF

The dot symbol should give me the current location in memory, which is a non-constant. However, the difference between the . and label1 (assuming they're in the same section) is a constant. Why do I get a "non-constant expression in if statement" error when I try to do this. I've tried working the assembler source code a bit and making X_op = O_constant when you do the subtraction, but that seems to screw things up and give everything a value of 0. Without the hack, I get the right values, but they're just not constant. Has anyone ran into this before? I'd appreciate any help I can get. Thanks,

Brian

**********************************************************************
This e-mail and any files transmitted with it are confidential and may be legally privileged or otherwise exempt from disclosure under applicable law. This e-mail and its files are intended solely for the individual or entity to whom they are addressed and their content is the property of Smiths Aerospace. If you are not the intended recipient, please do not read, copy, use or disclose this communication. If you have received this e-mail in error please notify the e-mail administrator at [email protected] and then delete this e-mail, its files and any copies.

This footnote also confirms that this e-mail message has been scanned for the presence of known computer viruses.
***********************************************************************