flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Macroinstructions > Display directive | 
  
| Author | 
  | 
              
| 
                  
                   Tomasz Grysztar 17 Jul 2003, 20:20 
                  Code: macro __digit num { if num < 10 display '0'+num else display 'A'+num-10 end if } macro __display arg1,arg2 { if arg2 eq display arg1 else local ..tmp ..tmp = arg1 virtual at 0 repeat 32 if ..tmp > 0 db ..tmp mod arg2 ..tmp = ..tmp / arg2 end if end repeat repeat $ load ..tmp byte from $-% __digit ..tmp end repeat if $ = 0 display '0' end if end virtual end if } macro display [arg] { __display arg } ; And now the test: org 132Ah display "Offset: ",<$,16>,13,10  | 
              |||
                  
  | 
              
| 
                  
                   Tommy 18 Jul 2003, 09:39 
                   | 
              |||
                  
  | 
              
| 
                  
                   AdamMarquis 06 Aug 2003, 00:18 
                  Great example, I'll try to improve my macro writing style.
 
                  
                There's really power in there =)  | 
              |||
                  
  | 
              
| 
                  
                   VEG 05 May 2017, 14:12 
                  Tomasz Grysztar, do you have similar macro for the FASMG?  
                  
                 | 
              |||
                  
  | 
              
| 
                  
                   Tomasz Grysztar 05 May 2017, 16:30 
                  VEG wrote: Tomasz Grysztar, do you have similar macro for the FASMG?  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.