flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Different variable types in a group of macro arguments

Author
Thread Post new topic Reply to topic
RIxRIpt



Joined: 18 Apr 2013
Posts: 50
RIxRIpt
How to make/fix macro A (which is below) so it would accept a group of arguments that could be parsed by different macroses (B and C)? I'm stuck on a point where I cannot pass label(address of variable) to macros A with prefix "p=" (i.e. A label1, const1, const2, p=label2, const3) FASM Displays the error: undefined symbol 'label2'.

Code:
macro A v1, [vg] {
  common
  if ~ vg eq
    reverse
      define matched +
      define matched -
      match =p==value,vg \{
        B value
        restore matched
      \}
      match -,matched \{
        C vg
        restore matched
      \}
      restore matched
    common
  end if
  ;Do smth with value v1
}

macro B v {
  ;Do smth with value v
}

macro C v {
  ;Do smth with value v
}    


I've also tried to implement this without match checking the type of argument using eqtype [0], by passing label2 to macro A like [label2]

P.S. This question has been also asked here.
P.P.S. Is it possible to re-send confirmation email from this forums? (I registered here with nick riscript about 6 month ago, but didn't receive any confirmation email)

Edit:
endif -- sorry, it is "end if" in my code. (fixed here)[/b]


Last edited by RIxRIpt on 06 Aug 2013, 13:21; edited 1 time in total
Post 06 Aug 2013, 12:54
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: 17667
Location: In your JS exploiting you and your system
revolution
Can you please post some code showing exactly the error with a test invocation and definition of labels/constants.

We don't know what you have done, and we can't use the above code because it is incomplete.


Also "endif" does not compile at all. Is that a macro?
Post 06 Aug 2013, 13:05
View user's profile Send private message Visit poster's website Reply with quote
RIxRIpt



Joined: 18 Apr 2013
Posts: 50
RIxRIpt
I've found a problem. I didn't notice that that definition of "label2" was "Label2", that's why I got an error "undefined symbol"
I'm sorry for that, ty anyway Wink

You can close this topic.
Post 06 Aug 2013, 13:25
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.