Try to better sort out the necessary dependencies for warning
generation.
Fix regex for cleaning up nasmdoc markup: nasmdoc markup does not
nest, although it may include \} sequences.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Require the second colon before the grouped parameter count; otherwise
the syntax is ambiguous since an expression can start with (.
Update/complete the documentation and the examples.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the %map() function which can apply arguments to a macro from a
list.
Allow the user to specify the desired radix for an evaluated
parameter. It doesn't make any direct difference, but can be nice for
debugging or turning into strings.
As part of this, split expand_one_smacro() into two parts: parameter
parsing and macro expansion. This is a very straightforward splitting
of two mostly unrelated pieces of functionality.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The production "value := type value" was not correct; should have been
"type atom", which can be merged with the "atom" production to "[type]
atom".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make it possible to add a base prefix to %num().
Add the %hex() function, producing hexadecimal values that are
nevertheless valid NASM numeric constants.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
%expr() was a pre-release development name for this function, however,
the released name is %eval().
See BR 3392837.
Reported-by: Michael <mikar_gibbros@yahoo.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The dependency on the warning files breaks when we are building in a
directory *and* the files already exist from being shipped with the
distribution tarballs. The make VPATH simply isn't sophisticated
enough to deal with it, so let the C compiler handle it by #including
the generated file from a dummy C file.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add Chapter 1 to the navbar for the table of contents, for ease of
sequentially reading the whole document.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Document CPU LATEVEX and the associated prefixes; add CPU EVEX and CPU
VEX flags to further control encodings.
Fix the error message for invalid encodings due to flags.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Bring doc/changes.src up to date with the current status of tree in
preparation for the 2.16 release.
Note that no 2.15.06 release ever was produced.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the option of having strings only conditionally quoted (&&) -- do
not quote an already quoted string again -- as opposed to always
quoting a string.
This makes a lot of the string functions way simpler to implement, and
removes the need to share ad hoc parsing code with directives.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the %abs() function, to produce the absolute value as an
always-positive decimal constant.
Change the order of the arguments for %num().
Refactor the handling of optional arguments, to reduce the amount of
redundant code. This is currently only used for builtin functions, but
might be extended in the future.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Implement the %cond() and %sel() functions that expand to a specific
one of the arguments. %cond(x,y,z) is basically a shorthand for
%sel(2-!(x),y,z) used when x is a boolean condition.
Fix a memory leak in %strcat and %strlen.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
In some of the preprocessor function examples, actually enforce
equivalence by using %xdefine in the function examples so the
expansion is at definition time.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The use of statements like "chapter", "section" and so on makes the
HTML index insanely verbose. Remove them; they don't add any
information.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Allow a single index entry key to be defined with \IR more than once,
generating multiple entries in the index; this is really useful for
example to always generate "macros, single-line" and "single-line
macros" entries sorted at different places.
Be smarter about sorting the index: sort (nearly) all special
characters before alphanumerics, and (attempt to) sort numbers in
numerical order rather than alphabetical (so BITS8 sorts before
BITS16).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The web site currently assumes that the release history is always in
appendix C. Humor it for now, besides, it doesn't really make sense
for the huge machine-generated instruction list to be anywhere but the
end.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If a list of index entries is so long that the whole list can't fit
onto a single page, we *have* to break it. Treat the hanging-comma
line as a potential widow, but allow column breaks elsewhere in the
list.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
RDOFF has been deprecated as it has unfixable problems, and has been
announced that it will be killed off in NASM 2.16.
This deletes it once and for all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There is no documentation of the `%unimacro` directive.
This is particularly confusing when you’re trying to remove a macro
that has previously been defined with the `%imacro` directive.