flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Interesting idea for macro repetition

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 11 May 2005, 11:43
First, this would require using "fix" where it's not needed currently - breaking backward compatibility. Also what vid proposed allows to avoid fixes at all in all types of such definitions.

Second, it would cause even more problems with symbols like "forward" - if they were affected by "current level" of braces, you wouldn't be able to use the higher level "forward" for the contents of inner macro.

With the backlashes solution you just write "\forward", "\\forward" etc. for different levels.
Post 11 May 2005, 11:43
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 11 May 2005, 12:12
Privalov wrote:
With the backlashes solution you just write "\forward", "\\forward" etc. for different levels.


Well, this approach is really good enough for everything. And even more, it improves the readability. Combined with preprocessor repetition and conditional preprocessing, it will simplify complex macroses a lot.

Regards
Post 11 May 2005, 12:12
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 11 May 2005, 13:28
Privalov wrote:
I'm attaching the modified preprocessor module that has it.


Will you include these in the next release? AND/OR the fasm documentation?

_________________
It is better to be on the right side of the devil than in his path.
Post 11 May 2005, 13:28
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 11 May 2005, 13:35
Yes, better solution. Backlashes provide an immediate visual indication of the level concerned.
Post 11 May 2005, 13:35
View user's profile Send private message Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 12 May 2005, 17:30
great work, i love it
Post 12 May 2005, 17:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 24 May 2005, 11:29
Great, but there is only 1 question remaining to me:

Will this just remove all of the
Code:
_% %_ _local _common _forward _reverse    
crap we used to use a lot in fasm? You now, they will become pretty superfluous, because stuff like this:
Code:
macro SomeMacro
{

 macro Inner
 _%
  SomeStuff
 %_

 SomeStuff
}

_% fix {
%_ fix }
    


would become
Code:
macro SomeMacro
{

 macro Inner
 {
  SomeStuff
 /}

 SomeStuff
}
    

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 24 May 2005, 11:29
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 24 May 2005, 12:56
Yes, those fixes are already removed from the standard Win32 includes, replaced with the new solution.
Post 24 May 2005, 12:56
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: 20454
Location: In your JS exploiting you and your system
revolution 25 May 2005, 06:58
I tried the example from the documentation but get "Error: unexpected characters." when assembling.

Code:
 rept 5 { in al,dx } 
    


It can be made to assemble with the addition of a variable name

Code:
 rept 5 v { in al,dx } 
    
Post 25 May 2005, 06:58
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 25 May 2005, 08:28
My stupid mistake, fixed now.
Post 25 May 2005, 08:28
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: 20454
Location: In your JS exploiting you and your system
revolution 26 May 2005, 03:07
The code below causes FASM 1.61.7 to crash.

Code:
rept 1 {macro foo [arg] \{ \common nop \} }
foo test
    


The same thing, but with one extra line feed is okay.

Code:
rept 1 {macro foo [arg] \{
\common nop \} }
foo test
    
Post 26 May 2005, 03:07
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 26 May 2005, 07:06
Another fix... I must have been sleepy when writing this...
Post 26 May 2005, 07:06
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:  
Goto page Previous  1, 2, 3

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.