# `ori`

[M68K Documentation](https://asm-editor.specy.app/documentation/m68k.md) › [Instructions](https://asm-editor.specy.app/documentation/m68k/instruction.md)

Web page: https://asm-editor.specy.app/documentation/m68k/instruction/ori

**Logical OR immediate**

Category: Logic

Performs a logical OR of an immediate value and the second operand, storing the result in the second operand.

Used in: [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/m68k/think-in-assembly/arithmetic-logic-and-bits.md) (M68K assembly), [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/assembly-basics/think-in-assembly/arithmetic-logic-and-bits.md) (Assembly basics)

## Flags

| Flag | Effect |
| --- | --- |
| X | not changed |
| N | set from the result |
| Z | set from the result |
| V | always 0 |
| C | always 0 |

## Forms

- `ori #imm, <ea>` · Sizes .b .w .l, .w by default
  - Destination: Dn, (An), (An)+, -(An), d(An), d(An,Xn), abs (data alterable)
- `ori #imm, ccr` · Size .b

## Privileged

These forms require supervisor mode, the mode a program starts in. In user mode they raise a privilege violation. See [user and supervisor mode](https://asm-editor.specy.app/documentation/m68k/exceptions/modes.md).

- `ori #imm, sr` · Size .w

## Operands

- [`#imm`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/immediate.md): An immediate value written after `#`: a number, character or label, such as `#10`, `#$FF` or `#'a'`. It must fit the operation’s size: byte `-128` to `255`, word `-32768` to `65535`, or long `-2147483648` to `4294967295`; signed and unsigned spellings are accepted.
- [`<ea>`](https://asm-editor.specy.app/documentation/m68k/addressing-mode.md): An operand using one of the addressing modes listed for this form. The list determines whether it can be a register, memory or an immediate value. With `opt p=68020`, an allowed `d(An,Xn)` or `d(PC,Xn)` mode also permits the corresponding 68020 indexed and memory indirect forms. See [68020 addressing](https://asm-editor.specy.app/documentation/m68k/addressing-mode/68020.md).
- [`ccr`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/status-registers.md): The condition-code register: the low byte of `sr`, containing the `X`, `N`, `Z`, `V` and `C` flags.
- [`sr`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/status-registers.md): The 16-bit status register. Its upper byte contains system flags; its lower byte contains the condition codes.

## Example

```m68k
move.l #%00001111, d0
ori.b #%11110000, d0 ; d0 = %11111111
```
