flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Can you add simple but useful macro future?

Author
Thread Post new topic Reply to topic
halyavin



Joined: 21 Aug 2004
Posts: 42
halyavin
In MASM you can write x&&y and you will get x&y. Can you do this in fasm? I want that word######word1 would converted to word#####word1 - it will help write embedded macros. (You can't use symbol # in them now)
And probably one bug. When I write
Code:
macro something a
{
  if (offs<0)
    macro isoffs x
    %_
        isoffs x
        if (x eq a)
           offs=offs+4
        end if
    _%
  else
   macro isoffs x
   %_
      isoffs x
      display 'error',13,10
   _%
  end if
}
%_ fix {
_% fix }
    

It seems as both macro definitions are applied. (I don't know precisely because fasm hasn't correct listing now) I can solve this problem in my case but anyway...
Post 21 Aug 2004, 04:35
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
"if" is an assembler directive and it cannot affect preprocessor's features, as they are already processed when at assembly stage - see the third question in FAQ.

Also, see this thread: http://board.flatassembler.net/topic.php?t=492 for some solution.
Post 21 Aug 2004, 06:05
View user's profile Send private message Visit poster's website Reply with quote
halyavin



Joined: 21 Aug 2004
Posts: 42
halyavin
Thank you for explanation but how about first feature? I think it is doesn't difficult to add. But it open more simply ways to create complicated macros.
Post 23 Aug 2004, 16:51
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
You can still do the same with "fix" directive, it's more universal - that's why it was chosen for fasm's syntax. However your idea makes dealing with embedded concatenations simpler and more clear, so I consider adding it in next release.
Post 23 Aug 2004, 16:56
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
Works like a charm, you will have it in 1.55
Post 23 Aug 2004, 17:18
View user's profile Send private message Visit poster's website Reply with quote
halyavin



Joined: 21 Aug 2004
Posts: 42
halyavin
Thank you very much. This feature decreases number of 'fix' directives which can influence to each other. Cool
Post 28 Aug 2004, 14:11
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 YouTube, Twitter.

Website powered by rwasa.