flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > how can i determine if the macro is calling last ?

Author
Thread Post new topic Reply to topic
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
for example, i have macro.
i call it many times.
how can i determine inside macro if it called last?

who know russian can read here this question:
http://www.wasm.ru/forum/viewtopic.php?pid=140513#p140513
Post 02 Nov 2006, 14:29
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Not sure what you mean but I'll try to help

Code:
m.counter = 0
macro m {
  m.counter = m.counter + 1

  if m.counter = m.lastCounter
     display "this is the last call"
  end if
}

; ALL YOUR CODE

m.lastCounter = m.counter
    


That's what you need?
Post 02 Nov 2006, 14:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
if you mean, how to determine if macro is called LAST TIME, then that's the answer
Post 02 Nov 2006, 14:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
after the last макроса it is impossible use the code.
Post 02 Nov 2006, 14:55
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you mean to determine if macro is last thing in source?
i think that it isn't possible. maybe you could use some nasty trick to disable using generating any code or data behind last macro usage
Post 02 Nov 2006, 15:22
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
Quote:

you mean to determine if macro is last thing in source?



no.

i need some code, like LocoDelAssembly write, but without
m.lastCounter = m.counter
string at end.
all must be in macro.
Post 02 Nov 2006, 16:38
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
oh, you mean that it has to be known at preprocessing time.

unfortnutally it's AFAIK impossible, because preprocessor can't forward-reference.
Post 02 Nov 2006, 16:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.