13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyLARLoad Access Rights ByteLoads the access rights from the segment descriptor specified by a 16-bit sourceregister or memory oper<strong>and</strong> into a specified 16-bit, 32-bit, or 64-bit general-purposeregister <strong>and</strong> sets the zero (ZF) flag in the rFLAGS register if successful. LAR clearsthe zero flag if the descriptor is invalid for any reason.The LAR instruction checks that:• the segment selector is not a null selector.• the descriptor is within the GDT or LDT limit.• the descriptor DPL is greater than or equal to both the CPL <strong>and</strong> RPL, or the segmentis a conforming code segment.• the descriptor type is valid for the LAR instruction. Valid descriptor types areshown in the following table. LDT <strong>and</strong> TSS descriptors in 64-bit mode, <strong>and</strong> callgatedescriptors in long mode, are only valid if bits 12–8 of doubleword +12 arezero, as shown on page 111 of vol. 2 in Figure 4-22.Valid Descriptor TypeDescriptionLegacy ModeLong Mode— — All code <strong>and</strong> data descriptors1 — Available 16-bit TSS2 2 LDT3 — Busy 16-bit TSS4 — 16-bit call gate5 — Task gate9 9 Available 32-bit or 64-bit TSSB B Busy 32-bit or 64-bit TSSC C 32-bit or 64-bit call gateIf the segment descriptor passes these checks, the attributes are loaded into thedestination general-purpose register. If it does not, then the zero flag is cleared <strong>and</strong>the destination register is not modified.When the oper<strong>and</strong> size is 16 bits, access rights include the DPL <strong>and</strong> Type fields locatedin bytes 4 <strong>and</strong> 5 of the descriptor table entry. Before loading the access rights into thedestination oper<strong>and</strong>, the low order word is masked with FF00H.LAR 315

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!