flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Ignored prevision macro, how do this ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1718
Roman 03 Jun 2023, 10:51
Fasmw 1.73
Code:
Ignor_flg = 1
rept Ignor_flg { some code or some macros }
...some code
MacroA ;calculating some values and changed Ignor_flg to 0 or 1
            ;now I want ignoring rept if macroA set Ignor_flg = 0
    
Post 03 Jun 2023, 10:51
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20210
Location: In your JS exploiting you and your system
revolution 03 Jun 2023, 11:10
Code:
Ignor_flg equ 1    
But that won't work due to the single pass preprocessor.

Put a if/end if inside the macro.
Post 03 Jun 2023, 11:10
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1718
Roman 03 Jun 2023, 12:00
Quote:

Put a if/end if inside the macro.

Its work if I do first macroA set Ignor_flg equ 1
Than do second macroB check if Ignor_flg = 1

I want different way.
Code:
MacroB
Some code
MacroA    
Post 03 Jun 2023, 12:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20210
Location: In your JS exploiting you and your system
revolution 03 Jun 2023, 12:35
Use equ for preprocessor stage. Can't be forward referenced.

Use = for assembler stage. Can be forward referenced, but only for a single assignment. IF you have multiple assignments then you can't forward reference.
Post 03 Jun 2023, 12:35
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1718
Roman 03 Jun 2023, 15:59
revolution wrote:
Use equ for preprocessor stage. Can't be forward referenced.

Use = for assembler stage. Can be forward referenced, but only for a single assignment. IF you have multiple assignments then you can't forward reference.

Hm.
Did I can write my new pass(after preprocessor stage) in fasm source code ?
And how hard implemented it to fasm ?
Post 03 Jun 2023, 15:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20210
Location: In your JS exploiting you and your system
revolution 03 Jun 2023, 16:31
Use only a single assignment.
Code:
;Ignor_flg = 0 ; <--- don't put an assignment here!
rept { ; <--- are you sure you want rept? "if" by itself should be fine.
 if ~ Ignor_flg
  ;...
 end if
}
;...
Ignor_flg = 1 ;  <---use only one assignment
;Ignor_flg = 0 ; <--- don't put a second assignment here!    
Post 03 Jun 2023, 16:31
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1718
Roman 03 Jun 2023, 17:00
Code:
macro mcAA p {
if p = 1
Ignor_flg1 = p
end if
}
 
            if ~defined Ignor_flg1
               inc ebp
               display 'uuu;;'
            end if
...some code
            mcAA 0 ;0=do inc ebp.  1=not do inc ebp

    
Post 03 Jun 2023, 17:00
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.