This is where the idea of seperated code and data came from originally, dos model segmented architecture where you could not put data in the code segment.


That's an entirely different matter, and on top of that, it's not true.
You can set ds=cs, and then you can have both data and code in the same segment. Besides, even if you had ds!=cs, you could still use the cs: prefix to address data in the code segment anyway.

When it does not matter. Why build the fastest MessageBox on the planet when the user will not see the difference.


To which I answer: why are you using asm then? Might aswell use Delphi or VB or something, easier to read and maintain, faster to write.

When it does not perform any better. Casual string reads are by no means a performance issue so you can read them from data, code, resource section, file or more or less where-ever you like and it just does not go any faster.


To which I answer: why would you deliberately choose a bad method, when there are no advantages to it over using a better method?

I trust the clock far more than I trust opinion and that is what I base what I say on. Hunger is bad, war is worse and code that breaks the rules is truly wicked but none of it is worth losing sleep over.


But it is worth arguing about for many posts, and insulting other people for?
Besides, the point was not whether the code was breaking rules or not... it was about how the code impaired cache performance and trashed part of cachelines, of which you don't have too many, especially on P4-CPUs. A very important issue to asm programmers I would say, assuming they write asm because no other language gives them the performance they require.
Posted on 2004-02-16 03:46:16 by Henk-Jan
Henk,

I have seen this scenario before, f0dder drops a smartarse wisecrack and a colleague of his starts an argument that cannot be resolved. I note you are from the Netherlands and write in much the same style so it seems to fit that you are f0dders colleague.


But it is worth arguing about for many posts, and insulting other people for? Besides, the point was not whether the code was breaking rules or not... it was about how the code impaired cache performance and trashed part of cachelines, of which you don't have too many, especially on P4-CPUs. A very important issue to asm programmers I would say, assuming they write asm because no other language gives them the performance they require.

Here is where the action is in your posting setting the forum up for another round of the f0dder and his colleague show.

Now all I will address is the technical part of your comment.

it was about how the code impaired cache performance and trashed part of cachelines, of which you don't have too many, especially on P4-CPUs.

I guess you mean how "data" impares cache performance when it is in the code section.

Having owned Intel processors from 286 upwards and including two PIV machines, I do in fact know a little about the development of multiple pipelines and different level caches on later hardware.

Any data access is slow first time and it does not matter where it gets the data. If the required data is not in the cache it must be fetched and this is slow, whether from the .DATA section, from the resource section or embedded in the code section.

Now assuming that one slow fetch is better than another slow fetch is a mistake yet zero terminated strings fetched on a casual basis for any api call simply don't matter, however you access them as the api call to display it is powers slower that BAD assembler code.

Now if you want to write code that avoids one form of slow first time fetch, fine but don't expect that the replacement will matter apart from an arbitrary personal preference in performance terms as the code you write will suffer exactly the same problem accessing a string from the .DATA section and thats even if you align the string.

Now on another matter that is probably closer to your heart, the latest cheapie video card I put in the new box is a 128 meg RealTek which seems to work fine. I needed it for the new 21 inch monitor.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-02-16 07:17:32 by hutch--
You didn't comment on the cacheline trashing aspect of the code, or on the fact that data in the datasegment has a much higher chance to be cached because of previous accesses in the area.
Besides, why are you bothering to promote bad/slow code on an assembly forum? I don't think anyone is interested.
And arguments cannot be resolved with people who refuse to admit it when someone points out their errors. How childish.
Posted on 2004-02-16 07:42:42 by Henk-Jan
Having seen the style before of people who assert their own words as Gospel truth and apparently from the same person again, I am not going to sit up at night wringing my hands in the face of such genius.

Now if you could clock the cache line losses of fetching text from the DATA section before using the text for display by means of an API call, you may have something to say but apart from some second hand processor theory, you have no means of verifying your theory so I will truly sleep well tonight.

Benchmarks talk, the rest walk.

To music, :tongue:

And it seems, (pause) Ah been here before.
Ooooooooooh and it makes me wonder, (pause)
whats goin' on.
OoooOoooOoh and it makes me wonderrrrrrrrrr.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-02-16 08:18:41 by hutch--
Now if you could clock the cache line losses of fetching text from the DATA section before using the text for display by means of an API call, you may have something to say but apart from some second hand processor theory, you have no means of verifying your theory so I will truly sleep well tonight.


Firstly it is wrong to claim this code can only be used by API calls. It can be used in any kind of code.
Secondly it is wrong that all API-calls are slow. Things like strlen()/strcmp()/strcpy()/strcat()/etc for example are quite fast, especially on small strings, and the cache miss WILL be noticable.
Thirdly, you still haven't commented on the cacheline trashing aspect of the code, or on the fact that data in the datasegment has a much higher chance to be cached because of previous accesses in the area.
In short, you're not taking the responsibilty you have as a 'role model' for the Win32ASM world, and you are deliberately teaching people bad coding practice, only to save your own ego. You even insult people with more knowledge than you do, because you think you can get away with it, because of your 'role model'-position. How pathetic.
Posted on 2004-02-16 09:33:56 by Henk-Jan
smile, :tongue:


