flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Problem with TIMES and using a macro

Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
This won't compile:
Code:
macro foo {nop}
times 4 foo    
Obviously the "nop" is just a place holder for any useful macro, this is only an example. I know I can use REPT but I want the value "4" above to actually be a variable that depends on other code for it's value. Is there a trick to make this work or is this a bug?
Post 16 Dec 2005, 13:14
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7711
Location: Kraków, Poland
Tomasz Grysztar
"repeat" was implemented exactly for this reason.
Post 16 Dec 2005, 13:55
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17247
Location: In your JS exploiting you and your system
revolution
Oops, yeah, I forgot to mention that my current solution is using REPEAT. But it was just that TIMES looked nicer in the code. Anyhow it is not an important problem, just something I noticed.
Post 16 Dec 2005, 14:01
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7711
Location: Kraków, Poland
Tomasz Grysztar
I didn't see it as a problem when I was implementing it this way - the "times" is the just like any other assembler's directive or instruction, thus macros are not recognized inside it's arguments (you cannot do "rep foo", too) .
Post 16 Dec 2005, 14:50
View user's profile Send private message Visit poster's website 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.