OR
By Vesper Vei
1 minute read
Table of Contents
OR (or)
Basic function
OR performs a bitwise logical OR operation:
x1 = x1 | x2Instruction format
or x1, x2The same constraints as AND apply:
- x1 can be a register or memory
- x2 can be a register or an immediate value
- Memory-to-memory is not allowed
Behavioral characteristics
- Used to set specific bits
- CF and OF are cleared
- If the result is 0 → ZF = 1, otherwise ZF = 0
Examples
or eax, 1; 设置最低位
or rax, rbxor [rbp-8], 0x80Common uses
- Set flags or masks
- Merge flags
- Construct specific bitmaps