In short, you're not taking the responsibilty you have as a 'role model' for the Win32ASM world, and you are deliberately teaching people bad coding practice, only to save your own ego. You even insult people with more knowledge than you do, because you think you can get away with it, because of your 'role model'-position. How pathetic.

Its always a pleasure to see someone reveal themselves.

1. and you are deliberately teaching people bad coding practice.

This is true, if fact I am responsible for using some truly WICKED programming practices that many other assembler programmers agree with.

2. because you think you can get away with it.

Well in fact I HAVE been getting away with little tricks like embedding data in the code section of very small executables for YEARS and it works fine and the cache issue has never made the program refuse to start or run slow or in fact any other problem. The reason is that it is part of the PE specification of using a FLAT memory model.

3. You even insult people with more knowledge than you do.

Like yourself for example ? Forgive me for not offering to bow in awe of such profundities.

4. How pathetic.

You are right here, it fits your own comments perfectly.

Now get the key, wind f0dder up to make some other stupid comment and you may have a chance of turning Harold's forum into a circus again.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-02-16 18:16:41 by hutch--
This is true, if fact I am responsible for using some truly WICKED programming practices that many other assembler programmers agree with.


No decent assembly programmer, such as myself or f0dder agree with you on this issue however, for reasons stated before, regarding cache.

Well in fact I HAVE been getting away with little tricks like embedding data in the code section of very small executables for YEARS and it works fine and the cache issue has never made the program refuse to start or run slow or in fact any other problem.


You might aswell code in basic if you don't care about performance anyway... oh wait, you do...
And remember, just because something works doesn't mean it's the proper way to do it.

The reason is that it is part of the PE specification of using a FLAT memory model.


Someone is missing the point here. Firstly, as stated before, it can also be done in DOS, and probably in most other OSes, with their own executable specifications, flat memory model or not.
Secondly, nobody ever claimed it doesn't work, so stop sidetracking.

Like yourself for example ? Forgive me for not offering to bow in awe of such profundities.


Like f0dder, obviously. He makes a valid technical point about a weakness of one of your macros, and you have to insult his skills. Don't worry, I've reported your post to the moderators, and I will continue doing so until you behave, or get banned for insulting the members and starting useless endless discussions about things that aren't even to the point.
Or what about downright lies? Like the ones about SGI servers?
Someone has to stop you from lying to the forum members, don't you think?
Posted on 2004-02-16 18:58:25 by Henk-Jan
No decent assembly programmer, such as myself or f0dder agree with you on this issue however, for reasons stated before, regarding cache.


Excuse me ??? who are you to decide what a decent assembly programmer is and how do you know if they all agree with you or not ? Why not just say you or f0dder don't agree and not lump in everybody all at once. I have exceptions with some of the programming practices of f0dder, particularly his reliance on the heap for everything while I generally prefer VirtualAlloc but I don't go around implying that he is anything less than the excellent programmer he is.
Posted on 2004-02-16 19:04:11 by donkey
I also do not care for the cache unless is inside one of my inner loops. Showing some message in a Messagebox on screen hardly qualifys for my "inner loop" definition. For the rest of my asm code i am quite happy to usee things that are simpler and much easyer to understand -- like some HLL constructs

So although i do NOT use Hutch's method and I prefer defineing strings in .data zone i can not blame him either. I recall that Forth mixes code an data quite a lot and NOT beeing able to do something is hardly the definition of a feature IMHO....even IF it promises a lot of speed improvements ...

Beeing able to do as much as possible with as little rules as required and simplicty...
are a far much beter concept than separating CODE from DATA just to gain some extra speed ... taken to extreems IF we are unable to mix code with data then we can NOT compile/assemble anything anymore.

Yes i generally obey the rules, but it dosent mean that i think they are good, in that case i would have lost my common sense for ever :tongue:

So i guess each people is free to make his own decissions and i recomend you to stop attacking Hutch just based on his decissions.

It is fair that you say you do not like his decissions and show your arguments for that...

It is also fair for him to show his arguments and experience on this issue and is hir right to stick to his own options no matter what...

BUT the name calling in the reported post is... pretty on the edge already :mad:

Again the original post was about how to do C like inline strings in MASM and printf, and this has exploded into an useless fight about who's method is better...

Lets leave every man think for himself, i am sure they can make their own decissions if presented with enough options and just shown each advantage/disadvantage for each method
Posted on 2004-02-16 20:18:50 by BogdanOntanu
I am pleased to see that the author has come clean at last and what we now have is another dose of the f0dder and scali show.

