0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00
Commit Graph

21 Commits

Author SHA1 Message Date
H. Peter Anvin
31c4d8bcfd doc: describe caveat with old NASM and new %if directives
Older versions of NASM would not try to match unknown %if directives
with a corresponding %endif, resulting in some very odd consequences
when it comes to trying to handle support for multiple NASM versions.

Document the problem.

Reported-by: E. C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2025-09-14 04:07:19 -07:00
H. Peter Anvin
7276cfde99 preproc: remove the message-generating functions
The message-generating functions appear to get expanded when they
shouldn't, resulting in errors. Disable them for now and remove them
from the documentation.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-14 02:48:58 -07:00
H. Peter Anvin
84115eeca6 preproc: add %find() and %findi() functions
Add the %find() and %findi() functions to look for a string in a
list. This is useful with picking apart the contents of the
__?DEFAULT?__ macro, for example.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-14 01:24:42 -07:00
H. Peter Anvin
4ccdf7e6fe preproc: add __?DEFAULT?__ macro representing the DEFAULT settings
Create a __?DEFAULT?__ magic macro with the settings of the DEFAULT
directive.

The DEFAULT directive is complex enough that this is best done with a
magic macro.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-14 00:38:50 -07:00
H. Peter Anvin
014ca9fdb3 doc: document the %exitmacro directive
The %exitmacro directive was never documented, apparently...

Reported-by: E. C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2025-09-13 21:47:05 -07:00
H. Peter Anvin
53c2f24c3d doc: 3.0 -> 3.00; tidy up the language for __?NASM_HAS_IFDIRECTIVE?__
Change 3.0 to 3.00 in all version numbers, since NASM has
traditionally expanded all but the major version number to 2 digits.

Make the language related to __?NASM_HAS_IFDIRECTIVE?__ more
consistent.

Reported-by: E. C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-13 21:35:06 -07:00
H. Peter Anvin
90e37ce7f1 doc: more index tweaks and removal of really really old information
Tidy up the index some more, and remove some very, very out of date
information.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-05 23:36:10 -07:00
H. Peter Anvin
7cc5291ece doc: tweaks to the index
Make the index at least a little bit more legible.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-05 17:51:38 -07:00
H. Peter Anvin
1d63ae2a3b doc: update the documentation, and auto-generate some indexes
There are currently six variations of each conditionals, and there may
be more in the future (e.g. %while). Stop trying to enumerate them all
everywhere.

Add support for index copying in the document processor.

Have pptok.pl auto-generate index metadata for conditional
preprocessor directives.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-05 17:12:06 -07:00
H. Peter Anvin
78c98dac0f version: bump version number to 3.0rc0
It seems to make sense to call this upcoming release NASM 3.0.

Suggested by: Yongjie Sheng <sheng.yongjie@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-05 01:12:27 -07:00
H. Peter Anvin
31a160759d Add %ifdirective preprocessor directive
Along with C and other languages, the current trend is to be able to
probe for features rather than relying on version numbers. This is
motivated in part by the intent of bumping the major version number to
3.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-04 19:41:12 -07:00
H. Peter Anvin
d5bd136ced preproc: add message-generating and %null() functions
Add the %null(), %note(), %warning(), %error(), and %fatal()
functions. They behave like the corresponding directives, then expands
to nothing.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-04 17:10:42 -07:00
H. Peter Anvin
38631c577a doc: there is no %fullpath() function, only %realpath()
Remove a reference to a non-existent %fullpath() function; the
function is called %realpath().

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-03 01:10:29 -07:00
H. Peter Anvin
7e46f6f7ab doc: fix a couple of syntax errors
Fix syntax errors that prevented the documentation from being
buildable.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-09-03 00:57:43 -07:00
H. Peter Anvin
ada267ec8c preproc: let %ifdef test for existence of macro functions
It is good to have a way to test for the existence of macro functions,
and since they are really just a special case of single-line macros,
allow %ifdef to test for them instead of coming up with something
entirely new.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-08-16 19:15:00 -07:00
H. Peter Anvin
0c533873f0 preproc: add %iffile|%isfile() and %realpath()
Add a function to test for the existence of a file, and a function
query the real operating system path, if available.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-08-15 00:32:33 -07:00
H. Peter Anvin
0843052f05 preproc: implement %pathsearch() and %depend() as functions
Implement preprocessor function equivalents of the %pathsearch and
%depend directives.

Simplify the incbin standard macro by using these functions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-08-14 21:46:55 -07:00
H. Peter Anvin
8ecb5d817a doc: cross-link %if and %is()
Link from %if to %is(), not just the other way.

Clarify that %is() is valid everywhere, not just in an %if expression
(unlike defined() in C.)

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-08-14 19:34:43 -07:00
H. Peter Anvin
23dffbd57a doc: highlight %unimacro a bit more
The %unimacro directive is almost a footnote, but it is really
important to use the correct directive.  Put it on equal footing with
%unmacro.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-08-14 19:28:33 -07:00
H. Peter Anvin
8d62e99e14 Add %note directive to add a note in the list file
This differs from a plain old comment in the following ways:

1. It is optionally macro-expanded;
2. It has a dash prefix;
3. It can be used inside .nolist macros.

Suggested-by: <pushbx@ulukai.org>
Resolves: https://bugzilla.nasm.us/show_bug.cgi?id=3392915
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-09-19 13:21:30 +02:00
H. Peter Anvin
6ad3bab7fe doc: break the documentation into chapters
Make the source code for the documentation a little easier to deal
with by breaking it into individual chapter files. Add support to
rdsrc.pl for auto-generating dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-08-13 15:55:37 -07:00