GNU Info

Info Node: (nasm.info)Section 2.1.12

(nasm.info)Section 2.1.12


Next: Section 2.1.13 Prev: Section 2.1.11 Up: Section 2.1
Enter node , (file) or (file)node

2.1.12. The `-d' Option: Pre-Define a Macro
-------------------------------------------

   Just as the `-p' option gives an alternative to placing `%include'
directives at the start of a source file, the `-d' option gives an
alternative to placing a `%define' directive. You could code

     nasm myfile.asm -dFOO=100

   as an alternative to placing the directive

     %define FOO 100

   at the start of the file. You can miss off the macro value, as well:
the option `-dFOO' is equivalent to coding `%define FOO'. This form of
the directive may be useful for selecting assembly-time options which
are then tested using `%ifdef', for example `-dDEBUG'.

   For Makefile compatibility with many C compilers, this option can
also be specified as `-D'.


automatically generated by info2www version 1.2.2.9