flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > use "EQU" constant as procedure name

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 201
use "EQU" constant as procedure name
Hi,

I'm struggling using a constant (defined with EQU or "=") as function name. Example:


Code:

FUNCTION_NAME = FunctionPoly1

macro POLY_FUNCTION 
{
    proc FUNCTION_NAME 

        mov     eaxeax 
        ret

    endp
}


.code 

POLY_FUNCTION





But I get the following error:

FASM: error : undefined symbol 'FunctionPoly1'

Is it possible to do a similar approach? Where I defined a CONSTANT and it will be used as function name?

Thanks!
[/i]
Post 06 Jan 2017, 19:16
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6517
Location: Kraków, Poland
If you use EQU instead of "=" it should work correctly. An EQU defines a textual substitution.
Post 06 Jan 2017, 19:20
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 201
Hi Tomasz,

Thanks a lot! Sorry, I tried before with EQU and it failed (I think I had another syntax error). I have tried with EQU and it works perfect! Sorry, my bad!

Thanks!!
Post 06 Jan 2017, 19:22
View user's profile Send private message Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 588

Code:
macro f {
  display 'f'
  f equ g
}
h equ g
macro g {
  display 'g'
}
f
f
h 


I got "Illegal instruction" at "g"?
Post 20 Jan 2017, 09:34
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.