flat assembler
Message board for the users of flat assembler.

Index > Main > Optimized to death

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7782
Location: Kraków, Poland
Tomasz Grysztar
ABS optimized for size:
Code:
    @@: neg     eax
        js      @b    

Wink
Post 02 Aug 2006, 09:20
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
tomasz: hehe, nice
Post 02 Aug 2006, 10:29
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Quantum



Joined: 24 Jun 2005
Posts: 122
Quantum
2 Madis731:
cdq
xor eax,edx
sub eax,edx
Post 02 Aug 2006, 14:36
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
f0dder: I didn't say that HLLs like C are "evil". Nonetheless, they are maybe even more useful than asm alone. I just tried to explain that "beating asm at optimization" is not the goal of HLLs, but rather a dream. This doesn't imply that you should ALWAYS (even when you make a "debug" and not a "release" version) optimize as much as you can. When debugging, it's not only a waste of time to optimize, but also unclear. When releasing it's a different story.

And besides, algorithms should be decided first. In asm source code or other notes/documents accompanying it, I strongly suggest you write some pseudo-code or HLL code in comments or notes, so the one reading it might get an appreciation for it. Also I encourage pseudo-code since C cannot cover all of asm functions, tricks, etc.

My point was that people tend to forget that HLLs are HLLs, and they start to bash asm and claim it's useless, nonetheless it may be harder for most people, but it can never be beaten by a HLL. Of course plain asm is beaten, but when you program in asm, the optimizing compiler between your ears starts to think differently, low-level, understanding stuff and making decisions on the specific platform, and not abstracted. That's what makes asm a "low-level language". And that's what makes it different than other "high-level languages".

The "primary" goal of HLLs is not "optimization" -- that's asm's primary goal. Also, I know most people say that "it runs fine, so it's good enough", but still it's nice to apply optimizations (i.e not necessarily to "death") wherever you can. Somehow my conscience is hurt by unoptimized code on purpose (like the assistant in Office, etc..). So you see, Microsoft did not have time to optimize the program a bit (even if not in asm), but they did waste their time with pics and other things. Saying "it's a waste of time" is really false, because that's not what they mean when they say optimization is useless.

_________________
Previously known as The_Grey_Beast
Post 14 Aug 2006, 13:23
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.