Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

NASM 2.10 uses "-Ox" by default (Announce)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 03.05.2012, 02:37

> > 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:

Back to the forum
Board view  Mix view
22778 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum