flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > how nasm %define to fasm

Author
Thread Post new topic Reply to topic
dark_teo



Joined: 26 Jul 2005
Posts: 5
dark_teo
how convert nasm %define to fasm

example:
%define round(a, b) ((a+(b-1))/b)
dw round (5,10)


Last edited by dark_teo on 20 Oct 2011, 22:55; edited 1 time in total
Post 20 Oct 2011, 21:35
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Relation of preprocessor and assembler is big different in FASM, in order to simply say how to do "%define in FASM". As for your specific example, FASM doesn't really have "macros" per-se, only "macroinstructions", meaning you can't really make a inline macro in FASM. This is one of few quite nasty limitations of FASM, made for by few great features not found anywhere else. You can overload "dw" and other data directives to accept arguments in certain format, but you can't make a true inline macro.
Post 20 Oct 2011, 21:48
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dark_teo



Joined: 26 Jul 2005
Posts: 5
dark_teo
thanks
Post 20 Oct 2011, 21:55
View user's profile Send private message 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.