LSL Load Segment Limit Flags: O D I T S Z A P C - - - - - * - - - LSL destination,source CPU: 286+ p
Logic if selector(source) visible at CPL ZF ← 1 destination ← segment limit of selector(source) else ZF ← 0 endif
LSL loads a register with a segment limit. The limit comes from the descriptor for the segment specified by the selector in the second operand. If the source selector is visible at the current privilege level (CPL) weakened by RPL, and the descriptor is a type accepted by LSL, the zero flag (ZF) is set to 1. Otherwise, ZF is reset to 0 and the destination register is unchanged.
The segment limit is loaded as a byte granular value. If the descriptor uses a page granular (G bit = 1) segment limit, LSL translates that value to a byte limit (shifts it left 12 bits and fills the low 12 bits with 1s) before loading it into the destination register.
If used with a 16-bit destination register (and an operand-size attribute of 32), LSL stores the low-order 16 bits of the 32-bit byte granular limit in the destination register.
Code and data segment descriptors are valid for LSL.
The value placed in the destination register is the offset of the last addressable byte in the segment.