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

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

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005ARPLAdjust Requestor Privilege LevelCompares the requestor privilege level (RPL) fields of two segment selectors in thesource and destination operands of the instruction. If the RPL field of the destinationoperand is less than the RPL field of the segment selector in the source register, thenthe zero flag is set and the RPL field of the destination operand is increased to matchthat of the source operand. Otherwise, the destination operand remains unchangedand the zero flag is cleared.The destination operand can be either a 16-bit register or memory location; the sourceoperand must be a 16-bit register.The ARPL instruction is intended for use by operating-system procedures to adjustthe RPL of a segment selector that has been passed to the operating system by anapplication program to match the privilege level of the application program. Thesegment selector passed to the operating system is placed in the destination operandand the segment selector for the code segment of the application program is placed inthe source operand. The RPL field in the source operand represents the privilege levelof the application program. The ARPL instruction then insures that the RPL of thesegment selector received by the operating system is no lower than the privilege levelof the application program.See “Adjusting Access Rights” in Volume 2, for more information on access rights.In 64-bit mode, this opcode (63H) is used for the MOVSXD instruction.Mnemonic Opcode DescriptionARPL reg/mem16, reg16 63 /r Adjust the RPL of a destination segment selector to a levelnot less than the RPL of the segment selector specified inthe 16-bit source register.(Invalid in 64-bit mode.)Related InstructionsLAR, LSL, VERR, VERW298 ARPL

24594 Rev. 3.10 February 2005 AMD64 TechnologyrFLAGS AffectedID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CF21 20 19 18 17 16 14 13–12 11 10 9 8 7 6 4 2 0Note: Bits 31–22, 15, 5, 3, and 1 are reserved. A flag set to one or cleared to zero is M (modified). Unaffected flags are blank. Undefinedflags are U.ExceptionsException RealVirtual8086 Protected Cause of ExceptionInvalid opcode, #UD X X This instruction is only recognized in protected legacy andcompatibility mode.Stack, #SS X A memory address exceeded the stack segment limit.General protection, #GPX A memory address exceeded a data segment limit.MXThe destination operand was in a non-writable segment.X A null segment selector was used to reference memory.Page fault, #PF X A page fault resulted from the execution of the instruction.Alignment check, #AC X An unaligned memory reference was performed while alignmentchecking was enabled.ARPL 299

AMD64 Technology 24594 Rev. 3.10 February 2005ARPLAdjust Requestor Privilege LevelCompares the requestor privilege level (RPL) fields of two segment selectors in thesource <strong>and</strong> destination oper<strong>and</strong>s of the instruction. If the RPL field of the destinationoper<strong>and</strong> is less than the RPL field of the segment selector in the source register, thenthe zero flag is set <strong>and</strong> the RPL field of the destination oper<strong>and</strong> is increased to matchthat of the source oper<strong>and</strong>. Otherwise, the destination oper<strong>and</strong> remains unchanged<strong>and</strong> the zero flag is cleared.The destination oper<strong>and</strong> can be either a 16-bit register or memory location; the sourceoper<strong>and</strong> must be a 16-bit register.The ARPL instruction is intended for use by operating-system procedures to adjustthe RPL of a segment selector that has been passed to the operating system by anapplication program to match the privilege level of the application program. Thesegment selector passed to the operating system is placed in the destination oper<strong>and</strong><strong>and</strong> the segment selector for the code segment of the application program is placed inthe source oper<strong>and</strong>. The RPL field in the source oper<strong>and</strong> represents the privilege levelof the application program. The ARPL instruction then insures that the RPL of thesegment selector received by the operating system is no lower than the privilege levelof the application program.See “Adjusting Access Rights” in <strong>Volume</strong> 2, for more information on access rights.In 64-bit mode, this opcode (63H) is used for the MOVSXD instruction.Mnemonic Opcode DescriptionARPL reg/mem16, reg16 63 /r Adjust the RPL of a destination segment selector to a levelnot less than the RPL of the segment selector specified inthe 16-bit source register.(Invalid in 64-bit mode.)Related <strong>Instructions</strong>LAR, LSL, VERR, VERW298 ARPL

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

Saved successfully!

Ooh no, something went wrong!