flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Not enough actual parameters

Author
Thread Post new topic Reply to topic
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 17 Apr 2012, 22:26
For example, I need a macroincstuction for debug output:
Code:
macro DebugOut v1, v2 
...
    

And I need 2 parameters: a value to output (v1) and color (v2). But sometimes I become very lazy and I don't want to write color. Does FASM support some features for assemblying with default parameter value? Now I have to use this:
Code:
...
 if ~('c'#v2 eq 'c')
   mov   cl, v2
  else
   mov   cl, clWhite
  end if
...
    

It works,
Code:
DebugOut rax, clRed
DebugOut rax
    

but I hope there is another way.Smile

_________________
jmp $ ; Happy end!
Post 17 Apr 2012, 22:26
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 17 Apr 2012, 22:32
fasm's manual, section 2.3.3 wrote:
(...) you can provide the default value for argument, by placing the = followed by value after the name of argument. Then if the argument has an empty value provided, the default value will be used instead.
Post 17 Apr 2012, 22:32
View user's profile Send private message Visit poster's website Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 17 Apr 2012, 22:38
Oh, thanks. I've read russian translation of this document. Probably it is too old, because I didn't find this information here.
Post 17 Apr 2012, 22:38
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.