|
#if <condition>
...
#elif <condition>
...
#else
...
#endif
#if starts a block of assembler instructions, which is only assembled Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif the given <condition> is true. The <condition> must be evaluatable in pass 1. Conditional assembly may be nested. Any assembler directive except pairing #else, #elif and #endif, and any assembler instruction or Pseudo instructions 8080 Assembler: 8080 pseudo instructionspseudo instruction is skipped Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif the <condition> is false. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifIf the pairing #endif is not found until the Pseudo instructions: end, .end 8080 pseudo instructions: ENDend of file then a nesting error is assumed. Note, that Assembler directives: #include Including C Source Files: #include#include is also skipped Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif <condition> is false.
As an exception the Pseudo instructions 8080 Assembler: 8080 pseudo instructionspseudo instructions 'Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif' and 'Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifendif' are detected and handled just like '#if' and '#endif'. note: this may change.
After an #if directive where the <condition> was false, the #elif <condition> is checked and Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif it is true, the following block is assembled. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif it is false, or Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifif already a block was assembled within this #if ... #endif range, the following block is skipped. #elif is optional and may occur multiple times after #if.
After an #if directive, #else negates the <condition>. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifIf it was false it becomes true and the following assembler instructions are assembled. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifIf it was true it becomes false and the following assembler instructions are skipped. #else is optional and should only occur once before the #endif assembler directive. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endifIf #else occurs after some #elif directives, then the #else part is a final 'catch all'.
The #endif directive finishes conditional assembly as started with the #if directive.
| |