arpl
Adjust Requested Privilege Level
Adjusts RPL of selector to match current CPL (Legacy).
Details
Adjusts the Requested Privilege Level (RPL) field of a selector to match the current Code Privilege Level (CPL) if the selector's current RPL is less privileged than CPL. If the adjustment occurs, ZF is set; otherwise ZF is cleared. This is a legacy instruction used in 32-bit protected mode to enforce privilege level consistency; it is not supported in 64-bit mode. All flags except ZF are unchanged.
Pseudocode Operation
selector ← dest[15:0];
rpl ← selector[1:0];
cpl ← current_cpl;
if (rpl < cpl) {
selector[1:0] ← cpl;
dest ← selector;
ZF ← 1;
} else {
ZF ← 0;
}
Example
Encoding
Operands
-
dest
16-bit register or memory -
src
16-bit general-purpose register
Reference (Intel® SDM)
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| 63 /r | ARPL r/m16, r16 | MR | Valid | N. E. | Adjust RPL of r/m16 to not less than RPL of r16. |
Description
Operation
IF 64-BIT MODE THEN See MOVSXD; ELSE IF DEST[RPL] < SRC[RPL] THEN ZF := 1; DEST[RPL] := SRC[RPL]; ELSE ZF := 0; FI; FI;
Flags Affected
The ZF flag is set to 1 if the RPL field of the destination operand is less than that of the source operand; otherwise, it is set to 0. ARPL—Adjust RPL Field of Segment Selector Vol. 2A 3-75