flat assembler
Message board for the users of flat assembler.

Index > Heap > the world is waiting for ...

Goto page Previous  1, 2, 3, 4, 5, 6
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
tom tobias wrote:
Simply purchase a faster cpu, if execution speed is important.
But what if I already have the fastest CPU? Then what do I do? Tell the customer that they will have to wait 5 years until hardware catches up? No way, I give them a solution now that does not require them to buy 4 times the hardware to achieve the same task.

However I see a good realisation here from tom tobias. tom (if I am allowed to call him that) is showing that he recognises there are times when execution speed is important. This is half the battle won, and also nullifies many of tom tobias' previous arguments about how, say, 3us vs 4us is not noticeable. Now we have only to show that extra speed is not always available by simply buying a "faster cpu", because there may be no faster cpu available to us. And, in reality, I have found that this falls into the MHz myth. Very often a CPU with more cache (rather then more MHz) will give the most amount of speed-up. I have a striking example of this in action. If I remember later I will post the results from my tests when I am back at my desk.
Post 11 Jun 2009, 02:40
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
I have no problem with people attitudes who won't spend 5 weeks on a 10 line piece of code for optimization (well unless they really like it, or they get an idea later Wink). But for something as trivial as xor reg, reg?

Even the simplest compiler will do that for you. Really... Rolling Eyes

_________________
Previously known as The_Grey_Beast
Post 11 Jun 2009, 03:05
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
tom tobias wrote:
revolution wrote:
it certainly pertains to how an instruction like xor reg,reg can help to keep our critical loops within the cache to keep the system running smoothly and quickly and at the same time use less energy to complete the same workload.

LocoDelAssembly wrote:
I cannot see "mov reg, 0" as a "clearing" operation, I see it more like "ASSIGNING to reg the constant 0", then I need an extra thinking to realize that the state of the bits will be the same as "xor reg, reg".

Thank you both for your comments.
Here is another quote, from my old copy of a very obsolete Intel486 Microprocessor Family Programmer's Reference Manual, page 26-287, describing XOR:
Quote:
Flags Affected: The CF and OF flags are cleared; the SF, ZF, and PF flags are set according to the result; ...

Page 26-211, describing MOV:
Quote:
Flags Affected: none

Programming: no hidden operations, everything is transparent.
Coding: everything concealed, as much as possible.

Cache versus non-cache: not a persuasive argument. Simply purchase a faster cpu, if execution speed is important. I simply overclock. Yesterday's code runs 10,000 times faster in the most recent cpu. What, cache was an important criterion in 1980??? 1990???? 2000??? The issue here is NOT cache versus non-cache--This is a false argument.

A much better argument, if it were true, and it is not, would be that one saves a lot more time with XOR, compared with MOV, because one need not add the additional instructions required to change the flags, if one employs XOR. The problem, folks, is not SAVING TIME, it is CLARITY OF ALGORITHM, or more precisely, absence thereof.

If execution speed is faster with xor than mov, and I still am waiting for a REFERENCE, from Intel literature, documenting this supposed fact, then, one MUST demonstrate HOW the slower execution speed for a particular program PREVENTS its function within the specification parameters, when employing MOV, rather than XOR.

Show me the test results from a meaningful program, implemented in two versions: one with XOR, one with MOV, whereby the program's execution FAILS, due to slow speed, with MOV, but functions correctly, due to faster speed, with XOR......No one on this forum can produce such data, for it does not exist. No one here can do this, because it isn't the case that XOR is perceptably faster than MOV, to a human operator.

The literature demanding use of XOR dates from 30 years ago, and cpu execution speed today renders those arguments, moot.

The issue here is debugging, (or its twin sister, modifying a program decades later), which requires readability of the source code, not of the individual instruction, but of the algorithm. Most code, especially from this forum, including FASM itself, is either undocumented, or poorly documented, generally, deliberately, to PREVENT people from understanding what one seeks to accomplish.

We don't need a comment which says:

xor, reg,reg ; clear the register

(and, hehehe, also change the flags!!! hahaha. good luck trying to figure out what we are doing, you jerk.)

We need a PROGRAM, in which the opcodes are simple manifestations of the algorithm, without any hidden operations, such as changing flags, without explanation.

