56 lines
2.7 KiB
HTML
56 lines
2.7 KiB
HTML
<html><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
|
<html>
|
|
|
|
<head>
|
|
<title>80386 Programmer's Reference Manual -- Opcode ARPL</title>
|
|
</head>
|
|
|
|
<body>
|
|
<b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="AND.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/AND.HTM"> AND Logical AND</a><br>
|
|
<b>next:</b><a href="BOUND.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/BOUND.HTM"> BOUND Check Array Index Against Bounds</a>
|
|
<p>
|
|
<hr>
|
|
<p>
|
|
<h1>ARPL -- Adjust RPL Field of Selector</h1>
|
|
<pre>
|
|
|
|
|
|
|
|
Opcode Instruction Clocks Description
|
|
|
|
63 /r ARPL r/m16,r16 pm=20/21 Adjust RPL of r/m16 to not
|
|
less than RPL of r16
|
|
</pre>
|
|
<h2>Operation</h2>
|
|
<pre>
|
|
|
|
|
|
|
|
IF RPL bits(0,1) of DEST < RPL bits(0,1) of SRC
|
|
THEN
|
|
ZF := 1;
|
|
RPL bits(0,1) of DEST := RPL bits(0,1) of SRC;
|
|
ELSE
|
|
ZF := 0;
|
|
FI;
|
|
</pre>
|
|
<h2>Description</h2>
|
|
The ARPL instruction has two operands. The first operand is a 16-bit memory variable or word register that contains the value of a selector. The second operand is a word register. If the RPL field ("requested privilege level"--bottom two bits) of the first operand is less than the RPL field of the second operand, the zero flag is set to 1 and the RPL field of the first operand is increased to match the second operand. Otherwise, the zero flag is set to 0 and no change is made to the first operand.
|
|
<p>ARPL appears in operating system software, not in application programs. It is used to guarantee that a selector parameter to a subroutine does not request more privilege than the caller is allowed. The second operand of ARPL is normally a register that contains the CS selector value of the caller.
|
|
<h2>Flags Affected</h2>
|
|
ZF as described above
|
|
<h2>Protected Mode Exceptions</h2>
|
|
#GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault
|
|
<h2>Real Address Mode Exceptions</h2>
|
|
Interrupt 6; ARPL is not recognized in Real Address Mode
|
|
<h2>Virtual 8086 Mode Exceptions</h2>
|
|
Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault
|
|
<p>
|
|
<hr>
|
|
<p><b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="AND.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/AND.HTM"> AND Logical AND</a><br>
|
|
<b>next:</b><a href="BOUND.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/BOUND.HTM"> BOUND Check Array Index Against Bounds</a>
|
|
</body>
|
|
|