GNU Info

Info Node: (nasm.info)Section 3.2.4

(nasm.info)Section 3.2.4


Next: Section 3.2.5 Prev: Section 3.2.3 Up: Section 3.2
Enter node , (file) or (file)node

3.2.4. `EQU': Defining Constants
--------------------------------

   `EQU' defines a symbol to a given constant value: when `EQU' is
used, the source line must contain a label. The action of `EQU' is to
define the given label name to the value of its (only) operand. This
definition is absolute, and cannot change later. So, for example,

     message         db      'hello, world'
     msglen          equ     $-message

   defines `msglen' to be the constant 12. `msglen' may not then be
redefined later. This is not a preprocessor definition either: the
value of `msglen' is evaluated _once_, using the value of `$' (see
*Note Section 3.5:: for an explanation of `$') at the point of
definition, rather than being evaluated wherever it is referenced and
using the value of `$' at the point of reference. Note that the operand
to an `EQU' is also a critical expression (*Note Section 3.8::).


automatically generated by info2www version 1.2.2.9