GNU Info

Info Node: (nasm.info)Section 4.4

(nasm.info)Section 4.4


Next: Section 4.4.1 Prev: Section 4.3.9 Up: Chapter 4
Enter node , (file) or (file)node

4.4. Conditional Assembly
=========================

   Similarly to the C preprocessor, NASM allows sections of a source
file to be assembled only if certain conditions are met. The general
syntax of this feature looks like this:

     %if<condition>
         ; some code which only appears if <condition> is met
     %elif<condition2>
         ; only appears if <condition> is not met but <condition2> is
     %else
         ; this appears if neither <condition> nor <condition2> was met
     %endif

   The `%else' clause is optional, as is the `%elif' clause. You can
have more than one `%elif' clause as well.

Section 4.4.1
`%ifdef': Testing Single-Line Macro Existence
Section 4.4.2
`ifmacro': Testing Multi-Line Macro Existence
Section 4.4.3
`%ifctx': Testing the Context Stack
Section 4.4.4
`%if': Testing Arbitrary Numeric Expressions
Section 4.4.5
`%ifidn' and `%ifidni': Testing Exact Text Identity
Section 4.4.6
`%ifid', `%ifnum', `%ifstr': Testing Token Types
Section 4.4.7
`%error': Reporting User-Defined Errors

automatically generated by info2www version 1.2.2.9