diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2010-05-07 13:12:12 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-05-07 13:12:12 -0700 |
commit | 26bb8890ef64f346899e8f72efc9cbe92c7cb111 (patch) | |
tree | 501992cb6f315a0ae256e239833aa58dfe443fee /doc/nasmdoc.src | |
parent | 62de27552752d0793fb8d99fc3cc1e4bd588e663 (diff) | |
download | nasm-26bb8890ef64f346899e8f72efc9cbe92c7cb111.tar.gz nasm-26bb8890ef64f346899e8f72efc9cbe92c7cb111.tar.bz2 nasm-26bb8890ef64f346899e8f72efc9cbe92c7cb111.zip |
nasmdoc: update the full set of numeric prefix/suffix characters.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'doc/nasmdoc.src')
-rw-r--r-- | doc/nasmdoc.src | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 6e51cf4..f731e73 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} |