end of story.
Rolling Eyes
What's unreadable/obscure/confusing about "zero eax"?



Code:
macro zero reg{xor reg,reg}    

Just put that in one of your includes, or if you don't use includes, then at the top of your file.
Post 11 Jun 2009, 04:28
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
sleepsleep wrote:
the world is waiting for...
... efficient, small, long-life, ecologically neutral sources of energy. Wink
Post 12 Jun 2009, 13:56
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> the world is waiting for...
> ... efficient, small, long-life, ecologically neutral sources of energy.

NO. They already exist, just start using them. Wink This doesn't mean that one can't make any of them even better, though.
Post 14 Jun 2009, 10:53
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
DOS386 wrote:
> the world is waiting for...
> ... efficient, small, long-life, ecologically neutral sources of energy.

NO. They already exist, just start using them. Wink This doesn't mean that one can't make any of them even better, though.
Give an example of such existing cheap source of energy. Any accumulator used for example in mobile phone and other mobile device is weak, short-life and toxic for environment.
Post 14 Jun 2009, 12:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
MHajduk wrote:
... efficient, small, long-life, ecologically neutral sources of energy. Wink
Maybe this company: http://www.steorn.com/orbo/ Razz
Post 14 Jun 2009, 12:35
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
revolution wrote:
Maybe this company: http://www.steorn.com/orbo/ Razz
Well, I'm like Doubting Thomas - I need to touch in order to believe. Wink I would be glad if such batteries will be widely used in the near future. Razz
Post 14 Jun 2009, 13:03
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
revolution wrote:
MHajduk wrote:
... efficient, small, long-life, ecologically neutral sources of energy. Wink
Maybe this company: http://www.steorn.com/orbo/ Razz
Yay, yet another company "discovering" how to release energy from magnets.

Guess what happens when the (rather small) energy is expended? That's right.. you have to throw it away and find another magnet. Sad

Solar power is weak but at least it will last a few billion years.

Nuclear fission will run out of fuel eventually but at least it's powerful.
Post 14 Jun 2009, 13:47
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i swear, this would works.. someday somebody will discover it.

Image
Post 14 Jun 2009, 16:44
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Referring to the idea of Perpetuum Mobile looks bad and discredits such company as unprofessional. Confused

When I was talking about "efficient, small, long-life, ecologically neutral and cheap sources of energy" I was thinking about something real, what can be constructed accordingly to well known laws of physics.
Post 14 Jun 2009, 18:06
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
was thinking about wii control lately,

what if that control could increase/decrease in its weight? it would be really awesome.
Post 04 Jul 2009, 17:22
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
And just how would it do that?
Post 04 Jul 2009, 17:36
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
let say, in a game,
when you choose a more higher quality weapon, the wii control become heavier. (like real weight)

or, maybe higher level game, the control become more heavy.

and i don't know if you like the feeling (mind tricking) (u can try it urself too)
eg. u ask ur friend to put random 5 bottles (covered) in front of you, then ask you to pick up which one which is empty.

our mind would use the amount of energy that we expect to lift up the bottle based on our experience, but just when you expect so, then u lift up an empty body. (you will feel like kinda... strange and exciting)

and let say if the wii control could decrease and increase its weight randomly several times in a minute.. i think, it would be a new kind of feeling for us human.

the feeling is just... kinda nice. (it happens to me always)
Post 04 Jul 2009, 17:57
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
No, how would the controller increase/decrease its weight?
Post 04 Jul 2009, 18:11
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
someway in future, maybe somebody would find a way to do it.
Post 04 Jul 2009, 18:25
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
windwakr wrote:
No, how would the controller increase/decrease its weight?
Get an electromagnetic room, and make the ground attract it more. Razz

_________________
Previously known as The_Grey_Beast
Post 04 Jul 2009, 19:15
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
sleepsleep wrote:
was thinking about wii control lately,

what if that control could increase/decrease in its weight? it would be really awesome.
Easy. Gyroscopes. It wouldn't really weigh more, but it would be harder to move it. And it would be a self contained system, rather then needing a new room.
Post 05 Jul 2009, 03:01
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
What do you mean it won't weight anymore?
Post 05 Jul 2009, 15:22
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
I mean it would be just as hard to move down as up.
Post 06 Jul 2009, 01:34
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6

< 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.