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 > Compiler Internals > macro argument angle brackets - bug?

Author
Thread Post new topic Reply to topic
Mike Gonta



Joined: 26 Dec 2010
Posts: 202
macro argument angle brackets - bug?

fasmg manual wrote:
If an argument to macroinstruction needs to contain a comma character, the
entire argument must be enclosed between the "<" and ">" characters (they do
not become a part of the value). If another "<" character is encountered inside
such value, it must be balanced with corresponding ">" character inside the
same value.

Nested angle brackets is an Error: invalid expression.

Code:
  some_macro <1,<2,3>>

fasmg hxhsr and fasm 1.71.64.

_________________
Mike Gonta
look and see - many look but few see

http://mikegonta.com
Post 27 Sep 2017, 17:47
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
This works with no problem for me:

Code:
macro some_macro arg
        display `arg
end macro

some_macro <1,<2,3>>


Code:
flat assembler  version g.hxhsr
1,<2,3>
1 pass0 bytes.



The nesting is only needed when there is another, deeper layer of macros that need inner enclosing. This is how it works:

Code:
macro some_macro arg
        outer_list_macro arg
end macro

macro outer_list_macro args&
        iterate argargs
                inner_list_macro arg
        end iterate
end macro

macro inner_list_macro args&
        display 'inner list: ',`args,13,10
        iterate argargs
                db arg
        end iterate
end macro


some_macro <1,<2,3>>

Post 27 Sep 2017, 19:04
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


Powered by phpBB © 2001-2005 phpBB Group.

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