Copyright (C) 2000-2012 |
GNU Info (nasm.info)Section 3.53.5. Expressions ================ Expressions in NASM are similar in syntax to those in C. NASM does not guarantee the size of the integers used to evaluate expressions at compile time: since NASM can compile and run on 64-bit systems quite happily, don't assume that expressions are evaluated in 32- bit registers and so try to make deliberate use of integer overflow. It might not always work. The only thing NASM will guarantee is what's guaranteed by ANSI C: you always have _at least_ 32 bits to work in. NASM supports two special tokens in expressions, allowing calculations to involve the current assembly position: the `$' and `$$' tokens. `$' evaluates to the assembly position at the beginning of the line containing the expression; so you can code an infinite loop using `JMP $'. `$$' evaluates to the beginning of the current section; so you can tell how far into the section you are by using `($-$$)'. The arithmetic operators provided by NASM are listed here, in increasing order of precedence.
automatically generated by info2www version 1.2.2.9 |