# `bound`

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

Web page: https://asm-editor.specy.app/documentation/x86/instruction/bound

**Check array index against bounds**

Category: System

Raises a BR exception when the signed index in the register lies outside the two signed bounds stored in memory.

186 and later · Not available in 64-bit mode

[Intel's reference: BOUND](https://intel.github.io/SDM/instruction/BOUND.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

## Forms

- `bound reg, mem` (16, 32)
  - `bound reg16, mem`
  - `bound reg32, mem`: 386 and later

## Operands

- `reg`: A general-purpose register matching the operation’s size, for example `al`, `ax`, `eax` or `rax`.
- `mem`: A memory location addressed with square brackets, for example `[rbx+8]` or `[label]`.

## Description

The first operand is the index register; the second addresses the lower bound followed by the upper bound, each the width of the register. An index below the lower bound or above the upper bound raises a `BR` exception; an index equal to either bound passes, and the instruction then does nothing.

It exists only in 16- and 32-bit code: 64-bit mode reuses its opcode byte as the EVEX prefix of AVX-512 instructions.
