The LAR instruction stores a marked form of the second doubleword of the descriptor for the source selector if the selector is visible at the current privilege level (modified by the selector's RPL) and is a valid descriptor type within the descriptor limits. The destination register is loaded with the high-order doubleword of the descriptor masked by 00FxFF00, and the ZF flag is set. The x indicates that the four bits corresponding to the upper four bits of the limit are undefined in the value loaded by the LAR instruction. If the selector is invisible or of the wrong type, the ZF flag is cleared.
If the 32-bit operand size is specified, the entire 32-bit value is loaded into the 32-bit destination register. If the 16-bit operand size is specified, the lower 16-bits of this value are stored in the 16-bit destination register.
All code and data segment descriptors are valid for the LAR instruction.
The valid special segment and gate descriptor types for the LAR 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 │ Valid │ ├──────┼──────────────────────────┼───────────────┤ │ 5 │16-bit/32-bit task gate │ Valid │ ├──────┼──────────────────────────┼───────────────┤ │ 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 │ Valid │ ├──────┼──────────────────────────┼───────────────┤ │ D │Invalid │ Invalid │ ├──────┼──────────────────────────┼───────────────┤ │ E │32-bit trap gate │ Invalid │ ├──────┼──────────────────────────┼───────────────┤ │ F │32-bit interrupt gate │ Invalid │ └──────┴──────────────────────────┴───────────────┘