flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > NASM macro syntax emulation

Author
Thread Post new topic Reply to topic
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Here's a very simple macro that emulates the basic NASM syntax for the macros (can help to compile correctly the most of simple macros with fixed count of parameters, if someone needs to move code with lot of such macros from NASM to FASM):
Code:
macro %macro def
{
  match name pcount, def
  \{
     params@macro equ
     rept pcount c
     \\{
         match any, params@macro \\\{ params@macro equ params@macro,%\\#c \\\}
         match , params@macro \\\{ params@macro equ %\\#c \\\}
     \\}
     match params, params@macro \\{ macro name params { \\}
  \}
}

%endmacro fix }


; sample from NASM's manual:

%macro  prologue 1
        push    ebp
        mov     ebp,esp
        sub     esp,%1
%endmacro    
Post 09 Jul 2005, 08:29
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
New macrosyntax created with macros...
seems like writing FASM macros will soon become some kind of wicked humor.
Post 10 Jul 2005, 18:39
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
ly



Joined: 11 Oct 2005
Posts: 13
ly
Hi
What about macro locall lable as %% ?
ly
Post 11 Oct 2005, 18:27
View user's profile Send private message Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
i personally find the nasm macro system easier (because i was a c programmer first) but apparently the fasm macroinstructions are much more powerful :p

_________________
redghost.ca
Post 12 Oct 2005, 11:51
View user's profile Send private message AIM Address MSN Messenger 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.

Powered by rwasa.