x86 Assembly Language Reference Manual

Logical Inclusive OR (or)

or{bwl}  	reg[8|16|32], r/m[8|16|32]
or{bwl}  	r/m[8|16|32], reg[8|16|32]
or{bwl}  	imm[8|16|32], r/m[8|16|32]
Operation

reg[8|16|32] LOR r/m[8|16|32] -> r/m[8|16|32]

r/m[8|16|32] LOR reg[8|16|32] -> reg[8|16|32]

imm[8|16|32] LOR r/m[8|16|32] -> r/m[8|16|32]

Description

Performs a logical OR of each bit in the values specified by the two operands and stores the result in the second operand.

Table 2-3 Inclusive OR

Values 

Result 

0 LOR 0 

0 LOR 1 

1 LOR 0 

1 LOR 1 

Example

Perform an 8-bit logical OR of the constant, 0xff, and the AL register:

orb $0xff, %al

Perform a 16-bit logical OR of the constant, 0xff83, and the contents of the effective address (addressed by the EDI register plus an offset of 4):

orw $0xff83, 4(%edi)

Perform a 32-bit logical OR of the EDX register and the contents of the effective address (addressed by the EDI register plus an offset of 4):

orl %edx, 4(%edi)