flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Main > Anyway to check defines after they've been declared? | 
  
| Author | 
  | 
              
| 
                  
                   sid123 09 Jul 2014, 09:20 
                  Hi,
 
                  I'm writing a VM which uses my own executable format. It uses fasm as the assembler and all instructions are done through macros. What I want is to check for the stack size given by the programmer, and if it's not defined then fall back to default. My programs look like this: Code: include 'cpu.inc' DEFINE STACK_SIZE 200 ..code.... "cpu.inc" contains the header for the programs and a few macros that define CPU instructions. Basically I want to check if STACK_SIZE was defined by the programmer anywhere in the source code and then set the "stack_buf" entry manually in the header. Something like: Code: ifdef STACK_BUF dd _end_bss + STACK_BUF else ; Fall back to default stack size dd _end_bss + 200 endif Cheers, sid123 _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD  | 
              |||
                  
  | 
              
| 
                  
                   JohnFound 09 Jul 2014, 10:54 
                  Use assembling stage constants instead of preprocessor one:     
                  
                Code: STACK_SIZE = 200 Code: if defined STACK_SIZE  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.