Instruction Set
4-180
POPF
Pop Flags from Stack
POPF
What It Does
POPF copies a component from the top of the stack, loads it into the Processor Status
Flags (FLAGS) register, and then removes the storage space for the component from the
stack.
Syntax
Description
POPF pops a word from the top of the stack and stores the value in the FLAGS register.
Operation It Performs
Flag Settings After Instruction
Tips
Before you use POPF, use MOV to copy the stack segment to SS and the stack offset to SP.
To prevent an instruction or a called procedure from modifying flags that are necessary for
the successful execution of the following instructions or calling procedure, use PUSHF to
save the Processor Status Flags register. After the instruction or the procedure CALL, use
POPF to restore the saved flags.
Related Instructions
Form
Opcode
Description
Clocks
Am186 Am188
POPF
9D
Pop top word of stack into Processor Status Flags register
8
12
If you want to
See
Pop a component from the stack
POP
Pop components from the stack into the 16-bit general registers
POPA
Push the Processor Status Flags register onto the stack
PUSHF
Copy AH to the low byte of the Processor Status Flags register
SAHF
POPF
/* copy flags from stack */
FLAGS = SS:[SP];
/* delete storage from stack */
SP = SP + 2;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
Values in word at top of stack are copied into
FLAGS register bits.
res
res
res
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...