Now if you name is actually Henk, I respect at least that much but again sneaking into this forum with the same approach as the last few times to start a fight under another name does not win any accolades from anyone.

No decent assembly programmer, such as myself or f0dder agree with you on this issue however, for reasons stated before, regarding cache.

The self engrandisement is truly underwhelming here. The person who argues from the position of their own status is indeed a fool. When it comes to quoting authoritive technical reference, companies like Microsoft and Intel do know what they are talking about and publish the specifications in the process.


Like f0dder, obviously. He makes a valid technical point about a weakness of one of your macros, and you have to insult his skills.

f0dder will have to carry the cross for his own smartarse wisecracks, particularly as his assertion about data in the code section is as ill informed as your own.

Don't worry, I've reported your post to the moderators, and I will continue doing so until you behave, or get banned for insulting the members and starting useless endless discussions about things that aren't even to the point.

Do you remember the reason why you were banned last time ? I seriously doubt that Harold will be mislead by your comments this time either. Its simply a matter of time until he pulls the plug again for doing exactly what you did last time, lose another argument that you astarted.

Or what about downright lies? Like the ones about SGI servers?

I guess you are still smarting from making a fool of yourself back then with the nonsense you were sprouting about your PC being a SG killer. The answer is not to make such foolish assertions and get caught out for it.

There are enough programmers here who have forgoten more than you know so its not like you wil succeed in influencing anyone about the restrictions you wish to impose on assembler prgramming.

Writing code and data whereever you like is part of the freedom of assembler programming and the PE specifications are certainly not subject to your interpretation.

Not knowing the difference between critical algorithms and hack OS code is your problem as is your assertion that embedded data in the code section is BAD in EVERY instance.

Now to keep you up to date, I have just about finished building a new box with a late model PIV, an 800 meg FSB Intel board, 2 gig of ddr400 memory, a pair of 120 gig SATA drives and the latest cheapie video card with 128 meg of memory, all of the latest hardware support etc ..... and I can promise you it is not as fast as an SGI box.

Fit it with twin turbochargers and an afterburner and it still will not be as fast as an SGI box. The difference is I don't pretend that it ever will be as I have no foreseeable use for that type of hardware.

The problem you had then as now is that not even in your wildest dreams can you put that much grunt into a desktop PC.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-02-17 01:59:58 by hutch--
Yes, I know you'll stay 'reporting' this in various eloquent terms but that only pisses me off. The reporting feature is for reporting actual 'problems', not for your personal vendetta against hutch.

If you guys want to discuss something, that's fine with me but don't go cry-baby on each other when people defend their point of view. I'm pretty sure there are some nicer terms to use than the word 'junk', so as far as I'm concerned f0dder had the rebuttal coming..wether or not it's a valid rebuttal is pretty much besides the point.

"If you can't take the heat, stay out of the kitchen" seems appropriate in this case.

Here's something cool to discuss :p http://www.fujitsu-siemens.de/rl/produkte/unixserv/primepower2500.html
Posted on 2004-02-17 03:57:55 by Hiroshimator
Does Hutch realize that SGI uses ATi GPUs in their visualization systems?
The exact same ATi GPUs as in many PCs and Macs?
Thank you.
For the rest, any asm programmer that deliberately screws up cache-performance is an idiot, that's why all decent asm programmers must agree with me.
There's no personal vendetta against hutch from me.
I am just sick and tired of his bad advice, his lies, and the way he starts flamewars when anyone points it out.
I am only trying to filter the bad information out of the board this way, because none of the members will have advantage from learning bad things.
And if you don't see my point, you're just stupid. It's so incredibly obvious what I just said. Or can anyone deny that there is cache trashing, and that this is not what you want? Or that SGI actually uses PC parts in their systems? Or etc? So why do you allow someone to spread such bad info and defend him when someone else points out the truth instead? Stupid, I have no other word for it.
Posted on 2004-02-17 04:07:54 by Henk-Jan
but I don't go around implying that he is anything less than the excellent programmer he is.


So you agree that he is a decent programmer? What's your point then? And f0dder will also agree that I'm a decent programmer, I'm sure. And we also agree on the issue. So what's your point?
Posted on 2004-02-17 04:13:10 by Henk-Jan

For the rest, any asm programmer that deliberately screws up cache-performance is an idiot


Hmmm, that reminds me of MediaMarkt billboard advertisements a few months back. "Big opening at <here was the date>. Only an idion can miss this event". I do not like being called an idiot, neither directly nor indirectly. Who are you to call me an idiot? Go search for idiots in your sandbox.
Posted on 2004-02-17 04:16:17 by Morris
Hi Henk-Jan,

