flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How to use blank prefix parameters inside macros?

Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 30 Apr 2006, 17:14
How to use blank prefix parameters inside macros?
Code:
macro foo prefix {
        call    prefix#func
}

func:   ret
x_func: ret

foo x_
foo     ;<-- assembles to "callfunc" and gives error    
Post 30 Apr 2006, 17:14
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 01 May 2006, 04:15
Sorry to reply to myself.

I am currently getting around the problem like this:
Code:
macro foo prefix {
    match x,prefix#func \{
        call    x
    \}
}

func:   ret
x_func: ret

foo x_
foo    
But I am not happy about how it looks with the extra match in there.

Does anyone have another, clearer, way around this problem? Or am I just plain stupid and missing something obvious?
Post 01 May 2006, 04:15
View user's profile Send private message Visit poster's website Reply with quote
chris



Joined: 05 Jan 2006
Posts: 62
Location: China->US->China->?
chris 02 May 2006, 07:00
try this one, use conditional assembling.

Code:
macro foo prefix {
        if prefix eq
          call func
        else
          call  prefix#func
        end if
} 

func:   ret
x_func: ret

foo x_
foo     
    
Post 02 May 2006, 07:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 02 May 2006, 07:29
Quote:
use conditional assembling
Thanks for the suggestion. It still looks untidy, but I think that is a little bit clearer than the match.
Post 02 May 2006, 07:29
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.