Description

The LSL instruction loads a register with an unscrambled segment limit, and sets the ZF flag, provided that the source selector is visible at the current privilege level and RPL, within the descriptor table, and that the descriptor is a type accepted by the LSL instruction. Otherwise, the ZF flag is cleared, and the destination register is unchanged. The segment limit is loaded as a byte granular value. If the descriptor has a page granular segment limit, the LSL instruction will translate it to a byte limit before loading it in the destination register (shift left 12 the 20-bit "raw" limit from descriptor, then OR with 00000FFFH).

The 32-bit forms of the LSL instruction store the 32-bit byte granular limit in the 32-bit destination register. For 16-bit operand sizes, the limit is computed to form a valid 32-bit limit. However, the upper 16 bits are chopped and only the low-order 16 bits are loaded into the destination operand.

Code and data segment descriptors are valid for the LSL instruction.

The valid special segment and gate descriptor types for the LSL instruction are given in the following table:

┌──────┬────────────────────────┬──────────────┐
│ TYPE │NAME                    │VALID/INVALID │
├──────┼────────────────────────┼──────────────┤
│  0   │Invalid                 │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  1   │Available 16-bit TSS    │ Valid        │
├──────┼────────────────────────┼──────────────┤
│  2   │LDT                     │ Valid        │
├──────┼────────────────────────┼──────────────┤
│  3   │Busy 16-bit TSS         │ Valid        │
├──────┼────────────────────────┼──────────────┤
│  4   │16-bit call gate        │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  5   │16-bit/32-bit task gate │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  6   │16-bit trap gate        │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  7   │16-bit interrupt gate   │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  8   │Invalid                 │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  9   │Available 32-bit TSS    │ Valid        │
├──────┼────────────────────────┼──────────────┤
│  A   │Invalid                 │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  B   │Busy 32-bit TSS         │ Valid        │
├──────┼────────────────────────┼──────────────┤
│  C   │32-bit call gate        │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  D   │Invalid                 │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  E   │32-bit trap gate        │ Invalid      │
├──────┼────────────────────────┼──────────────┤
│  F   │32-bit interrupt gate   │ Invalid      │
└──────┴────────────────────────┴──────────────┘


[Back: Details Table]
[Next: Flags Affected]