flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Main > 32 bit string macro | 
  
| Author | 
  | 
              
| 
                  
                   revolution 05 Sep 2014, 06:16 
                  If you work through the string backwards then you won't need to copy the string to a temporary buffer. 
                  
                 | 
              |||
                  
  | 
              
| 
                  
                   l_inc 05 Sep 2014, 11:14 
                  redsock
 
                  As for your first issue, I totally support the revolution's suggestion. As for the second one, just put brackets around val* in your macro header. Almost forgot: and put the directive common in front of the local directive. _________________ Faith is a superposition of knowledge and fallacy  | 
              |||
                  
  | 
              
| 
                  
                   redsock 05 Sep 2014, 21:45 
                  Hah! Sometimes the simplest and most obvious ways to solve problems are the most elusive... haha, thx very kindly to both of you...
 
                  
                Here is the revised macro, much nicer: Code: macro cleartext name*, [val*] { common local .DAT,CC,I,Si,J align 16 name: dq CC .DAT: db val CC = ($ - .DAT) ; create filler for the diff db ((CC shl 2) - CC) dup 0 ; next up: walk backward through the string and promote it to 32bits I = CC - 1 J = I shl 2 repeat CC load Si byte from .DAT+I store dword Si at .DAT+J I = I - 1 J = J - 4 end repeat }  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.