From 26bb8890ef64f346899e8f72efc9cbe92c7cb111 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 7 May 2010 13:12:12 -0700 Subject: [PATCH] nasmdoc: update the full set of numeric prefix/suffix characters. Signed-off-by: H. Peter Anvin --- doc/nasmdoc.src | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 6e51cf46..f731e73c 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -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} -- 2.11.4.GIT