IA-32 Assembly Language Reference Manual

Adjust RPL Field of Selector (arpl)

arpl	r16, r/m16

Operation

If RPL 1 < RPL 2, 1 -> ZF

Description

arpl has two operands. The first operand is a 16-bit word register or memory variable that contains the value of a selector. The second operand is a word register. If the RPL field of the second operand is greater than the RPL field of the first operand, ZF is set to 1 and the RPL field of the first operand is increased to match the RPL field of the second operand. Otherwise, no change is made to the first operand and the ZF is set to 0.

arpl is not used in application programs, it is used in operating systems.

arpl guarantees that a selector to a subroutine does not request a privilege greater than allowed. Normally, the second operand of arpl is a register that contains the CS selector value of the caller.

Example
arpl %sp, 5(%ebx)