forked from NJU-ProjectN/i386-manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPOPF.htm
73 lines (57 loc) · 2.21 KB
/
POPF.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>80386 Programmer's Reference Manual -- Opcode POPF</TITLE>
</HEAD>
<BODY>
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="POPA.htm"> POPA/POPAD Pop all General Registers</A><BR>
<B>next:</B><A HREF="PUSH.htm"> PUSH Push Operand onto the Stack</A>
<P>
<HR>
<P>
<H1>POPF/POPFD -- Pop Stack into FLAGS or EFLAGS Register</H1>
<PRE>
Opcode Instruction Clocks Description
9D POPF 5 Pop top of stack FLAGS
9D POPFD 5 Pop top of stack into EFLAGS
</PRE>
<H2>Operation</H2>
Flags := Pop();
<H2>Description</H2>
POPF/POPFD pops the word or doubleword on the top of the stack and
stores the value in the flags register. If the operand-size attribute of
the instruction is 16 bits, then a word is popped and the value is stored in
FLAGS. If the operand-size attribute is 32 bits, then a doubleword is popped
and the value is stored in EFLAGS.
<P>
Refer to
<A HREF="c02.htm">Chapter 2</A> and
<A HREF="c04.htm">Chapter 4</A> for information about the FLAGS
and EFLAGS registers. Note that bits 16 and 17 of EFLAGS, called
VM and RF, respectively, are not affected by POPF or POPFD.
<P>
The I/O privilege level is altered only when executing at privilege level
0. The interrupt flag is altered only when executing at a level at least as
privileged as the I/O privilege level. (Real-address mode is equivalent to
privilege level 0.) If a POPF instruction is executed with insufficient
privilege, an exception does not occur, but the privileged bits do not
change.
<H2>Flags Affected</H2>
All flags except VM and RF
<H2>Protected Mode Exceptions</H2>
#SS(0) if the top of stack is not within the stack segment
<H2>Real Address Mode Exceptions</H2>
Interrupt 13 if any part of the operand would lie outside of the effective
address space from 0 to 0FFFFH
<H2>Virtual 8086 Mode Exceptions</H2>
#GP(0) fault if IOPL is less than 3, to permit emulation
<P>
<HR>
<P>
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="POPA.htm"> POPA/POPAD Pop all General Registers</A><BR>
<B>next:</B><A HREF="PUSH.htm"> PUSH Push Operand onto the Stack</A>
</BODY>