Good to know that everybody that doesn't agree with you is stupid. I'll keep that in mind next time I answer a question, I'll just PM you to ask your opinion first then wait for your answer. After all, I wouldn't want to advance an idea that did not comply with the Henk-Jan definition of good assembly programming. :rolleyes:

OMG, I could have shaved 6 clocks off of that call to MessageBoxA, I had better get back to work before HJ sees this...
Posted on 2004-02-17 04:19:14 by donkey
Lets leave every man think for himself, i am sure they can make their own decissions if presented with enough options and just shown each advantage/disadvantage for each method


That's the whole point, isn't it?
I give plenty of valid technical reasons why people should not be using the method that hutch proposed (after hutch insulted f0dder when he first pointed it out, for which he should have been banned already, I have been banned for less anyway).
Hutch simply denies that any of this is true, and goes on sprouting crap about how PE makes it possible and some compiler junk etc...
I even denied that only PE makes it possible, because you can do it in DOS aswell, I even said how, and still he goes on about it...
That's just the thing. He will NOT admit that f0dder and I do have valid points, and that his method DOES have several disadvantages. I don't care if he still uses it or not, but I want the people who come here for help to understand what the differences are. And hutch taking these things personal, and starting his own ego-propaganda to 'cover up his mistake' isn't helping anyone, that is my point. How can people make up their minds about what method to use, when someone denies it when others list VALID, TECHNICAL limitations to his method? How will they know who to believe?
Posted on 2004-02-17 04:19:55 by Henk-Jan
The world works much like networking on a computer: as long as you use the agreed-upon 'protocol', the receiving side(s) will not discard your packet of information.

Just stick to the point and not to the person and let others fend for themselves if they engaged the battle, those who feel uncapable to do so have us, the moderating team, to fall back on.

We're all adults, so a warmer discussion is allowed as long as you keep it decent in terms of 'names of affection' you bestow on each other ;)
Posted on 2004-02-17 04:20:39 by Hiroshimator
When it comes to quoting authoritive technical reference, companies like Microsoft and Intel do know what they are talking about and publish the specifications in the process.


Which is why I pointed out that you can find what I said in the Intel manual. But at that time it probably didn't suit you very well, so you must have ignored it.

f0dder will have to carry the cross for his own smartarse wisecracks, particularly as his assertion about data in the code section is as ill informed as your own.


It's mentioned in those Intel specs you spoke about though. Or does that suddenly not count anymore, when it doesn't suit you?

Do you remember the reason why you were banned last time ?


I got banned because for some reason he was afraid to ban you. Most moderators are your henchmen, and he would have a lot to answer for. I basically got banned for being right about a discussion in my area: computer graphics. If anyone other than you were the opponent, I would never have been banned.
Your position continues to weaken though. Eventually the moderators will see you what you really are. It's only a matter of time.

I guess you are still smarting from making a fool of yourself back then with the nonsense you were sprouting about your PC being a SG killer. The answer is not to make such foolish assertions and get caught out for it.


The only foolish assumptions were coming from you, and we have offered plenty of proof for anyone to see it, except for yourself.
Same as here, ego-crap. You cannot admit it when you are wrong. So you will start a flamewar, abuse your status and influence and get the other banned. If the moderators on this board would care to read the Intel manuals, and read up on SGI hardware, etc, they would see that I am right in both cases, and you are defending a bunch of lies at best.

There are enough programmers here who have forgoten more than you know so its not like you wil succeed in influencing anyone about the restrictions you wish to impose on assembler prgramming.


I am not imposing any restrictions on anyone. I just gave some technical reasons why your method may be less desirable than the alternatives, in some cases. You just try to make this into a different issue, an issue that you can win. But an issue that I never spoke about, and anyone reading the entire thread can see that. Exactly the same as before.

Fit it with twin turbochargers and an afterburner and it still will not be as fast as an SGI box. The difference is I don't pretend that it ever will be as I have no foreseeable use for that type of hardware.


Exactly the same as just above... I never said this, yet you try to defend this issue, not the one we should have been discussing. And that issue is that SGI uses PC parts to build their systems. This is a fact, and there is nothing you can do about it.
Posted on 2004-02-17 04:31:08 by Henk-Jan
Good to know that everybody that doesn't agree with you is stupid.


I never said that, I just said that if you DELIBERATELY do something while you know it's not the right way to do it, and you also know the right way to do it (assuming that the right way and the wrong way are both equally easy to do), well then you're being an idiot, aren't you? It doesn't make sense to me anyway.
Posted on 2004-02-17 04:32:56 by Henk-Jan
Either cut it out now and discuss things nicely or take a hike.

If you want to insult people all the time, fork over some money and do things that way on your forum.

As long as you're here and I pay for this, you'll respect my wish to respect each other or you'll have to go look for another place to visit.

It's the "price" all need to pay for access to this forum.
Posted on 2004-02-17 04:40:50 by Hiroshimator