bndmk
Make Bounds
BNDMK b, m
Creates bounds data for MPX.
Details
Creates a bounds pair from a memory address range, storing the lower bound and upper bound in the destination bounds register (bnd0–bnd3). The source memory operand specifies an address; the instruction computes bounds from memory operand addressing. No flags are set. This instruction is part of Memory Protection Extensions (MPX) and is deprecated on modern processors.
Pseudocode Operation
// Compute bounds from memory operand m
// The bounds are derived from the addressing operation itself
lower_bound ← compute_lower_bound(m);
upper_bound ← compute_upper_bound(m);
// Store in 128-bit bounds register (2×64-bit values)
bndN.lower ← lower_bound;
bndN.upper ← upper_bound;
Example
BNDMK b, [rbp-8]
Encoding
Binary Layout
F3
+0
0F
+1
1B
+2
Operands
-
dest
MPX bounds register (bnd0–bnd3) -
src
Memory operand
Reference (Intel® SDM)
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| F3 0F 1B /r | BNDMK bnd, m32 | RM | N.E./V | MPX | Make lower and upper bounds from m32 and store them in bnd. |
| F3 0F 1B /r | BNDMK bnd, m64 | RM | V/N.E. | MPX | Make lower and upper bounds from m64 and store them in bnd. |
Description
Makes bounds from the second operand and stores the lower and upper bounds in the bound register bnd. The second operand must be a memory operand. The content of the base register from the memory operand is stored in the lower bound bnd.LB. The 1's complement of the effective address of m32/m64 is stored in the upper bound b.UB. Computation of m32/m64 has identical behavior to LEA.
This instruction does not cause any memory access, and does not read or write any flags.
If the instruction did not specify base register, the lower bound will be zero. The reg-reg form of this instruction retains legacy behavior (NOP).
The instruction causes an invalid-opcode exception (#UD) if executed in 64-bit mode with RIP-relative addressing.
Operation
BND.LB := SRCMEM.base; IF 64-bit mode Then BND.UB := NOT(LEA.64_bits(SRCMEM)); ELSE BND.UB := Zero_Extend.64_bits(NOT(LEA.32_bits(SRCMEM))); FI;
Intel C/C++ Compiler Intrinsic Equivalent
BNDMKvoid * _bnd_set_ptr_bounds(const void * q, size_t size);
Flags Affected
None.
Exceptions
Protected Mode Exceptions
#UD If the LOCK prefix is used.
If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled.
If 67H prefix is not used and CS.D=0.
If 67H prefix is used and CS.D=1.
Real-Address Mode Exceptions
#UD If the LOCK prefix is used.
If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled.
If 16-bit addressing is used.
BNDMK—Make Bounds Vol. 2A 3-97
Virtual-8086 Mode Exceptions
#UD If the LOCK prefix is used.
If ModRM.r/m encodes BND4-BND7 when Intel MPX is enabled.
If 16-bit addressing is used.
Compatibility Mode Exceptions
Same exceptions as in protected mode.
64-Bit Mode Exceptions
#UD If the LOCK prefix is used.
If ModRM.r/m and REX encodes BND4-BND15 when Intel MPX is enabled.
If RIP-relative addressing is used.
#SS(0) If the memory address referencing the SS segment is in a non-canonical form.
#GP(0) If the memory address is in a non-canonical form.
Same exceptions as in protected mode.
BNDMK—Make Bounds Vol. 2A 3-98