doc: add 2.17 release notes and document [dollarhex]

Add the beginnings (at least) of release notes for 2.17, and document
the [dollarhex] directive.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2025-09-03 12:31:03 -07:00
parent d1ab9e0ae7
commit e0d5333a47
4 changed files with 63 additions and 18 deletions

View file

@ -15,6 +15,8 @@ the processor supports \c{RIP}-relative addressing directly; see the
probably desirable to make that the default, using the directive
\c{DEFAULT REL} (\k{default}).
\c{DEFAULT REL} is likely to become the default in a future version of NASM.
64-bit programming is relatively similar to 32-bit programming, but
of course pointers are 64 bits long; additionally, all existing
platforms pass arguments in registers rather than on the stack.
@ -180,4 +182,3 @@ Integer and SSE register arguments are counted together, so for the case of
\c void foo(long long a, double b, int c)
\c{a} is passed in \c{RCX}, \c{b} in \c{XMM1}, and \c{c} in \c{R8D}.

View file

@ -11,11 +11,35 @@ since 2007.
\b Improve the documentation for building from source (\k{source}).
\S{cl-2.16.04} Version 2.16.04
\b Add support for the APX and AVX10 instruction sets, and various
miscellaneous new instructions.
\b Add new preprocessor functions: \c{%depend()}, \c{%pathsearch()},
\c{%realpath()}. See \k{ppfunc}.
\b New preprocessor directive \c{%iffile} (and corresponding function
\c{%isfile()}) to test for the existence of a file. See \k{iffile}.
\b New preprocessor directive \c{%note} to insert a note in the list
file, without issuing an external diagnosic. Unlike a comment, it
is optionally macro-expanded, see \k{pperror}.
\b Fix a number of invalid memory references (usually causing crashes)
on various invalid inputs.
\b Fix multiple bugs in the handling of \c{$}-escaped symbols.
\b The use of \c{$} as a prefix for hexadecimal numbers has been
deprecated, and will now issue a warning. A new directive
\c{[DOLLARHEX]} can be used to disable this syntax entirely, see
\k{dollarhex}.
\b Fix the generation of segment selector references (mainly used in
the \c{obj} output format.)
\b Clean up the command-line help text (\c{-h}) and break it down into
individual topics, as the previous output was just too verbose to be
practical as a quick reference.
individual topics, as the previous output was just too verbose to be
practical as a quick reference.
\S{cl-2.16.03} Version 2.16.03

View file

@ -112,7 +112,11 @@ other special functions in 64-bit mode, and generating
\c{DEFAULT REL} is disabled with \c{DEFAULT ABS}.
\S{BND & NOBND} \i\c{BND} & \i\c{NOBND}: \c{BND} prefix
\c{DEFAULT REL} is likely to become the default setting in a future
version of NASM. Specify \c{DEFAULT ABS} explicitly if you need your
code to avoid relative offsets.
S{BND & NOBND} \i\c{BND} & \i\c{NOBND}: \c{BND} prefix
If \c{DEFAULT BND} is set, all bnd-prefix available instructions following
this directive are prefixed with bnd. To override it, \c{NOBND} prefix can
@ -521,6 +525,19 @@ requiring an explicit \c{\{vex\}} prefix. This is implicit if the
off.
\H{dollarhex} \i\c{[DOLLARHEX]}: Enable or disable \c{$} hexadecimal syntax
Using a \c{$} prefix for hexadecimal numbers is deprecated, as it
conflicts with the use of \c{$} for escaping symbols (see \k{numconst}
and \k{syntax}). The \c{[DOLLARHEX]} directive can be used to disable
it completely:
\c [dollarhex off]
When disabled, symbols beginning with digits can be escaped as well,
e.g. \c{$3} would define a symbol \c{3}.
\H{FLOAT} \i\c{FLOAT}: Handling of \I{floating-point, constants}floating-point constants
By default, floating-point constants are rounded to nearest, and IEEE

View file

@ -409,16 +409,19 @@ A numeric constant is simply a number. NASM allows you to specify
numbers in a variety of number bases, in a variety of ways: you can
suffix \c{H} or \c{X}, \c{D} or \c{T}, \c{Q} or \c{O}, and \c{B} or
\c{Y} for \i{hexadecimal}, \i{decimal}, \i{octal} and \i{binary}
respectively, or you can prefix \c{0x}, for hexadecimal in the style
of C, or you can prefix \c{$} for hexadecimal in the style of Borland
Pascal or Motorola Assemblers. Note, though, that the \I{$,
prefix}\c{$} prefix does double duty as a prefix on identifiers (see
\k{syntax}), so a hex number prefixed with a \c{$} sign must have a
digit after the \c{$} rather than a letter. In addition, current
versions of NASM accept the prefix \c{0h} for hexadecimal, \c{0d} or
\c{0t} for decimal, \c{0o} or \c{0q} for octal, and \c{0b} or \c{0y}
for binary. Please note that unlike C, a \c{0} prefix by itself does
\e{not} imply an octal constant!
respectively, or you can prefix \c{0h} or \c{0x}, \c{0d} or \c{0t},
\c{0q} or \c{0o}, and \c{0b} or \c{0y) in the style of C. Please note
that unlike C, a \c{0} prefix by itself does \e{not} imply an octal
constant (this is deprecated in C23.)
Previous versions of NASM allowed prefixing \c{$} for hexadecimal in
the style of Borland Pascal or Motorola Assemblers. Unfortunately
though, the \I{$, prefix}\c{$} prefix does double duty as a prefix on
identifiers (see \k{syntax}), so a hex number prefixed with a \c{$}
sign would have to have a digit after the \c{$} rather than a letter,
which is \e{not} what users would typically expect. This syntax is
strongly deprecated, and can be disabled entirely with the
\c{[DOLLARHEX]} directive, see \k{dollarhex}.
Numeric constants can have underscores (\c{_}) interspersed to break
up long strings.
@ -430,7 +433,6 @@ Some examples (all producing exactly the same code):
\c mov ax,0200d ; explicitly decimal
\c mov ax,0d200 ; also decimal
\c mov ax,0c8h ; hex
\c mov ax,$0c8 ; hex again: the 0 is required
\c mov ax,0xc8 ; hex yet again
\c mov ax,0hc8 ; still hex
\c mov ax,310q ; octal
@ -442,6 +444,9 @@ Some examples (all producing exactly the same code):
\c mov ax,1100_1000y ; same binary constant once more
\c mov ax,0b1100_1000 ; same binary constant yet again
\c mov ax,0y1100_1000 ; same binary constant yet again
\c
\c ; Deprecated syntax:
\c mov ax,$0c8 ; hex again: the 0 is required
\S{strings} \I{string}\I{string constants}\i{Character Strings}
@ -1004,5 +1009,3 @@ entry point in the \c{obj} output format (see \k{dotdotstart}),
of the current image in the \c{win64} output format (see \k{win64pic}).
So just keep in mind that symbols beginning with a double period are
special.