bndcl

Check Lower Bound

BNDCL b, r/m

Checks if address is within lower bound.

Details

Checks if an address or value is greater than or equal to the lower bound stored in the bounds register; if not, a bounds exception (#BR) is signaled. The source operand (register or memory) contains the address to be checked against bndN.lower. No flags are modified; an out-of-bounds condition triggers exception delivery. This instruction is part of deprecated Memory Protection Extensions (MPX).

Pseudocode Operation

address ← (src is memory) ? load_from_memory(src) : src;
IF (address < bndN.lower) THEN
  #BR; // Bounds Range Exceeded exception
END;
// No flags modified; execution continues on success

Example

BNDCL b, rbx

Encoding

Binary Layout
F3
+0
0F
+1
1A
+2
 
Format Legacy
Opcode F3 0F 1A
Extension MPX

Operands

  • dest
    MPX bounds register (bnd0–bnd3)
  • src
    Register or memory operand

Reference (Intel® SDM)

Instruction Forms

Opcode Instruction Op/En 64/32-bit Mode CPUID Description
F3 0F 1A /r BNDCL bnd, r/m32 RM N.E./V MPX Generate a #BR if the address in r/m32 is lower than the lower bound in bnd.LB.
F3 0F 1A /r BNDCL bnd, r/m64 RM V/N.E. MPX Generate a #BR if the address in r/m64 is lower than the lower bound in bnd.LB.

Description

Compare the address in the second operand with the lower bound in bnd. The second operand can be either a register or memory operand. If the address is lower than the lower bound in bnd.LB, it will set BNDSTATUS to 01H and signal a #BR exception. This instruction does not cause any memory access, and does not read or write any flags.

Operation

BNDCL BND, reg
IF reg < BND.LB Then
BNDSTATUS := 01H;
#BR;
FI;

BNDCL BND, mem
TEMP := LEA(mem);
IF TEMP < BND.LB Then
BNDSTATUS := 01H;
#BR;
FI;

Intel C/C++ Compiler Intrinsic Equivalent

BNDCL void  _bnd_chk_ptr_lbounds(const void *q)

Flags Affected

None

Exceptions

Protected Mode Exceptions

#BR If lower bound check fails. #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. BNDCL—Check Lower Bound Vol. 2A 3-90

Real-Address Mode Exceptions

#BR If lower bound check fails. #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.

Virtual-8086 Mode Exceptions

#BR If lower bound check fails. #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 ModRM.r/m and REX encodes BND4-BND15 when Intel MPX is enabled. Same exceptions as in protected mode. BNDCL—Check Lower Bound Vol. 2A 3-91