x64 Assembly Tutorial 10: Boolean Instructions AND, OR, XOR and NOT

x64 Assembly Tutorial 10: Boolean Instructions AND, OR, XOR and NOT

Creel

1 десятилетие назад

12,451 Просмотров

In this, the 10th tutorial, we'll be going through the Boolean instructions AND, OR, XOR and NOT. These are sometimes called logical instructions or bitwise instructions. XOR is not one of the original Boolean operations but computers use it so frequently that it I've included it in the same tutorial as the others.

These instructions are called Boolean after George Bool, a Mathematician from the 1800's. Each operation (other than the NOT instruction) takes two operands and performs the Boolean operation on each pair of bits from the operands. Instead of using Boolean algebra to determine a single True or False value from an equation, in computing we tend to perform Boolean operations on all 8 bits of a byte at once. In fact computers can't deal with any fewer than 8 bits at once, so we use these Boolean operations to mask bits allowing us to examine values at a bit by bit level.

You can do Boolean operations on all the register sizes including the MMX, SSE and AVX registers, but more on this later!

Тэги:

#asm #assembly #x64 #x86 #boolean #operations #assembly_language_tutorial #basic #beginners #examples #explained #easy #introduction #mathematics #boolean_algebra #logical #logic_operations #logic #low_level #and #or #not #xor
Ссылки и html тэги не поддерживаются


Комментарии: