flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Main > Counter in macro. How do? | 
  
| Author | 
  | 
              
| 
                  
                   Roman 17 Jul 2013, 12:03 
                  New problem.
 
                  
                Count2 work. But if we have this: 2-2*2-3*4 We get Count2 =8 it right. But in 2-2*2-3*4 we have another mul and number first mul = 4. How restore or what do to have in Count2 two numbers. I mean Coun2=8 and after restore (but restore Count2 not work !) have Count2=4.  | 
              |||
                  
  | 
              
| 
                  
                   baldr 17 Jul 2013, 12:50 
                  Roman,
 
                  
                Fourth operation or fourth token? Because latter is as much as fasm preprocessor can give you (without efforts; I mean parenthesized subexpressions). You should mix assembler and preprocessor features in proper proportions to get something edible. Here is my shot at that: Code: struc reequ value { restore . . equ value } struc eval expr { rept 1 expr': expr \{ . reequ expr' \} } struc parse expr { .count equ 0; assume failure local _duke; somewhat higher than count P.S. This indeed belongs to Macroinstructions, maybe moderators will move it there.  | 
              |||
                  
  | 
              
| 
                  
                   Roman 17 Jul 2013, 13:27 
                  baldr
 
                  
                Thanks ! But you say "you need to stop assignment if .count!=0" This is sad, because it complicates. This is no good for me. Sad Once again convinced that the macro Fasm, for such things is not calculated for such tasks  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.