Difference between revisions of "Assembler:Commands:OR"
m (Reverted edits by This content is not available (Talk) to last revision by TheyCallMeTim13) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
Performs a bitwise inclusive OR operation between the destination (first) and source (second) operands and stores the result in the destination operand location. The source operand can be an immediate, a register, or a memory location; the destination operand can be a register or a memory location. (However, two memory operands cannot be used in one instruction.) Each bit of the result of the OR instruction is set to 0 if both corresponding bits of the first and second operands are 0; otherwise, each bit is set to 1. | Performs a bitwise inclusive OR operation between the destination (first) and source (second) operands and stores the result in the destination operand location. The source operand can be an immediate, a register, or a memory location; the destination operand can be a register or a memory location. (However, two memory operands cannot be used in one instruction.) Each bit of the result of the OR instruction is set to 0 if both corresponding bits of the first and second operands are 0; otherwise, each bit is set to 1. | ||
− | [http://x86 | + | [http://c9x.me/x86/html/file_module_x86_id_219.html c9x.me/x86/html/file_module_x86_id_219.html] |
</div> | </div> | ||
Line 65: | Line 65: | ||
{{AssemblerCommandSeeAlso}} | {{AssemblerCommandSeeAlso}} | ||
− | + | {{Template:AssemblerCommandExternalLinks}} | |
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 19:07, 18 March 2019
command or destination, source
The OR instruction is used for supporting logical expression by performing bitwise OR operation. The bitwise OR operator returns 1, if the matching bits from either or both operands are one. It returns 0, if both the bits are zero.
destination = destination | source
Example:
| destination: 0101 | | source: 0011 | |-----------------------------------| | After OR -> destination: 0111 |
The OF and CF flags are cleared; the SF, ZF, and PF flags are set according to the result. The state of the AF flag is undefined.
Performs a bitwise inclusive OR operation between the destination (first) and source (second) operands and stores the result in the destination operand location. The source operand can be an immediate, a register, or a memory location; the destination operand can be a register or a memory location. (However, two memory operands cannot be used in one instruction.) Each bit of the result of the OR instruction is set to 0 if both corresponding bits of the first and second operands are 0; otherwise, each bit is set to 1.
Command Parameters[edit]
Parameter | Description |
---|---|
destination | The destination operand |
source | The source operand |
Examples[edit]
or al,1
or ax,1
or ax,1
or eax,1
or rax,1
or al,al
or ax,ax
or ax,ax
or eax,eax
or rax,rax
or [eax],eax
or [rax],rax
or [00123ABC],eax
or [SomeSymbol],rax