flat assembler
Message board for the users of flat assembler.

Index > Main > XOR EAX,EAX

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
Author
Thread Post new topic Reply to topic
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak
I could never get <> to work (throwing an invoke there) within another invoke yet with the new version... Could you post a whole example that works?
Post 30 Dec 2007, 05:21
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
With combinations of irp and match it can be done, but to what end? It is rather pointless and difficult to debug and maintain.
Post 30 Dec 2007, 05:26
View user's profile Send private message Visit poster's website Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak
Same with other 1 liners. XD
Post 30 Dec 2007, 05:28
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
kohlrak wrote:
Same with other 1 liners. XD
Of course, they were just for fun.
Post 30 Dec 2007, 05:34
View user's profile Send private message Visit poster's website Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak
I mean in other languages. The trick with assembly is that you can break out of one liners a bit easier and still keep the performance.
Post 30 Dec 2007, 05:36
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
tom tobias wrote:
two points:
1. search engine:
A. entering "xor eax,eax", with or without the quotes, yields this thread as first choice, I did not observe the longwinded diatribes of yesteryear anywhere in the output;
B. entering "mov eax,0", with or without the quotation marks, also ignores the long chants (or some would argue, rants, of bygone days).
C. entering "coding versus programming" also fails to bring up the main threads of former, more passionate, times of glory.
2. THEREFORE:
in summary, to answer your question, NTOSKRNL-VXE, yes, mov eax,0 is the preferred choice among programmers, while xor eax,ecx (oops, just performed an unintentional, and unrecognizeable, boolean operation, as a consequence of a simple typographical mistake, sorry,...) is the choice of 99.99% of FASM forumers. As far as I know, I am the odd man out, the only one on this forum, who will NEVER use a boolean function to clear or test a register. Yes, programming for me is a kind of religious attitude...
"OR, something", as WytRaven so brilliantly demonstrated, (instead of the correct, "CMP, something",) ONLY LEADS TO CONFUSION, when twenty people are working on the same project. Sure, as LocoDelAssembly explained, ONE CAN SAVE precious bytes, HURRAH!!! and, this is EXTREMELY IMPORTANT, because that way, by saving those precious bytes, we have 400 million bytes unused, instead of only 398 million bytes unused, had we employed the more obvious, less error-prone, and more readable, MOV or CMP instructions. Finally, let us not forget the importance of saving TIME, by having an execution requiring a mere 37.1 nanoseconds, instead of 48.6 nanoseconds. Hey, those nanoseconds add up. We are not talking about just a few picoseconds here. This is a GENUINE time savings using XOR, instead of MOV, and OR instead of CMP.
And, finally, as SO MANY ARDENT FASM FORUM members have noted, REAL assembly language programmers, ENJOY writing obscurely. They derive SATISFACTION from creating a tangled mess of CODE, that only THEY can decipher (--LOOK AT FASM ITSELF), instead of a readable PROGRAM. Many of them, even imagine that WRITING CODE is an intrinsic feature, i.e. a desirable attribute, of assembly language CODING (not programming,) in order to assure inscrutable results. Fortunately, the late, Dr. Dandamudi has proved them WRONG. Your initial post is correct, MOV, and CMP are the proper instructions to use, not XOR, and OR, which MUST be reserved exclusively for Boolean arithmetic functions, if one hopes to create a readable program, instead of generating spaghetti code.
Smile
Baloney!

Xor is much less obscure. It's actually a real word, which anyone who has passed 4th grade math knows the meaning of, whereas there is no word known as "mov", and it can not be found in dictionaries.


The proper way to set something to false (or 0, or null, or void, or whatever you want to call it) is obviously with a boolean operator.. and the proper way to test if something is false or not, is also by using a boolean operator!

Using confusing mnenomics like "mov" for such a simple purpose only leads to confusion.. especially since it doesn't even do what it should do based on the name (I'm guessing it stands for move), it copies instead.

For example mov al,ah
If it meant move, then it should move al into ah.. and obviously if you move something to somewhere else, the place it was previously in will be empty! So mov al,ah should be the same as shl ax,8, but it isn't.

Avoid using confusing opcodes like mov, lest people not understand your code.
Post 10 Jun 2009, 13:08
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
Tom: The choice for your so-called "programmers" are HIGH LEVEL LANGUAGES

PERIOD
Can we finally end this discussion?
Post 11 Jun 2009, 00:22
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, 3, 4, 5, 6, 7, 8

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

Powered by rwasa.