flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > forward referenced EQU

Author
Thread Post new topic Reply to topic
alexfru



Joined: 23 Mar 2014
Posts: 80
alexfru 08 Jun 2015, 00:34
Code:
; fasm equ test
; file: fabs.asm
; assemble (with fasm 1.71.22): fasm fabs.asm fabs.o
format elf

bar equ 0xffff
mov eax, bar

mov eax, foo ; error: undefined symbol 'foo'.
foo equ 0x1234
    


This produces an error, but many assemblers support such EQUs.
Could this be supported in FASM as well?
Post 08 Jun 2015, 00:34
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20520
Location: In your JS exploiting you and your system
revolution 08 Jun 2015, 00:59
Change EQU to equals (=) and then you can forward reference it.

EQU is processed at the preprocessor stage and that is not multi-pass so forward referencing EQU is not possible.
Post 08 Jun 2015, 00:59
View user's profile Send private message Visit poster's website Reply with quote
alexfru



Joined: 23 Mar 2014
Posts: 80
alexfru 08 Jun 2015, 01:10
Thanks, = does the trick!
Post 08 Jun 2015, 01:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.