The Preprocessor - absoluteAquarian/CSASM GitHub Wiki

The preprocessor in CSASM works very similar to C's preprocessor, though it is somewhat limited at the moment.

#endif

Used to mark the end of a preprocessor statement's block.

#define <name> [body]

Creates a define constant named <name> with an optional body.
Define constant bodies currently cannot contain spaces.

#ifdef <name>

Paired with #endif.
All code contained in this statement is only compiled iff (if and only if) the define constant <name> exists.
Examples:

#define NAME
#ifdef NAME
  ; Anything in here is compiled since NAME exists
#endif
#ifdef OTHER
  ; Anything in here is NOT compiled since OTHER does not exist
#endif

#ifndef <name>

Paired with #endif.
All code contained in this statement is only compiled iff the define constant <name> does not exist.
Examples:

#define NAME
#ifndef NAME
  ; Anything in here is NOT compiled since NAME exists
#endif
#ifndef OTHER
  ; Anything in here is compiled since OTHER does not exist
#endif

#undef <name>

Removes the define constant <name> if it exists.

⚠️ **GitHub.com Fallback** ⚠️