diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 60bd694b..a1253bff 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -739,9 +739,8 @@ The syntax is: \b \c{-On} multi-pass optimization, minimize branch offsets; also will minimize signed immediate bytes, overriding size specification unless the \c{strict} keyword has been used (see \k{strict}). - If 2 <= n <= 3, then there are 5 * n passes, otherwise there - are n passes. - + The number specifies the maximum number of passes. The more + passes, the better the code, but the slower is the assembly. Note that this is a capital O, and is different from a small o, which is used to specify the output format. See \k{opt-o}. @@ -1646,7 +1645,7 @@ forcing byte size in the effective address by coding \c{[byte ebx+offset]}. Note that use of the \c{-On} switch (with n>=2) makes some of the above -no longer true. (see \k{opt-On}) +no longer true (see \k{opt-On}). \H{locallab} \i{Local Labels} @@ -6112,14 +6111,15 @@ that isn't listed here. \S{inefficient} NASM Generates \i{Inefficient Code} -I get a lot of `bug' reports about NASM generating inefficient, or +We sometimes get `bug' reports about NASM generating inefficient, or even `wrong', code on instructions such as \c{ADD ESP,8}. This is a deliberate design feature, connected to predictability of output: NASM, on seeing \c{ADD ESP,8}, will generate the form of the instruction which leaves room for a 32-bit offset. You need to code -\I\c{BYTE}\c{ADD ESP,BYTE 8} if you want the space-efficient -form of the instruction. This isn't a bug: at worst it's a -misfeature, and that's a matter of opinion only. See \k{opt-On}. +\I\c{BYTE}\c{ADD ESP,BYTE 8} if you want the space-efficient form of +the instruction. This isn't a bug, it's user error: if you prefer to +have NASM produce the more efficient code automatically enable +optimization with the \c{-On} option (see \k{opt-On}). \S{jmprange} My Jumps are Out of Range\I{out of range, jumps} diff --git a/nasm.c b/nasm.c index cdc936b5..e8bc680f 100644 --- a/nasm.c +++ b/nasm.c @@ -403,7 +403,6 @@ static int process_arg (char *p, char *q) while(isdigit(*++param)) ; if (opt<=0) optimizing = -1; /* 0.98 behaviour */ else if (opt==1) optimizing = 0; /* Two passes, 0.98.09 behavior */ - else if (opt<=3) optimizing = opt*5; /* Multiple passes */ else optimizing = opt; /* Multiple passes */ } else { if (*param == 'v' || *param == '+') {