summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-30 16:24:47 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-30 16:24:47 -0700
commitdc0bf47feb96884d658d0eceba8ce669c81cf591 (patch)
treefb5af6548a251780beb312ffea7de7a0a861d40f /doc
parentf1aefd8456b0d32d36a283cc6d12b3a09ae8fdb5 (diff)
downloadnasm-dc0bf47feb96884d658d0eceba8ce669c81cf591.tar.gz
nasm-dc0bf47feb96884d658d0eceba8ce669c81cf591.tar.bz2
nasm-dc0bf47feb96884d658d0eceba8ce669c81cf591.zip
Document the -O0 and -O1 behaviors.
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>
Diffstat (limited to 'doc')
-rw-r--r--doc/changes.src6
-rw-r--r--doc/nasmdoc.src20
2 files changed, 18 insertions, 8 deletions
diff --git a/doc/changes.src b/doc/changes.src
index 3cd0b22..6624f12 100644
--- a/doc/changes.src
+++ b/doc/changes.src
@@ -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.
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index 847f02e..9b66bb6 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -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}.