nasmdoc: update the full set of numeric prefix/suffix characters.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2010-05-07 13:12:12 -07:00
parent 62de275527
commit 26bb8890ef

View file

@ -1464,16 +1464,18 @@ character, string and floating-point.
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{Q} or \c{O}, and \c{B} for \i{hexadecimal},
\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. Note, though, that the \I{$,
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{0o} or
\c{0q} for octal, and \c{0b} for binary. Please note that unlike C, a
\c{0} prefix by itself does \e{not} imply an octal constant!
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!
Numeric constants can have underscores (\c{_}) interspersed to break
up long strings.
@ -1494,7 +1496,9 @@ Some examples (all producing exactly the same code):
\c mov ax,0q310 ; hex yet again
\c mov ax,11001000b ; binary
\c mov ax,1100_1000b ; same binary constant
\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
\S{strings} \I{Strings}\i{Character Strings}