News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Lingo on assembler code design

Started by lingo, March 14, 2007, 12:12:34 AM

Previous topic - Next topic

hutch--

Magnus,

In a brave new world of 64 bit computing which is still some way off, the bottom line for assembler assumptions will be SSE3 where it is appropriate and multiple thread code but it would be mistaken to think that integer registers in 64 bit are past their use by date. There would be so many if this was the case. Originally MMX and SSE instructions and registers were a fudge to get past the limits of 32 bit along with the capacity of parallel processing to be performed in hardware.

As 32 bit assembler was far different to DOS 16 bit, so will 64 bit be different to 32 bit code. Think into the future of many more processors with better hardware control at synchronising parallel threads and you are part of the way there.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

lingo

To all my "critics":

My best language is C/C++
hence,  I can code in assembly like you
but I'm not sure that you can write in assembly  like me... :lol
If you disagree with me please publish your optimized
assembly code or shut up! (if you can control yourself)  :lol
Will be beter to spend your time for codig rather than for empty bla-bla-blah... 
or Hutch will move the topic again  :lol
I want to finish with sentence by my great friend Vortex "Code it... That's all..."   :lol

Regards,
Lingo

hutch--

 :bg

Your challenge, my choice.

1024 bytes of sheer blazing maximised high performance API coding in pure assembler. Show me how to make this API call faster or the app smaller at the legal minimum of 1024 bytes.


    .486
    .model flat, stdcall
    option casemap :none

    externdef _imp__MessageBoxA@16:PTR pr4
    MessageBox equ <_imp__MessageBoxA@16>

    includelib \masm32\lib\user32.lib

  .code
    ttl db "MessageBox",0
    txt db "Highly Optimised",0

lets_rock_n_roll:

    push 0
    push OFFSET ttl
    push OFFSET txt
    push 0
    call MessageBox

    retn

end lets_rock_n_roll

; Build it with this batch file

@echo off

if exist "opti.obj" del "opti.obj"
if exist "opti.exe" del "opti.exe"

\masm32\bin\ml /c /coff "opti.asm"

\masm32\bin\PoLink /SUBSYSTEM:WINDOWS /MERGE:.data=.text "opti.obj"
dir "opti.*"

pause


PS : Do note this much, the Campus is subject to a specific set of rules that excludes the style of debate you have chosen to start. While I am more than happy to hear your comments as it is useful to demonstrate to programmers how NOT to write unreadable obscure code, it will not be done in the Campus where the rules prohibit extended discussion of this type.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

lingo

Now is clear for everyone who has a optimization dream about and a
"world's fastest MessageBoxA" mentality... :lol
I can't help you here but you can ask my great friend Vortex
about some secret key of the Polink to make your exe shorter... :lol

PBrennick

Lingo,
Vortex and I have been a team for a long time and I know exactly how he feels about you. You like to drop names and that is your priveledge, but I will not allow you to give others the impression that he is your friend. He is far from it. When you do it, I will speak up. When I banned you from the GeneSys forum, he was and still is in complete agreement with me.

He is polite so he wont go public about it and if you talk to him he will answer in a polite manner but he will NEVER seek YOU out.

By the way, he can code better than you in both assembly AND C++.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

 :bg

> I can't help you here

I imagine this is the case but then I am not the one who argued for faster API calls. I have long made the point that hack OS code is hack OS code and NOTHING makes it faster or smaller. I have no disagreement with you over chasing the fastest algo design possible as that is the place for weird, difficult and obscure code (if it makes it faster).

Where that mentality fails is when its applied to specification OS code which is nothing more than hack interaction with the OS for many functions that cannot be done any other way. You can make it far slower to develop, impossible to modify or maintain and with no hope of anyone else reading it but as Paul well pointed out, code designed like that is amateur hobbyist code, not profesional reusable code.

MASM emulates OS specified C style API very well so it is at no disadvantage in producing this type of code but where it really shines is when you need something that is not pre-canned out of the box and there are NO RULES in how you write custom code as long as you can get it reliable and usable.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Vortex

lingo,

To make it clear, I am never and I was never one of your friends. Please leave all of us in peace.

Seb

