| back |  | Last regenerated: 2022-04-20 17:31:36 kio

# zasm - Z80 Assembler – Version 4.4

# Assembler directives

[<prev] [next>]

| ### #if, #elif, #else, #endif
    #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, endif if 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 instructions pseudo instruction is skipped Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif if the <condition> is false. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif If the pairing #endif is not found until the Pseudo instructions: end, .end 8080 pseudo instructions: END end 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, endif if <condition> is false. As an exception the Pseudo instructions 8080 Assembler: 8080 pseudo instructions pseudo instructions 'Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif if' and 'Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif endif' 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, endif if it is true, the following block is assembled. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif if it is false, or Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif if 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, endif If it was false it becomes true and the following assembler instructions are assembled. Assembler directives: #if, #elif, #else, #endif Pseudo instructions: if, endif If 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, endif If #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. |

[<prev] [top] [next>]