1/8
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
AND
OR
XOR
TEST
NOT
Five primary bitwise logical instructions that are used to manipulate, test, set, or clear individual bits within registers or memory locations.
Two-operand instructions: INSTRUCTION operand1, operand2
Single-operand instruction: NOT operand1
Syntax Pattern
The first operand can be a register or memory location. The second operand can be a register, memory, or immediate value. Operations directly between two memory locations are not supported.
Rule
These operations update CPU flags, including CF (Carry), OF (Overflow), PF (Parity), SF (Sign), and ZF (Zero).
Flags Affected
AND Instruction
It clears specific bits (masking) or testing bit conditions. Performs a bitwise AND operation (returns 1 only if both corresponding bits are 1).
OR Instruction
Setting specific bits to 1. Performs a bitwise OR operation (returns 1 if at least one corresponding bit is 1).
XOR Instruction
Toggling bits or efficiently clearing registers to zero. Performs a bitwise Exclusive-OR operation (returns 1 if corresponding bits are different, 0 if identical).
TEST Instruction
Checking values or bit states without altering data. Performs a non-destructive bitwise AND operation. It updates CPU flags (e.g., ZF) without modifying the destination operand.
NOT Instruction
Performs a bitwise NOT (one's complement), inverting all bits of the operand (0 becomes 1, 1 becomes 0).