Geez, why are some people teaming up and moaning at lingo because of his coding style or his POV of Assembly coding? Maybe his code is unreadable to some, but it does the job and that's the important thing, isn't it. And I don't appreciate Vortex's comment in which he encourages lingo to "leave us all in peace" (basically telling him to leave this forum) - lingo is and has been supplying highly-optimized functions for a long time now, so I doubt I speak for myself when I say I want lingo to stay here and do what he's good at - coding speedy, but oh so unreadable to some, functions. Some people, whom I really thought higher of before, really disappointed me in this thread.

And PBrennick, I disagree, I doubt Vortex "can code better" in Assembly AND C++ than lingo, but oh, who am I to say that, I'll probably get flamed now as well.

PBrennick

Whenever somebody hears something they disagree with, they call it flaming. This is very disappointing behavior. Lingo was banned for reasons he well knows. I have made very positive comments about his coding, also. Read the MessageBox thread or even this one.

However, how on earth can you make a statement as to whether he is better than someone else at coding when he has never written and posted a completely functional, useful program. Vortex has, many, many times so where does this information come from?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Vortex

Seb,

To avoid any misunderstandings, I never told him to leave the forum. What I am trying to tell is that one should not start threads like this one becoming a flame war.

I don't mind at all if lingo or any other person is better than me, I would rather mind my own business and I would suggest you to do the same, plus I believe that a member of this forum does not need your advocacy to exhibit or prove his particular coding skills.

Seb

PBrennick,

I don't consider differing opinions to equal flaming, I can however see the difference between flaming and when someone's posting constructive criticism or an interesting post. And regarding my comment on "Vortex vs lingo", why shouldn't I be able to make such a comment? I've seen some codes from both of 'em, and as far as I'm concerned, I consider lingo to be a better coder. I'm sure Vortex is a great coder and surely in lingo's class, but that's just my personal opinion. How can you make such a comment then? Have you seen what lingo does personally and never publishes here or perhaps anywhere else? Have you seen what he might be doing professionally? I don't think so. Let's drop this "who's the better coder"-crap now, please. It's not what this thread's about.

Vortex,

thanks for clearing that up, but as far as I know, hutch was the one who created this thread based on some off-topic posts in another thread, or am I wrong? I don't think lingo's intentions were to stirr up a flamewar, but I do recognize his right to share his views on the topic of discussion, and what it basically emerged to was a flamewar because people do pick sides, and some post less constructive posts than other.

Vortex

Seb,

Let's make it simple. lingo is interested in optimization. All of us, we know his talents in this field. If you tell me that a good assembly coder's work is evaluated on his optimization skills, I will not deny it. I am happy with my general programming practices and I have no any problem if x or y can do better than me using his own optimization knowledge. lingo or any other individual can keep it secret and decide to not to release his chef d'oevres or masterpieces to public. The problem is when one comes to prove himself. In my opinion, a mature member of this forum does not to need to prove himself in this way. I don't need it and I believe lingo or any other member of this member does not need to make such an effort.

Seb

Vortex,

I agree with what you say, I also think this whole "who's the better coder"-discussion was actually totally unnecessary and off-topic. I don't know why PBrennick sort of (I also share a piece of the blame for responding to it) brought it up anyway, but let's leave it at that.

PBrennick

The only reason why I did was because he was giving the wrong impression about friendship with Vortex. If I had left it go, a lot of people would have reached the wrong conclusion. I am very defensive about Vortex and will remain so. He likes it that way. I have no ax to grind with Lingo or anyone else here and most certainly not you. I just expect people to be truthful, that is all.

As far as this topic goes, I think it is a waste of bandwidth. If it is a discussion on optimization, I think it is a lost art. I have seen some people do some nice things in small procs but no one has ever optimized a complete app on this forum, like an editor for example. When Lingo wrote that Message Pump, I was hoping that there was more to come. I guess not.  :'(

Anyway, for some reason the guys who are VERY good at optimization get real quiet whenever Lingo comes around. Would it not be great if someone wrote an editor that was highly optimized to 'truly' see if there IS any point to it all. It is my personal belief that it would not yield much dividends and the only thing anyone would get out of it would be self-satisfaction.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

ecube

Why is everyone attacking Lingo? You should be praising him for his various contributions to the ASM community and for helping it grow to what it's become today. Whether you like his personality or not I don't really see the point of saying negative things about him infront of everyone, that's immature in my opinion and should of been handled via PM or not at all. Lingo is without a doubt a highly skilled and talented programmer and a great benefit to anything hes apart of.