Document the -O0 and -O1 behaviors.
authorH. Peter Anvin <hpa@zytor.com>
Tue, 30 Sep 2008 23:24:47 +0000 (16:24 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 30 Sep 2008 23:24:47 +0000 (16:24 -0700)
Document the way the -O0 and -O1 options actually behave.  -O0, in
particular, is NASM 0.98 compatibility mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
doc/changes.src
doc/nasmdoc.src

index 3cd0b22..6624f12 100644 (file)
@@ -8,6 +8,12 @@ The NASM 2 series support x86-64, and is the production version of NASM
 since 2007.
 
 
+\S{cl-2.05} Version 2.05
+
+\b Make the behaviour of \c{-O0} match NASM 0.98 legacy behavior.
+  See \k{opt-O}.
+
+
 \S{cl-2.04} Version 2.04
 
 \b Sanitize macro handing in the \c{%error} directive.
index 847f02e..9b66bb6 100644 (file)
@@ -787,22 +787,26 @@ NASM defaults to not optimizing operands which can fit into a signed byte.
 This means that if you want the shortest possible object code,
 you have to enable optimization.
  
-Using the \c{-O} option, you can tell NASM to carry out different levels of optimization.
-The syntax is:
+Using the \c{-O} option, you can tell NASM to carry out different
+levels of optimization.  The syntax is:
 
 \b \c{-O0}: No optimization. All operands take their long forms,
-        if a short form is not specified.
+        if a short form is not specified, except conditional jumps.
+        This is intended to match NASM 0.98 behavior.
 
 \b \c{-O1}: Minimal optimization. As above, but immediate operands
         which will fit in a signed byte are optimized,
-        unless the long form is specified.
+        unless the long form is specified.  Conditional jumps default
+        to the long form unless otherwise specified.
 
 \b \c{-Ox} (where \c{x} is the actual letter \c{x}): Multipass optimization.
         Minimize branch offsets and signed immediate bytes,
-       overriding size specification unless the \c{strict} keyword
-       has been used (see \k{strict}).  For compatability with earlier
-       releases, the letter \c{x} may also be any number greater than
-       one. This number has no effect on the actual number of passes.
+        overriding size specification unless the \c{strict} keyword
+        has been used (see \k{strict}).  For compatability with earlier
+        releases, the letter \c{x} may also be any number greater than
+        one. This number has no effect on the actual number of passes.
+
+The \c{-Ox} mode is recommended for most uses.
 
 Note that this is a capital \c{O}, and is different from a small \c{o}, which
 is used to specify the output file name. See \k{opt-o}.