Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-12-2004, 14:54
peleon peleon is offline
Friend
 
Join Date: Sep 2003
Posts: 174
Rept. Given: 0
Rept. Rcvd 7 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
peleon Reputation: 7
Hello 3ch0,

First, I have to admit that book mess up a lot what AND/OR/XOR is. It's a simple concept that is hidden in that text line

About ORing, well, I guess the the author wants to say OR-ing (verb finished in -ing) (that磗 english i suppose ). So, that's the same as saying: "Apply the OR operator..."

My explanation about this:

OR = binary add

0 or 0 = 0
1 or 0 = 1
0 or 1 = 1
1 or 1 = 1

AND = binary multiply

0 and 0 = 0
0 and 1 = 0
1 and 0 = 0
1 and 1 = 1

XOR = exclusive OR

0 xor 0 = 0
0 xor 1 = 1
1 xor 0 = 1
1 xor 1 = 0

So, using this 3 operators you can play with the bits in a registry/memory as you like. For example, suppose that you have in the EAX register a value. If you want to know if that number is odd or even you can make the following:

and eax, 1 ; will leave the bit-0 untouched to check if even or odd

.if eax == 1

; we are odd!

.else

; we are even!

.endif

Hope this helps

Last edited by peleon; 05-12-2004 at 14:56.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly ... these might be useful to someone yaa General Discussion 6 04-28-2005 18:17
Assembly obfusscation Zigmund General Discussion 6 04-23-2004 01:14


All times are GMT +8. The time now is 19:40.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )