elseif

Starts an alternative conditional assembly block, making assembly conditional on the truth of a boolean expression.

  .elseif bool-expr

  
Parameter

bool-expr

Any boolean expression.

Remarks

If bool-expr is true, the assembler processes the statements of the block. If bool-expr is false, the assembler skips the statements of the block.

You can use this directive to create a logical, multilevel if-then-else statement, according to this syntax:

  .if bool-expr statement-group

  
  [ .elseif bool-expr statement-group ]...

  
  [ .else statement-group ]

  
  .endif

  

(In this syntax, statement-group is any group of assembly-language statements.)

The .elseif directive can be part of more complicated logical structures, such as:

  .if bool-expr-1

  
      statement-group-1

  
  .elseif bool-expr-2

  
      statement-group-2

  
  .elseif bool-expr-3

  
      statement-group-3

  
  .elseif bool-expr-4

  
      statement-group-4

  
  .else

  
      statement-group-5

  
  .endif