nasm/asm
H. Peter Anvin 8b26247442 preproc: add %i... variants, evaluated macro parameters, cleanups
All directives which create single-line macros now have %i... variants
to define case-insensitive versions. Case insensitive rather sucks,
but at least this way it is consistent.

Single-line macro parameters can now be evaluated as a number, as done
by %assign. To do so, declare a parameter starting with =, for
example:

%define foo(x,=y) mov [x],macro_array_y

... would evaluate y as a number but leave x as a string.

NOTE: it would arguably be better to have this as a per-instance
basis, but it is easily handled by having a secondary macro called
with the same argument twice.

Finally, add a more consistent method for defining "magic" macros,
which need to be evaluated at runtime. For now, it is only used by the
special macros __FILE__, __LINE__, __BITS__, __PTR__, and __PASS__.

__PTR__ is a new macro which evaluates to word, dword or qword
matching the value of __BITS__.

The magic macro framework, however, provides a natural hook for a
future plug-in infrastructure to hook into a scripting language.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 14:00:54 -08:00
..
assemble.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
assemble.h Add a generic pragma-handling infrastructure 2017-03-07 21:32:37 -08:00
directiv.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
directiv.dat Make any execution limit configurable, add eval limit 2018-06-12 13:54:42 -07:00
error.c BR 3392535: warning on redefine, promote define-on-pass2 to error 2018-12-12 16:49:07 -08:00
eval.c eval: Eliminate division by zero 2018-10-14 01:49:43 +03:00
eval.h Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
exprdump.c exprlib: move dumping code to a separate C file 2017-02-28 18:13:43 -08:00
exprlib.c exprlib: move dumping code to a separate C file 2017-02-28 18:13:43 -08:00
float.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
float.h Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
labels.c BR 3392539: some errors can "cascade". Allow suppressing if dead. 2018-12-27 11:24:17 -08:00
listing.c listing: list_emit -- Don't forget to zap listerr_head 2018-12-25 13:11:55 +03:00
listing.h error: new flag ERR_HERE 2018-12-12 17:43:25 -08:00
nasm.c BR 3392539: some errors can "cascade". Allow suppressing if dead. 2018-12-27 11:24:17 -08:00
parser.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
parser.h Cleanup of label renaming infrastructure, add subsection support 2018-06-01 18:06:25 -07:00
phash.pl Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
pptok.dat preproc: add %i... variants, evaluated macro parameters, cleanups 2019-02-26 14:00:54 -08:00
pptok.pl perl: change to the new, safer 3-operand form of open() 2017-04-02 19:36:41 -07:00
pragma.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
preproc-nop.c --no-line: new option to ignore %line directives 2018-12-14 12:22:11 -08:00
preproc.c preproc: add %i... variants, evaluated macro parameters, cleanups 2019-02-26 14:00:54 -08:00
preproc.h --no-line: new option to ignore %line directives 2018-12-14 12:22:11 -08:00
quote.c preproc: add %i... variants, evaluated macro parameters, cleanups 2019-02-26 14:00:54 -08:00
quote.h preproc: add %i... variants, evaluated macro parameters, cleanups 2019-02-26 14:00:54 -08:00
rdstrnum.c rdstrnum: Make sure we dont shift out of bound 2018-10-29 22:25:16 +03:00
segalloc.c segalloc: DO NOT reset segment numbers 2018-06-14 16:42:03 -07:00
stdscan.c warnings: rename ERR_WARN_* to WARN_* 2018-12-12 14:38:50 -08:00
stdscan.h Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
strfunc.c Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
tokens.dat Reorganize the source code into subdirectories 2016-05-25 12:06:29 -07:00
tokhash.pl perl: change to the new, safer 3-operand form of open() 2017-04-02 19:36:41 -07:00