This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Conditional Check in Assemly File Like C Preprocessor

I want to set the stack size in assembly depending on if a definition exists, in the same in way as is done in the C preprocessor.

For example in C I would do this:

#ifdef SMALL_STACK
Stack EQU 0x00000800
#else
Stack EQU 0x00008000
#endif

I found this article in the Assembler User's Guide:

www.keil.com/.../armasm_dom1361290015842.htm

And tried this:

IF :DEF:SMALL_STACK
Stack EQU 0x00000800
ELSE
Stack EQU 0x00008000
ENDIF

but I get the error:

startup_MSP432P4.s(31): error: A1355U: A Label was found which was in no AREA

I can probably use the --cpreproc option as described here:

www.keil.com/.../armasm_dom1359731170696.htm

but this is more complication than I want to add to my project, especially for something so simple.

Is it possible to do what I want?

Thanks,
Samuel