flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Did Exist equ name like local label?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
Fasmw 1.73
I want get 4 equ names like this:
Code:
? Ref equ abc ;or using some magic macro genEq Ref
? Ref equ ar
? Ref equ 22
? Ref equ esi
    


This get me this eques.
Ref_1
Ref_2
Ref_3
Ref_4
I don't want do in code restore Ref.
In code I simple write:
Code:
 
mov edx, Ref_2;=ar
mov eax, Ref_1 ;=abc
    


Last edited by Roman on 28 Jun 2022, 18:47; edited 2 times in total
Post 28 Jun 2022, 07:17
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
I try this but not work.
Code:
macro genEq chE,Arrg* {
      if ~ defined tmp_cntEqss
      tmp_cntEqss equ 1
      end if
      chE#tmp_cntEqss equ Arrg
      tmp_cntEqss equ tmp_cntEqss+1
      }
                genEq Ref,Start
                genEq Ref,Start
                genEq Ref,Start
                mov eax,Ref2   ;fasm error undefined symbol Ref2
    
Post 28 Jun 2022, 08:17
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
I try this but not work.
Code:
macro genEq chE,Arrg& {
      if ~ defined tmp_cntEqss
      tmp_cntEqss = 1
      end if
      chE#tmp_cntEqss equ Arrg
      tmp_cntEqss = tmp_cntEqss+1
      display '0'+tmp_cntEqss,10,'\' ;I get 2\3\4\

      } 
                genEq Ref,Start
                genEq Ref,Start
                genEq Ref,Start
                mov eax,Ref2   ;fasm error undefined symbol Ref2
mov eax,Reftmp_cntEqss ;ok
    
Post 28 Jun 2022, 08:31
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.