flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Number of macro arguments

Author
Thread Post new topic Reply to topic
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 14 Sep 2004, 15:04
When a macro accepts variable arguments how do i determine the number of macro arguments passed?

_________________
silkodyssey
Post 14 Sep 2004, 15:04
View user's profile Send private message MSN Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 14 Sep 2004, 16:54
quick dirty solution:
Code:
macro count [arg] {
common
  __ARGC = 0
forward
  __ARGC = __ARGC+1
common
  display __ARGC+'0'
}

count a, b, c, d, e, f, g    


it will display number of arguments (in this case "7").
Post 14 Sep 2004, 16:54
View user's profile Send private message Visit poster's website Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 14 Sep 2004, 18:20
The solution gets the job done thanks. Smile

_________________
silkodyssey
Post 14 Sep 2004, 18:20
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.