flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Get number from equ list names

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1885
Roman 24 Sep 2024, 05:43
I want get number Fasmw 1.73
Code:
List equ copy callnz undo reset ;without comma only spaces
Macro mA1 { Inc eax} 
Macro mA2 { call eax} 
Macro mA3 { mov eax, ebx} 
Macro mA4 { xor eax, eax} 

Macro GetNum a,list, doMacro {...
doMacro#num} 
;in code 
GetNum undo,List, mA
    


Last edited by Roman on 24 Sep 2024, 06:41; edited 2 times in total
Post 24 Sep 2024, 05:43
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1885
Roman 24 Sep 2024, 06:32
I do this, but problem with number macro
Code:
macro GetNum name,list,m { num equ 0
      irpv v,list \{ irps c,v \\{  
      rept 1 n:num+1 \\\{ num equ n \\\}
      if c eq name
         display num+48
         display ' find',13,10
         m\\\#\num ;fasm error mA#3
      end if
      \\} \}
      } 
    
Post 24 Sep 2024, 06:32
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1885
Roman 24 Sep 2024, 06:38
I done !
Code:
macro GetNum name,list,m { num equ 0
      irpv v,list \{ irps c,v \\{ 
      ;rept 1 n:num+1 \\\{ num equ n \\\} ;this work
      num equ num+1 ;this work too
      if c eq name              
         rept 1 n:num \\\{ m\\\#n  
;my question, how store in equ n value? 
;if I do num2 equ n I get not correct number
\\\}
      end if
      \\} \}
      }
    
Post 24 Sep 2024, 06:38
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.