NASM 2.10 uses "-Ox" by default (Announce)
> > Yes -O0 produces the same result :)
>
> I believe the rationale for this was that approx. 99% of people don't want
> "unoptimized" (bigger) code by default.
Basically, yeah. I think so, at least. Additionally, I think that -Ox requires more passes than, say, -O0 - so historically, the build process took less time. This is less relevant today, so the trade-off between optimising the build process and the actual run time performance has here been changed to prioritise the latter.
> Esp. if you compare FASM and YASM
> have already forced such size optimization for years without any huge
> complaints. I think the recommended workaround (if you are the hardcore
> users that needs specific opcode sizes) is to use the keyword "strict"
> selectively.
No, "strict" is for specific instructions only. Like in a specific loader where I have a header pointing to some words to make them patchable, I want those to actually be words. So in some cases it says simple:
mov cx, blahblah_size
..@patchblahblahsize: equ $-2
But in other cases (as I use the -Ox setting) it must effectively* say this:
add cx, strict word bloobloo_size
..@patchbloobloosize: equ $-2
(* I say "effectively" here because I have macros to abstract away this "strict word" keyword phrase specifically for some reason.)
This is because mov does not have an optimised sign-extending form which changes the immediate operand's opcode word into an opcode byte, while add does - and that optimised add form will be selected when possible by the optimising assembler unless I specify "strict word".
If, however, you want to have the not-optimising behaviour everywhere, you only have to select -O1 or -O0 (the last one again being digit zero). That should in general be limited to special usages though (like Rayer testing whether the output is byte-compatible here).
Do FASM and YASM have equivalents to -O0 and strict?
---
l
Complete thread:
- NASM 2.10 - Rugxulo, 27.03.2012, 00:39
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- NASM 2.10 - Rugxulo, 27.03.2012, 00:42
- NASM 2.10 - marcov, 27.03.2012, 13:07
- NASM 2.10 - revised preprocessor - ecm, 20.04.2012, 04:26
- NASM 2.10 - revised preprocessor - RayeR, 02.05.2012, 22:06
- NASM 2.10 - revised preprocessor - ecm, 02.05.2012, 22:16
- NASM 2.10 - revised preprocessor - RayeR, 02.05.2012, 22:43
- NASM 2.10 - revised preprocessor - ecm, 02.05.2012, 22:48
- NASM 2.10 - revised preprocessor - RayeR, 03.05.2012, 00:04
- NASM 2.10 uses "- Ox" by default - Rugxulo, 03.05.2012, 02:25
- NASM 2.10 uses "-Ox" by default - ecm, 03.05.2012, 02:37
- NASM 2.10 uses "-Ox" by default - Rugxulo, 03.05.2012, 08:18
- NASM 2.10 uses "-Ox" by default - ecm, 03.05.2012, 23:00
- NASM 2.10.01 - Rugxulo, 16.06.2012, 00:24
- NASM 2.10 uses "-Ox" by default - ecm, 03.05.2012, 23:00
- NASM 2.10 uses "-Ox" by default - Rugxulo, 03.05.2012, 08:18
- NASM 2.10 uses "-Ox" by default - ecm, 03.05.2012, 02:37
- NASM 2.10 - revised preprocessor - ecm, 03.05.2012, 02:26
- NASM 2.10 uses "- Ox" by default - Rugxulo, 03.05.2012, 02:25
- NASM 2.10 - revised preprocessor - RayeR, 03.05.2012, 00:04
- NASM 2.10 - revised preprocessor - ecm, 02.05.2012, 22:48
- NASM 2.10 - revised preprocessor - RayeR, 02.05.2012, 22:43
- NASM 2.10 - revised preprocessor - ecm, 02.05.2012, 22:16
- NASM 2.10 - revised preprocessor - RayeR, 02.05.2012, 22:06
- NASM 2.10 - Rugxulo, 27.03.2012, 00:42
Mix view