flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Macroinstructions > How to display macro parameter | 
  
| Author | 
  | 
              
| 
                  
                   Jin X 03 Sep 2023, 10:56 
                  Code: macro x i*& { display `i } i mov ax,bx How to display it correctly?  | 
              |||
                  
  | 
              
| 
                  
                   revolution 03 Sep 2023, 12:52 
                  You need to iterate over the arguments.
 
                  
                Try using irps in the x macro and put display inside irps.  | 
              |||
                  
  | 
              
| 
                  
                   Roman 03 Sep 2023, 20:53 
                  And ignoring  command mov eax, [ebx+5]
 
                  
                Very interesting what is mean i*& in macro x ?  | 
              |||
                  
  | 
              
| 
                  
                   revolution 03 Sep 2023, 22:45 
                  Jin X wrote: Can I improve it somehow? Code: macro x i& { irps a, i \{ display \`a \# ' ' \} } x mov eax, [ebx+5]  | 
              |||
                  
  | 
              
| 
                  
                   Roman 04 Sep 2023, 09:49 
                  I try this but not work.
 
                  
                Code: macro x i*& { irps a, i \{ if \`a = ' ' display \`a \# ' ' end if display \`a \} } x mov eax,10 I get text moveax,10. But i want get text mov eax,10 Fasm it is more magic than logic  | 
              |||
                  
  | 
              
| 
                  
                   revolution 04 Sep 2023, 11:08 
                  It might make it more clear what irps does if you try this     
                  
                Code: macro x i& { irps a, i \{ display '{',\`a,'}',13,10 \} }  | 
              |||
                  
  | 
              
| 
                  
                   Roman 04 Sep 2023, 11:42 
                  I do this !
 
                  
                Code: macro x i*& { irps a, i \{ if \`a = ':' display ' ' else display \`a end if \} } ;in code x mov:eax,:[ebx+5] I get text: mov eax, [ebx+5]  | 
              |||
                  
  | 
              
| 
                  
                   Roman 04 Sep 2023, 11:49 
                  Idea !
 
                  
                Some fasm extra commands like irps, must have user setup parameters ! For flexible using irps ! For example Code: irps.p1:':' ;This mean irps ignored symbol ':' irps.p2:' ' ;this mean irps not ignored spaces, and perceives space as a separate element ;Or this irps.ignr:':' irps.sep:' '  | 
              |||
                  
  | 
              
| 
                  
                   Jin X 04 Sep 2023, 15:12 
                  As a solution. This displays only instruction name
 
                  
                Code: macro x i*& { match a b,i+ \{ display \`a \} } x mov eax, [ebx+5] P.S. Roman, RTFM for * and &  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.