-
Notifications
You must be signed in to change notification settings - Fork 0
The Preprocessor
John Baglio edited this page Mar 29, 2021
·
2 revisions
The preprocessor in CSASM works very similar to C's preprocessor, though it is somewhat limited at the moment.
Used to mark the end of a preprocessor statement's block.
Creates a define constant named <name>
with an optional body.
Define constant bodies currently cannot contain spaces.
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
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
Removes the define constant <name>
if it exists.