From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Logical or bitwise operators

Logical or bitwise operators - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Logical or bitwise operators

- [Instructor] Now we know how to move data, let's look at what we can do with it. The first set of instructions we'll look at are the logical or bitwise operators. There are many bitwise instructions in 64 bits assembler, but we'll just look at the more common ones at this stage. The AND operator takes two values. We sometimes call the source value, a mask. The instruction compares the two values bit by bit. If both bits are one, then the result is one. Otherwise the result is a zero. We can see that when we mask a value of 28FD with a mask of 333, we get the result 2031. The AND operator is commonly used to mask off specific bits or bytes in a word. The NOT operator is used to switch the bits in a value, making a one into a zero and a zero into a one. So, NOT 28FD is D702. The XOR is a very useful operator. This will result in a one if one of the bits is one and the other is a zero. If both bits are the…

Contents